/* ============================================================
   MMTH Component Library
   All classes namespaced .mmth-*  |  Uses tokens exclusively
   ============================================================ */

/* --- Root Reset & Defaults --- */

.mmth-root {
  font-family: var(--mmth-font-body);
  font-size: var(--mmth-body-m-size);
  line-height: var(--mmth-body-m-leading);
  color: var(--mmth-text-primary);
  background: var(--mmth-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mmth-root *, .mmth-root *::before, .mmth-root *::after {
  box-sizing: border-box;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

/* Display — Aktiv Grotesk Bold, ALL CAPS */
.mmth-display-xl,
.mmth-display-l,
.mmth-display-m,
.mmth-display-s {
  font-family: var(--mmth-font-display);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mmth-text-primary);
  margin: 0;
}

.mmth-display-xl {
  font-size: var(--mmth-display-xl-size);
  line-height: var(--mmth-display-xl-leading);
  letter-spacing: var(--mmth-display-xl-tracking);
}

.mmth-display-l {
  font-size: var(--mmth-display-l-size);
  line-height: var(--mmth-display-l-leading);
  letter-spacing: var(--mmth-display-l-tracking);
}

.mmth-display-m {
  font-size: var(--mmth-display-m-size);
  line-height: var(--mmth-display-m-leading);
  letter-spacing: var(--mmth-display-m-tracking);
}

.mmth-display-s {
  font-size: var(--mmth-display-s-size);
  line-height: var(--mmth-display-s-leading);
  letter-spacing: var(--mmth-display-s-tracking);
}

/* Labels — Cake Mono, ALL CAPS */
.mmth-label-l,
.mmth-label-m,
.mmth-label-s {
  font-family: var(--mmth-font-label);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mmth-text-secondary);
  margin: 0;
}

.mmth-label-l {
  font-size: var(--mmth-label-l-size);
  line-height: var(--mmth-label-l-leading);
  letter-spacing: var(--mmth-label-l-tracking);
}

.mmth-label-m {
  font-size: var(--mmth-label-m-size);
  line-height: var(--mmth-label-m-leading);
  letter-spacing: var(--mmth-label-m-tracking);
}

.mmth-label-s {
  font-size: var(--mmth-label-s-size);
  line-height: var(--mmth-label-s-leading);
  letter-spacing: var(--mmth-label-s-tracking);
}

/* Body — Aktiv Grotesk */
.mmth-body-l {
  font-family: var(--mmth-font-body);
  font-size: var(--mmth-body-l-size);
  line-height: var(--mmth-body-l-leading);
  color: var(--mmth-text-primary);
  margin: 0;
}

.mmth-body-m {
  font-family: var(--mmth-font-body);
  font-size: var(--mmth-body-m-size);
  line-height: var(--mmth-body-m-leading);
  color: var(--mmth-text-primary);
  margin: 0;
}

.mmth-body-s {
  font-family: var(--mmth-font-body);
  font-size: var(--mmth-body-s-size);
  line-height: var(--mmth-body-s-leading);
  color: var(--mmth-text-secondary);
  margin: 0;
}

.mmth-body-xs {
  font-family: var(--mmth-font-body);
  font-size: var(--mmth-body-xs-size);
  line-height: var(--mmth-body-xs-leading);
  color: var(--mmth-text-tertiary);
  margin: 0;
}

/* Callout — Aktiv Grotesk Bold Italic */
.mmth-callout {
  font-family: var(--mmth-font-body);
  font-size: var(--mmth-body-m-size);
  line-height: var(--mmth-body-m-leading);
  font-weight: 700;
  font-style: italic;
  color: var(--mmth-text-primary);
  margin: 0;
}

/* Stat Numbers — Aktiv Grotesk Bold for dashboard KPIs/values.
   Line-height: 1.1 so numbers don't overlap labels above them. */
.mmth-stat-xl,
.mmth-stat-l,
.mmth-stat-m,
.mmth-stat-s {
  font-family: var(--mmth-font-body);
  font-weight: 700;
  line-height: 1.1;
  color: var(--mmth-text-primary);
  margin: 0;
}

.mmth-stat-xl { font-size: var(--mmth-display-xl-size); }
.mmth-stat-l  { font-size: var(--mmth-display-l-size); }
.mmth-stat-m  { font-size: var(--mmth-display-m-size); }
.mmth-stat-s  { font-size: var(--mmth-display-s-size); }

/* ============================================================
   BUTTONS
   ============================================================ */

.mmth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mmth-space-2);
  padding: var(--mmth-space-3) var(--mmth-space-5);
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-m-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-m-tracking);
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--mmth-radius);
  cursor: pointer;
  transition: all var(--mmth-transition-fast);
  white-space: nowrap;
  line-height: 1;
}

.mmth-btn:focus-visible {
  outline: 2px solid var(--mmth-accent);
  outline-offset: 2px;
}

/* Primary — green accent outline (matches mmth.co button style) */
.mmth-btn-primary {
  background: transparent;
  color: var(--mmth-text-primary);
  border: 2px solid var(--mmth-accent);
}

.mmth-btn-primary:hover {
  background: var(--mmth-accent);
  color: var(--mmth-black);
}

.mmth-btn-primary:active {
  background: var(--mmth-accent);
  color: var(--mmth-black);
  filter: brightness(0.92);
}

/* Secondary — solid black */
.mmth-btn-secondary {
  background: var(--mmth-black);
  color: var(--mmth-white);
  border-color: var(--mmth-black);
}

.mmth-btn-secondary:hover {
  background: var(--mmth-gray-800);
  border-color: var(--mmth-gray-800);
}

.mmth-btn-secondary:active {
  background: var(--mmth-gray-900);
  border-color: var(--mmth-gray-900);
}

/* Ghost — minimal */
.mmth-btn-ghost {
  background: transparent;
  color: var(--mmth-text-secondary);
  border-color: transparent;
}

.mmth-btn-ghost:hover {
  background: var(--mmth-bg-secondary);
  color: var(--mmth-text-primary);
}

.mmth-btn-ghost:active {
  background: var(--mmth-bg-tertiary);
}

/* Icon button — square */
.mmth-btn-icon {
  padding: var(--mmth-space-2);
  min-width: 36px;
  min-height: 36px;
}

/* Button sizes */
.mmth-btn-sm {
  padding: var(--mmth-space-1) var(--mmth-space-3);
  font-size: var(--mmth-label-s-size);
}

.mmth-btn-lg {
  padding: var(--mmth-space-4) var(--mmth-space-6);
  font-size: var(--mmth-label-l-size);
}

/* Disabled state */
.mmth-btn:disabled,
.mmth-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   CARDS
   ============================================================ */

.mmth-card {
  background: var(--mmth-bg-primary);
  border: 1px solid var(--mmth-border-light);
  border-radius: var(--mmth-radius);
  overflow: hidden;
}

.mmth-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--mmth-space-4) var(--mmth-space-5);
  border-bottom: 1px solid var(--mmth-border-light);
}

.mmth-card-title {
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-l-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-l-tracking);
  text-transform: uppercase;
  color: var(--mmth-text-primary);
  margin: 0;
}

.mmth-card-body {
  padding: var(--mmth-space-5);
}

.mmth-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--mmth-space-3);
  padding: var(--mmth-space-4) var(--mmth-space-5);
  border-top: 1px solid var(--mmth-border-light);
}

/* ============================================================
   IMAGE CARDS — Portfolio/project gallery (from mmth.co)
   ============================================================ */

.mmth-image-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--mmth-radius);
  cursor: pointer;
}

.mmth-image-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--mmth-transition-slow);
}

.mmth-image-card:hover .mmth-image-card-img {
  transform: scale(1.03);
}

.mmth-image-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--mmth-space-5);
  opacity: 0;
  transition: opacity var(--mmth-transition-base);
}

.mmth-image-card:hover .mmth-image-card-overlay {
  opacity: 1;
}

.mmth-image-card-overlay h3,
.mmth-image-card-overlay p {
  color: var(--mmth-white);
  margin: 0;
}

.mmth-image-card-overlay p {
  color: var(--mmth-cream);
}

/* ============================================================
   TABLES
   ============================================================ */

.mmth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--mmth-body-s-size);
}

.mmth-table thead {
  background: var(--mmth-black);
  color: var(--mmth-white);
}

.mmth-table th {
  padding: var(--mmth-space-3) var(--mmth-space-4);
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-s-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-s-tracking);
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.mmth-table td {
  padding: var(--mmth-space-3) var(--mmth-space-4);
  border-bottom: 1px solid var(--mmth-border-light);
  color: var(--mmth-text-primary);
}

.mmth-table tbody tr:nth-child(even) {
  background: var(--mmth-bg-secondary);
}

.mmth-table tbody tr:hover {
  background: var(--mmth-bg-tertiary);
}

.mmth-table tbody tr.mmth-row-selected {
  background: var(--mmth-accent-10);
  border-left: 3px solid var(--mmth-accent);
}

/* ============================================================
   FORMS
   ============================================================ */

.mmth-input,
.mmth-textarea,
.mmth-select {
  width: 100%;
  padding: var(--mmth-space-3) var(--mmth-space-4);
  font-family: var(--mmth-font-body);
  font-size: var(--mmth-body-s-size);
  color: var(--mmth-text-primary);
  background: var(--mmth-bg-primary);
  border: 1px solid var(--mmth-border-medium);
  border-radius: var(--mmth-radius);
  transition: border-color var(--mmth-transition-fast);
  outline: none;
}

.mmth-input::placeholder,
.mmth-textarea::placeholder {
  color: var(--mmth-text-tertiary);
}

.mmth-input:focus,
.mmth-textarea:focus,
.mmth-select:focus {
  border-color: var(--mmth-accent);
  box-shadow: 0 0 0 2px var(--mmth-accent-20);
}

/* Error state */
.mmth-input-error,
.mmth-textarea-error {
  border-color: var(--mmth-error);
}

.mmth-input-error:focus,
.mmth-textarea-error:focus {
  box-shadow: 0 0 0 2px rgba(217, 48, 37, 0.2);
}

/* Disabled state */
.mmth-input:disabled,
.mmth-textarea:disabled,
.mmth-select:disabled {
  background: var(--mmth-bg-secondary);
  color: var(--mmth-text-disabled);
  cursor: not-allowed;
}

.mmth-textarea {
  min-height: 100px;
  resize: vertical;
}

.mmth-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23808080' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--mmth-space-4) center;
  padding-right: var(--mmth-space-7);
}

/* Form helper text */
.mmth-form-hint {
  font-size: var(--mmth-body-xs-size);
  color: var(--mmth-text-tertiary);
  margin-top: var(--mmth-space-1);
}

.mmth-form-error {
  font-size: var(--mmth-body-xs-size);
  color: var(--mmth-error);
  margin-top: var(--mmth-space-1);
}

/* Form label */
.mmth-form-label {
  display: block;
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-s-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-s-tracking);
  text-transform: uppercase;
  color: var(--mmth-text-secondary);
  margin-bottom: var(--mmth-space-2);
}

/* Checkbox & Radio */
.mmth-checkbox,
.mmth-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--mmth-space-2);
  cursor: pointer;
  font-size: var(--mmth-body-s-size);
  color: var(--mmth-text-primary);
}

.mmth-checkbox input,
.mmth-radio input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--mmth-black);
  cursor: pointer;
}

/* ============================================================
   BADGES
   ============================================================ */

.mmth-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--mmth-space-1);
  padding: 2px var(--mmth-space-2);
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-s-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-s-tracking);
  text-transform: uppercase;
  border-radius: var(--mmth-radius);
  background: var(--mmth-bg-tertiary);
  color: var(--mmth-text-secondary);
  line-height: 1.6;
}

.mmth-badge-success {
  background: var(--mmth-accent-20);
  color: #4a4f00;
}

[data-theme="dark"] .mmth-badge-success {
  color: var(--mmth-accent);
}

.mmth-badge-error {
  background: rgba(217, 48, 37, 0.15);
  color: var(--mmth-error);
}

.mmth-badge-warning {
  background: rgba(240, 117, 57, 0.15);
  color: var(--mmth-warning);
}

/* ============================================================
   NAVIGATION — Sidebar
   ============================================================ */

.mmth-sidebar {
  width: var(--mmth-sidebar-width);
  height: 100vh;
  background: var(--mmth-bg-primary);
  border-right: 1px solid var(--mmth-border-light);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.mmth-sidebar-header {
  padding: var(--mmth-space-4) var(--mmth-space-5);
  border-bottom: 1px solid var(--mmth-border-light);
}

.mmth-sidebar-nav {
  padding: var(--mmth-space-3);
  flex: 1;
}

.mmth-nav-section {
  margin-bottom: var(--mmth-space-4);
}

.mmth-nav-section-title {
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-s-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-s-tracking);
  text-transform: uppercase;
  color: var(--mmth-text-tertiary);
  padding: var(--mmth-space-2) var(--mmth-space-3);
  margin: 0;
}

.mmth-nav-link {
  display: flex;
  align-items: center;
  gap: var(--mmth-space-3);
  padding: var(--mmth-space-2) var(--mmth-space-3);
  font-size: var(--mmth-body-s-size);
  color: var(--mmth-text-secondary);
  text-decoration: none;
  border-radius: var(--mmth-radius);
  transition: all var(--mmth-transition-fast);
  cursor: pointer;
}

.mmth-nav-link:hover {
  background: var(--mmth-bg-secondary);
  color: var(--mmth-text-primary);
}

.mmth-nav-link-active {
  background: var(--mmth-accent-10);
  color: var(--mmth-text-primary);
  border-left: 3px solid var(--mmth-accent);
}

/* ============================================================
   NAVIGATION — Topbar
   ============================================================ */

.mmth-topbar {
  height: var(--mmth-topbar-height);
  background: var(--mmth-black);
  color: var(--mmth-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--mmth-space-5);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mmth-topbar-title {
  font-family: var(--mmth-font-display);
  font-size: var(--mmth-display-s-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ============================================================
   TABS
   ============================================================ */

.mmth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--mmth-border-light);
}

.mmth-tab {
  padding: var(--mmth-space-3) var(--mmth-space-5);
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-m-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-m-tracking);
  text-transform: uppercase;
  color: var(--mmth-text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--mmth-transition-fast);
  margin-bottom: -1px;
}

.mmth-tab:hover {
  color: var(--mmth-text-primary);
}

.mmth-tab-active {
  color: var(--mmth-text-primary);
  border-bottom-color: var(--mmth-black);
}

[data-theme="dark"] .mmth-tab-active {
  border-bottom-color: var(--mmth-white);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */

.mmth-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--mmth-space-2);
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-s-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-s-tracking);
  text-transform: uppercase;
}

.mmth-breadcrumb a {
  color: var(--mmth-text-tertiary);
  text-decoration: none;
  transition: color var(--mmth-transition-fast);
}

.mmth-breadcrumb a:hover {
  color: var(--mmth-text-primary);
}

.mmth-breadcrumb-sep {
  color: var(--mmth-text-disabled);
}

.mmth-breadcrumb-current {
  color: var(--mmth-text-primary);
}

/* ============================================================
   AVATAR
   ============================================================ */

.mmth-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mmth-radius);
  background: var(--mmth-gray-800);
  color: var(--mmth-white);
  font-family: var(--mmth-font-label);
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
  flex-shrink: 0;
  object-fit: cover;
}

.mmth-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: var(--mmth-label-s-size);
  letter-spacing: var(--mmth-label-s-tracking);
}

.mmth-avatar-md {
  width: 40px;
  height: 40px;
  font-size: var(--mmth-label-m-size);
  letter-spacing: var(--mmth-label-m-tracking);
}

.mmth-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: var(--mmth-label-l-size);
  letter-spacing: var(--mmth-label-l-tracking);
}

/* ============================================================
   TOGGLE / SWITCH
   ============================================================ */

.mmth-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--mmth-space-3);
  cursor: pointer;
}

.mmth-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mmth-toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--mmth-gray-300);
  border-radius: 11px;
  transition: background var(--mmth-transition-fast);
  flex-shrink: 0;
}

.mmth-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--mmth-white);
  border-radius: 50%;
  transition: transform var(--mmth-transition-fast);
  box-shadow: var(--mmth-shadow-sm);
}

.mmth-toggle input:checked + .mmth-toggle-track {
  background: var(--mmth-accent);
}

.mmth-toggle input:checked + .mmth-toggle-track::after {
  transform: translateX(18px);
}

.mmth-toggle input:focus-visible + .mmth-toggle-track {
  outline: 2px solid var(--mmth-accent);
  outline-offset: 2px;
}

/* ============================================================
   TOOLTIP
   ============================================================ */

.mmth-tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--mmth-text-tertiary);
}

.mmth-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--mmth-space-1) var(--mmth-space-2);
  background: var(--mmth-gray-900);
  color: var(--mmth-white);
  font-family: var(--mmth-font-body);
  font-size: var(--mmth-body-xs-size);
  line-height: 1.4;
  white-space: nowrap;
  border-radius: var(--mmth-radius);
  opacity: 0;
  visibility: hidden;
  transition: all var(--mmth-transition-fast);
  pointer-events: none;
  z-index: 1000;
}

.mmth-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   MODAL
   ============================================================ */

.mmth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--mmth-transition-base);
}

.mmth-modal-overlay.mmth-active {
  opacity: 1;
  visibility: visible;
}

.mmth-modal {
  background: var(--mmth-bg-primary);
  border-radius: var(--mmth-radius);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--mmth-shadow-lg);
}

.mmth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--mmth-space-4) var(--mmth-space-5);
  border-bottom: 1px solid var(--mmth-border-light);
}

.mmth-modal-title {
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-l-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-l-tracking);
  text-transform: uppercase;
  margin: 0;
}

.mmth-modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--mmth-text-tertiary);
  cursor: pointer;
  padding: var(--mmth-space-1);
  line-height: 1;
}

.mmth-modal-close:hover {
  color: var(--mmth-text-primary);
}

.mmth-modal-body {
  padding: var(--mmth-space-5);
}

.mmth-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--mmth-space-3);
  padding: var(--mmth-space-4) var(--mmth-space-5);
  border-top: 1px solid var(--mmth-border-light);
}

/* ============================================================
   TOAST
   ============================================================ */

.mmth-toast {
  display: flex;
  align-items: center;
  gap: var(--mmth-space-3);
  padding: var(--mmth-space-3) var(--mmth-space-4);
  background: var(--mmth-gray-900);
  color: var(--mmth-white);
  border-radius: var(--mmth-radius);
  box-shadow: var(--mmth-shadow-lg);
  font-size: var(--mmth-body-s-size);
  min-width: 280px;
  max-width: 420px;
}

.mmth-toast-success {
  border-left: 3px solid var(--mmth-accent);
}

.mmth-toast-error {
  border-left: 3px solid var(--mmth-error);
}

/* ============================================================
   PROGRESS
   ============================================================ */

.mmth-progress {
  width: 100%;
  height: 6px;
  background: var(--mmth-bg-tertiary);
  border-radius: var(--mmth-radius);
  overflow: hidden;
}

.mmth-progress-bar {
  height: 100%;
  background: var(--mmth-accent);
  border-radius: var(--mmth-radius);
  transition: width var(--mmth-transition-slow);
}

/* ============================================================
   SKELETON / LOADING
   ============================================================ */

.mmth-skeleton {
  background: var(--mmth-bg-tertiary);
  border-radius: var(--mmth-radius);
  position: relative;
  overflow: hidden;
}

.mmth-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: mmth-shimmer 1.5s infinite;
}

@keyframes mmth-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

[data-theme="dark"] .mmth-skeleton::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.mmth-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--mmth-space-8) var(--mmth-space-5);
  text-align: center;
}

.mmth-empty-state-icon {
  font-size: 2.5rem;
  color: var(--mmth-text-tertiary);
  margin-bottom: var(--mmth-space-4);
}

.mmth-empty-state-title {
  font-family: var(--mmth-font-label);
  font-size: var(--mmth-label-l-size);
  font-weight: 700;
  letter-spacing: var(--mmth-label-l-tracking);
  text-transform: uppercase;
  color: var(--mmth-text-secondary);
  margin: 0 0 var(--mmth-space-2);
}

.mmth-empty-state-desc {
  font-size: var(--mmth-body-s-size);
  color: var(--mmth-text-tertiary);
  max-width: 360px;
  margin: 0;
}

/* ============================================================
   HERO — Marketing pages
   ============================================================ */

.mmth-hero {
  background: var(--mmth-black);
  color: var(--mmth-white);
  padding: var(--mmth-space-9) var(--mmth-space-5);
  text-align: center;
}

.mmth-hero .mmth-display-xl,
.mmth-hero .mmth-display-l {
  color: var(--mmth-white);
}

.mmth-hero .mmth-body-l,
.mmth-hero .mmth-body-m {
  color: var(--mmth-cream);
  max-width: 640px;
  margin: var(--mmth-space-4) auto 0;
}

/* Hero with background image */
.mmth-hero-image {
  position: relative;
  background-size: cover;
  background-position: center;
}

.mmth-hero-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.mmth-hero-image > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   FOOTER
   ============================================================ */

.mmth-footer {
  background: var(--mmth-black);
  color: var(--mmth-white);
  padding: var(--mmth-space-7) var(--mmth-space-5);
}

.mmth-footer a {
  color: var(--mmth-gray-400);
  text-decoration: none;
  transition: color var(--mmth-transition-fast);
}

.mmth-footer a:hover {
  color: var(--mmth-white);
}

.mmth-footer-bottom {
  border-top: 1px solid var(--mmth-gray-800);
  margin-top: var(--mmth-space-6);
  padding-top: var(--mmth-space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mmth-social-links {
  display: flex;
  gap: var(--mmth-space-4);
}

.mmth-social-links a {
  color: var(--mmth-gray-500);
  font-size: 1.25rem;
  transition: color var(--mmth-transition-fast);
}

.mmth-social-links a:hover {
  color: var(--mmth-white);
}

/* ============================================================
   DIVIDER
   ============================================================ */

.mmth-divider {
  border: none;
  border-top: 1px solid var(--mmth-border-light);
  margin: var(--mmth-space-5) 0;
}

/* ============================================================
   ASPECT RATIO CONTAINERS
   ============================================================ */

.mmth-aspect-16-9 {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.mmth-aspect-3-2 {
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.mmth-aspect-4-3 {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.mmth-aspect-1-1 {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.mmth-aspect-16-9 img,
.mmth-aspect-3-2 img,
.mmth-aspect-4-3 img,
.mmth-aspect-1-1 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.mmth-container {
  width: 100%;
  max-width: var(--mmth-container-max);
  margin: 0 auto;
  padding: 0 var(--mmth-space-5);
}

.mmth-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--mmth-space-5);
}

.mmth-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--mmth-space-5);
}

.mmth-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--mmth-space-5);
}

.mmth-flex {
  display: flex;
  gap: var(--mmth-space-4);
}

.mmth-flex-wrap {
  flex-wrap: wrap;
}

.mmth-flex-center {
  align-items: center;
}

.mmth-flex-between {
  justify-content: space-between;
}

/* ============================================================
   LOGO HELPERS
   CRITICAL: Logos must NEVER be distorted. These rules enforce
   aspect-ratio-safe sizing. Never override width on logos.
   Never put logos in flex/grid containers without flex-shrink:0.
   ============================================================ */

.mmth-logo {
  display: inline-block;
  height: auto;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  flex-shrink: 0;        /* Prevent flex containers from squishing */
  flex-grow: 0;          /* Prevent flex containers from stretching */
  aspect-ratio: auto;    /* Let the image's natural ratio win */
}

/* Height-only sizing — preserves aspect ratio.
   NEVER set width on these. NEVER use width:100%.
   If the logo looks wrong, you set width somewhere. Remove it. */
.mmth-logo-sm { height: 24px; width: auto !important; }
.mmth-logo-md { height: 40px; width: auto !important; }
.mmth-logo-lg { height: 64px; width: auto !important; }
.mmth-logo-xl { height: 96px; width: auto !important; }

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */

@media (max-width: 768px) {
  .mmth-grid-2,
  .mmth-grid-3,
  .mmth-grid-4 {
    grid-template-columns: 1fr;
  }

  .mmth-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--mmth-border-light);
  }

  .mmth-display-xl { font-size: 2.5rem; }
  .mmth-display-l  { font-size: 2rem; }
  .mmth-display-m  { font-size: 1.5rem; }

  .mmth-container {
    padding: 0 var(--mmth-space-4);
  }

  .mmth-modal {
    width: 95%;
    max-height: 90vh;
  }

  .mmth-table {
    font-size: var(--mmth-body-xs-size);
  }

  .mmth-table th,
  .mmth-table td {
    padding: var(--mmth-space-2) var(--mmth-space-3);
  }

  .mmth-hero {
    padding: var(--mmth-space-8) var(--mmth-space-4);
  }

  .mmth-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 576px) {
  .mmth-grid-2 {
    grid-template-columns: 1fr;
  }

  .mmth-topbar {
    padding: 0 var(--mmth-space-3);
  }

  .mmth-btn-lg {
    padding: var(--mmth-space-3) var(--mmth-space-5);
    font-size: var(--mmth-label-m-size);
  }
}

/* ============================================================
   SPACING UTILITIES
   ============================================================ */

.mmth-mt-1 { margin-top: var(--mmth-space-1); }
.mmth-mt-2 { margin-top: var(--mmth-space-2); }
.mmth-mt-3 { margin-top: var(--mmth-space-3); }
.mmth-mt-4 { margin-top: var(--mmth-space-4); }
.mmth-mt-5 { margin-top: var(--mmth-space-5); }
.mmth-mt-6 { margin-top: var(--mmth-space-6); }
.mmth-mt-7 { margin-top: var(--mmth-space-7); }
.mmth-mt-8 { margin-top: var(--mmth-space-8); }

.mmth-mb-1 { margin-bottom: var(--mmth-space-1); }
.mmth-mb-2 { margin-bottom: var(--mmth-space-2); }
.mmth-mb-3 { margin-bottom: var(--mmth-space-3); }
.mmth-mb-4 { margin-bottom: var(--mmth-space-4); }
.mmth-mb-5 { margin-bottom: var(--mmth-space-5); }
.mmth-mb-6 { margin-bottom: var(--mmth-space-6); }
.mmth-mb-7 { margin-bottom: var(--mmth-space-7); }
.mmth-mb-8 { margin-bottom: var(--mmth-space-8); }

.mmth-p-3 { padding: var(--mmth-space-3); }
.mmth-p-4 { padding: var(--mmth-space-4); }
.mmth-p-5 { padding: var(--mmth-space-5); }
.mmth-p-6 { padding: var(--mmth-space-6); }
.mmth-p-7 { padding: var(--mmth-space-7); }

.mmth-gap-2 { gap: var(--mmth-space-2); }
.mmth-gap-3 { gap: var(--mmth-space-3); }
.mmth-gap-4 { gap: var(--mmth-space-4); }
.mmth-gap-5 { gap: var(--mmth-space-5); }

/* ============================================================
   TEXT UTILITIES
   ============================================================ */

.mmth-text-center { text-align: center; }
.mmth-text-right { text-align: right; }
.mmth-text-muted { color: var(--mmth-text-tertiary); }
.mmth-text-accent { color: var(--mmth-accent); }
.mmth-text-inverse { color: var(--mmth-text-inverse); }
.mmth-text-error { color: var(--mmth-error); }
.mmth-text-warning { color: var(--mmth-warning); }

/* ============================================================
   DISPLAY UTILITIES
   ============================================================ */

.mmth-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.mmth-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
