/*
 * CallAi Dashboard — Component Library
 * Requires: tokens.css (loaded first)
 *
 * Contents:
 *   1. App Shell (layout grid, sidebar, topbar)
 *   2. Demobar
 *   3. Card / MetricCard
 *   4. Badge / StatusDot
 *   5. Button (4 variants)
 *   6. Form Controls (Input, Select, Textarea, Toggle)
 *   7. Modal
 *   8. Drawer
 *   9. Toast
 *  10. Skeleton
 *  11. Tooltip
 *  12. Table + Pagination
 *  13. SectionHeader
 *  14. EmptyState
 *  15. Entrance Animations
 */

/* ═══════════════════════════════════════════════
   1. APP SHELL
═══════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: auto 1fr;
  min-height: calc(100vh - var(--demobar-h));
  /* topbar spans full width above content+sidebar */
}

/* Main content area */
.main-content {
  padding: var(--sp-8) var(--content-pad);
  max-width: var(--content-max);
  width: 100%;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════
   2. DEMOBAR
═══════════════════════════════════════════════ */
.demobar {
  height: var(--demobar-h);
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  border-bottom: var(--rule-w) solid var(--orange);
  position: sticky;
  top: 0;
  z-index: var(--z-overlay);
}
.demobar .pill {
  padding: 2px var(--sp-2);
  border: var(--rule-w) solid var(--orange);
  color: var(--orange);
  font-weight: 700;
}
.demobar .meta { color: var(--ink-faint); }

/* Demobar state-toggle (preview locked/active states in mockup-only).
   Ghost-pill inactive + solid orange active for unambiguous contrast. */
.demobar-toggle {
  display: inline-flex;
  gap: var(--sp-1);
  margin-left: var(--sp-3);
}
.demobar-toggle-btn {
  background: transparent;
  border: 1px solid var(--orange);
  color: var(--orange);
  padding: 3px var(--sp-3);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.demobar-toggle-btn:hover {
  background: var(--orange-tint);
  color: var(--orange);
}
.demobar-toggle-btn.is-active {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
}

/* ═══════════════════════════════════════════════
   3. SIDEBAR
═══════════════════════════════════════════════ */
.sidebar {
  background: var(--bg);
  border-right: var(--rule-w) solid var(--rule);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--demobar-h);
  height: calc(100vh - var(--demobar-h));
  /* Sticky-bottom pattern: overflow lives on .sidebar-nav so .sidebar-footer
     stays pinned even when nav-items overflow (e.g. admin with 17+ items). */
  overflow: hidden;
  z-index: var(--z-sticky);
}

/* Brand block */
.sidebar-brand {
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: var(--rule-w) solid var(--rule);
  flex-shrink: 0;
}
.brand-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--t-body);
  letter-spacing: var(--ls-tight);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--ink);
  margin-bottom: var(--sp-2);
}
.brand-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--orange);
}
.brand-tenant {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.brand-tenant::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: var(--rule-w);
  background: var(--ink-soft);
}

/* Nav */
.sidebar-nav {
  padding: var(--sp-3) 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
}
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-section {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--ink-faint);
  padding: var(--sp-4) var(--sp-5) var(--sp-2);
  margin-top: var(--sp-2);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: 9px var(--sp-5);
  font-size: var(--t-small);
  color: var(--ink-soft);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--ink);
  background: rgba(14, 14, 12, 0.035);
}
.nav-item.is-active {
  color: var(--ink);
  background: rgba(255, 80, 0, 0.05);
  border-left-color: var(--orange);
  font-weight: 500;
}
.nav-item.is-locked {
  color: var(--ink-ghost);
  cursor: not-allowed;
  pointer-events: none;
}
.nav-item.is-locked .nav-lock {
  font-size: 10px;
  opacity: 0.6;
}
.nav-item.is-pending {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.nav-item.is-pending .nav-soon {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: var(--r-full);
  background: var(--surface-alt);
  color: var(--ink-faint);
  flex-shrink: 0;
}
.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}
.nav-item.is-active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

/* Sub-items (indented) */
.nav-item.is-sub {
  padding-left: calc(var(--sp-5) + 24px);
  font-size: var(--t-micro);
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: var(--sp-4) var(--sp-5);
  border-top: var(--rule-w) solid var(--rule-faint);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  color: var(--ink-faint);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   4. TOPBAR
═══════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  border-bottom: var(--rule-w) solid var(--rule);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--content-pad);
  position: sticky;
  top: var(--demobar-h);
  z-index: var(--z-sticky);
}

.topbar-title-group { flex: 1; min-width: 0; }
.topbar-breadcrumb {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--ink-faint);
  margin-bottom: 2px;
}
.topbar-title {
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: var(--ls-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search */
.topbar-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: var(--rule-w) solid var(--rule-mid);
  border-radius: var(--r-md);
  padding: 0 var(--sp-3);
  height: 36px;
  width: clamp(160px, 20vw, 280px);
  font-size: var(--t-small);
  color: var(--ink-faint);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.topbar-search:hover { border-color: var(--ink-soft); }
.topbar-search .search-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--rule-mid);
  border-radius: var(--r-sm);
  padding: 1px 5px;
  margin-left: auto;
  color: var(--ink-faint);
}

/* Topbar actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Notification bell */
.topbar-bell {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  transition: background var(--dur-fast) var(--ease-out);
}
.topbar-bell:hover { background: var(--surface-alt); }
.topbar-bell .bell-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--orange);
  border-radius: var(--r-full);
  border: 2px solid var(--bg);
}

/* User pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px var(--sp-3) 4px var(--sp-2);
  border: var(--rule-w) solid var(--rule-mid);
  border-radius: var(--r-full);
  font-size: var(--t-small);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.user-pill:hover {
  border-color: var(--ink-soft);
  background: var(--surface-alt);
}
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  background: var(--orange);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* AI-status toggle */
.ai-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px var(--sp-3);
  border: var(--rule-w) solid var(--rule-mid);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.ai-toggle.is-live {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-tint);
}
.ai-toggle.is-offline {
  border-color: var(--rule-mid);
  color: var(--ink-faint);
}
.ai-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: currentColor;
  flex-shrink: 0;
}
.ai-toggle.is-live .ai-dot {
  animation: pulse-live 2s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

/* ═══════════════════════════════════════════════
   5. CARD / METRIC CARD
═══════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card--flat:hover { box-shadow: none; transform: none; }

.metric-card {
  background: var(--surface);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--sp-2);
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.metric-label {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--ink-faint);
}
.metric-value {
  font-family: var(--font-mono);
  font-size: var(--t-mega);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  font-feature-settings: var(--font-feat-mono);
}
.metric-value--medium {
  font-size: var(--t-display);
}
.metric-delta {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.metric-delta.is-up   { color: var(--success); }
.metric-delta.is-down { color: var(--danger); }

/* Accent bar on left edge */
.metric-card--accent-orange { border-left: 3px solid var(--orange); }
.metric-card--accent-green  { border-left: 3px solid var(--success); }
.metric-card--accent-red    { border-left: 3px solid var(--danger); }

/* ═══════════════════════════════════════════════
   6. BADGE / STATUS DOT
═══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  line-height: 1.4;
}
.badge--success  { background: var(--success-tint);  color: var(--success);  border: 1px solid var(--success-border); }
.badge--warning  { background: var(--warning-tint);  color: var(--warning);  border: 1px solid var(--warning-border); }
.badge--danger   { background: var(--danger-tint);   color: var(--danger);   border: 1px solid var(--danger-border); }
.badge--info     { background: var(--info-tint);     color: var(--info);     border: 1px solid var(--info-border); }
.badge--neutral  { background: var(--neutral-tint);  color: var(--ink-soft); border: 1px solid var(--neutral-border); }
.badge--orange   { background: var(--orange-tint);   color: var(--orange);   border: 1px solid var(--orange-tint-md); }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
}
.status-dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.status-dot--live    { color: var(--success); }
.status-dot--live::before    { background: var(--success); animation: pulse-live 2s ease-in-out infinite; }
.status-dot--busy    { color: var(--warning); }
.status-dot--busy::before    { background: var(--warning); }
.status-dot--offline { color: var(--ink-ghost); }
.status-dot--offline::before { background: var(--ink-ghost); }
.status-dot--error   { color: var(--danger); }
.status-dot--error::before   { background: var(--danger); }

/* ═══════════════════════════════════════════════
   7. BUTTON
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 8px var(--sp-4);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--t-small);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-instant) var(--ease-out);
  border: var(--rule-w) solid transparent;
  text-decoration: none;
}
.btn:active { transform: scale(0.975); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Primary */
.btn--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn--primary:hover {
  background: #1E1E1C;
  border-color: #1E1E1C;
}

/* Orange */
.btn--orange {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.btn--orange:hover {
  background: var(--orange-hover);
  border-color: var(--orange-hover);
}
.btn--orange:active { background: var(--orange-active); }

/* Secondary (outlined) */
.btn--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-mid);
}
.btn--secondary:hover {
  border-color: var(--ink-soft);
  background: var(--surface-alt);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

/* Danger */
.btn--danger {
  background: var(--danger-tint);
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn--danger:hover {
  background: var(--danger);
  color: #fff;
}

/* Sizes */
.btn--sm { padding: 5px var(--sp-3); font-size: var(--t-micro); border-radius: var(--r-sm); }
.btn--lg { padding: 11px var(--sp-6); font-size: var(--t-body); }
.btn--icon-only { padding: 7px; aspect-ratio: 1; }

/* ═══════════════════════════════════════════════
   8. FORM CONTROLS
═══════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-label {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--ink-soft);
  font-weight: 500;
}
.form-hint {
  font-size: var(--t-micro);
  color: var(--ink-faint);
}
.form-error {
  font-size: var(--t-micro);
  color: var(--danger);
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--surface);
  border: var(--rule-w) solid var(--rule-mid);
  border-radius: var(--r-md);
  padding: 8px var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  outline: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--ink-ghost); }
.input:hover,
.select:hover,
.textarea:hover  { border-color: var(--ink-soft); }
.input:focus,
.select:focus,
.textarea:focus  {
  border-color: var(--ink);
  box-shadow: var(--shadow-focus);
}
.input.is-error,
.select.is-error,
.textarea.is-error {
  border-color: var(--danger);
}
.textarea { min-height: 100px; resize: vertical; }

/* Select arrow */
.select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B8B86' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 36px; }

/* Toggle / switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  user-select: none;
}
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--rule-mid);
  border-radius: var(--r-full);
  transition: background var(--dur-base) var(--ease-out);
}
.toggle input:checked ~ .toggle-track { background: var(--success); }
.toggle input:focus-visible ~ .toggle-track { box-shadow: var(--shadow-focus); }
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-spring);
}
.toggle input:checked ~ .toggle-track ~ .toggle-thumb,
.toggle input:checked + .toggle-track + .toggle-thumb { transform: translateX(18px); }

/* ═══════════════════════════════════════════════
   9. MODAL
═══════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(8% 0.005 90 / 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  z-index: var(--z-modal);
  animation: fade-in var(--dur-modal) var(--ease-out) both;
}
.modal {
  background: var(--surface);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modal-enter var(--dur-modal) var(--ease-spring) both;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6) var(--sp-6) var(--sp-4);
  border-bottom: var(--rule-w) solid var(--rule-faint);
}
.modal-title {
  font-weight: 600;
  font-size: var(--t-h2);
  letter-spacing: var(--ls-tight);
}
.modal-body { padding: var(--sp-6); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: var(--rule-w) solid var(--rule-faint);
}

/* ═══════════════════════════════════════════════
   10. DRAWER
═══════════════════════════════════════════════ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(8% 0.005 90 / 0.4);
  z-index: var(--z-modal);
  animation: fade-in var(--dur-base) var(--ease-out) both;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 90vw);
  background: var(--surface);
  border-left: var(--rule-w) solid var(--rule);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  animation: drawer-enter var(--dur-modal) var(--ease-out) both;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: var(--rule-w) solid var(--rule-faint);
  flex-shrink: 0;
}
.drawer-title {
  font-weight: 600;
  font-size: var(--t-h2);
  letter-spacing: var(--ls-tight);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-6);
}
.drawer-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: var(--rule-w) solid var(--rule-faint);
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   11. TOAST
═══════════════════════════════════════════════ */
.toast-region {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: var(--z-toast);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-lg);
  font-size: var(--t-small);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  animation: toast-enter var(--dur-slow) var(--ease-spring) both;
}
.toast--success { background: var(--success); }
.toast--warning { background: var(--warning); }
.toast--danger  { background: var(--danger); }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-desc { font-size: var(--t-micro); opacity: 0.85; }
.toast-close { opacity: 0.7; transition: opacity var(--dur-fast) var(--ease-out); margin-top: 1px; }
.toast-close:hover { opacity: 1; }

/* ═══════════════════════════════════════════════
   12. SKELETON
═══════════════════════════════════════════════ */
.skeleton {
  display: inline-block;
  position: relative;
  overflow: hidden;
  background: var(--surface-alt);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.6) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  to { transform: translateX(100%); }
}

.skeleton-text   { height: 1em; width: 100%; margin-bottom: var(--sp-2); }
.skeleton-text--sm { width: 60%; }
.skeleton-metric { height: 4rem; width: 8rem; border-radius: var(--r-md); }
.skeleton-card   { height: 120px; width: 100%; border-radius: var(--r-lg); }

/* ═══════════════════════════════════════════════
   13. TOOLTIP
═══════════════════════════════════════════════ */
[data-tooltip] { position: relative; }
[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
[data-tooltip]::before {
  content: attr(data-tooltip);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  white-space: nowrap;
  padding: 4px var(--sp-2);
  border-radius: var(--r-sm);
  transform: translateX(-50%) translateY(4px);
}
[data-tooltip]::after {
  content: "";
  border: 5px solid transparent;
  border-top-color: var(--ink);
  bottom: calc(100% + 1px);
  transform: translateX(-50%) translateY(4px);
}
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[data-tooltip]:hover::after { transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════
   14. TABLE + PAGINATION
═══════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-small);
}
.data-table thead tr {
  border-bottom: var(--rule-w-emph) solid var(--rule);
}
.data-table th {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--ink-faint);
  font-weight: 500;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  white-space: nowrap;
}
.data-table th.is-sortable { cursor: pointer; }
.data-table th.is-sortable:hover { color: var(--ink); }
.data-table tbody tr {
  border-bottom: 1px solid var(--rule-faint);
  transition: background var(--dur-fast) var(--ease-out);
}
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--ink-soft);
  vertical-align: middle;
}
.data-table td:first-child { color: var(--ink); font-weight: 500; }

/* Table wrapper for horizontal scroll */
.table-wrapper {
  background: var(--surface);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
  overflow-x: auto;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: flex-end;
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--rule-faint);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
}
.page-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-mid);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.page-btn:hover { border-color: var(--ink-soft); background: var(--surface-alt); }
.page-btn.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ═══════════════════════════════════════════════
   15. SECTION HEADER
═══════════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.section-header-left { min-width: 0; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--ink-faint);
  margin-bottom: var(--sp-1);
}
.section-title {
  font-size: var(--t-h1);
  font-weight: 600;
  letter-spacing: var(--ls-tight);
}
.section-desc {
  font-size: var(--t-small);
  color: var(--ink-soft);
  margin-top: var(--sp-1);
}
.section-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   16. EMPTY STATE
═══════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
  gap: var(--sp-3);
}
.empty-icon {
  font-size: 2rem;
  color: var(--ink-ghost);
  margin-bottom: var(--sp-2);
}
.empty-title {
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: var(--ls-tight);
}
.empty-desc {
  font-size: var(--t-small);
  color: var(--ink-soft);
  max-width: 320px;
}

/* ═══════════════════════════════════════════════
   17. ENTRANCE ANIMATIONS
═══════════════════════════════════════════════ */

/* Keyframes */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes drawer-enter {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes toast-enter {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Stagger helper classes */
.enter { animation: slide-up var(--dur-enter) var(--ease-out) both; }
.enter--delay-1 { animation-delay: 60ms; }
.enter--delay-2 { animation-delay: 120ms; }
.enter--delay-3 { animation-delay: 180ms; }
.enter--delay-4 { animation-delay: 240ms; }
.enter--delay-5 { animation-delay: 300ms; }
.enter--delay-6 { animation-delay: 360ms; }

/* Metric cards grid stagger (apply to grid container) */
.metrics-grid .metric-card:nth-child(1) { animation-delay: 40ms; }
.metrics-grid .metric-card:nth-child(2) { animation-delay: 90ms; }
.metrics-grid .metric-card:nth-child(3) { animation-delay: 140ms; }
.metrics-grid .metric-card:nth-child(4) { animation-delay: 190ms; }
.metrics-grid .metric-card { animation: slide-up var(--dur-enter) var(--ease-out) both; }

/* Grid helpers */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }

/* ═══════════════════════════════════════════════
   18. CMD-PALETTE
═══════════════════════════════════════════════ */
.cmd-overlay {
  position: fixed; inset: 0;
  background: oklch(8% 0.005 90 / 0.60);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 10vh;
  z-index: var(--z-modal);
  animation: fade-in var(--dur-base) var(--ease-out) both;
}
.cmd-overlay[hidden] { display: none; }

.cmd-palette {
  width: min(640px, 92vw);
  background: var(--surface);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 72vh;
  animation: modal-enter var(--dur-slow) var(--ease-spring) both;
}
.cmd-header {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--rule-faint);
  flex-shrink: 0;
}
.cmd-header-icon {
  width: 18px; height: 18px; stroke: var(--ink-faint); fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.cmd-input {
  flex: 1; font-family: var(--font-sans); font-size: var(--t-body);
  color: var(--ink); background: transparent; border: none; outline: none;
}
.cmd-input::placeholder { color: var(--ink-faint); }
.cmd-esc-kbd {
  font-family: var(--font-mono); font-size: var(--t-micro);
  background: var(--surface-alt); border: 1px solid var(--rule-mid);
  border-radius: var(--r-sm); padding: 2px 6px; color: var(--ink-faint); flex-shrink: 0;
}
.cmd-results { flex: 1; overflow-y: auto; padding: var(--sp-2) 0; }
.cmd-group { padding-bottom: var(--sp-2); }
.cmd-group-label {
  font-family: var(--font-mono); font-size: var(--t-micro);
  text-transform: uppercase; letter-spacing: var(--ls-caps);
  color: var(--ink-faint); padding: var(--sp-3) var(--sp-5) var(--sp-1);
}
.cmd-result {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-5); text-decoration: none; color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.cmd-result:hover,
.cmd-result.is-active { background: var(--surface-alt); color: var(--ink); }
.cmd-result.is-active { background: rgba(255,80,0,0.06); }
.cmd-result-icon {
  width: 32px; height: 32px; border-radius: var(--r-md);
  background: var(--surface-alt); border: 1px solid var(--rule-faint);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
}
.cmd-result.is-active .cmd-result-icon { background: var(--orange-tint); border-color: var(--orange-tint-md); }
.cmd-result-body { flex: 1; min-width: 0; }
.cmd-result-title {
  display: block; font-size: var(--t-small); font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmd-result-context {
  display: block; font-family: var(--font-mono); font-size: var(--t-micro);
  color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.cmd-enter-hint {
  font-family: var(--font-mono); font-size: var(--t-micro);
  background: var(--surface-alt); border: 1px solid var(--rule-mid);
  border-radius: var(--r-sm); padding: 2px 5px; color: var(--ink-ghost);
  flex-shrink: 0; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out);
}
.cmd-result.is-active .cmd-enter-hint { opacity: 1; }
.cmd-empty {
  padding: var(--sp-12) var(--sp-8); text-align: center;
  font-size: var(--t-small); color: var(--ink-faint);
}
.cmd-footer {
  display: flex; align-items: center; gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--rule-faint);
  flex-shrink: 0; background: var(--surface-alt);
}
.cmd-hint {
  font-family: var(--font-mono); font-size: var(--t-micro);
  color: var(--ink-faint); display: flex; align-items: center; gap: 5px;
}
.cmd-hint kbd {
  font-family: var(--font-mono); font-size: 10px;
  background: var(--surface); border: 1px solid var(--rule-mid);
  border-radius: 3px; padding: 1px 4px; color: var(--ink-soft);
}

/* ═══════════════════════════════════════════════
   19. NOTIFICATIONS PANEL
═══════════════════════════════════════════════ */
.notif-wrapper { position: relative; }

.bell-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; border-radius: var(--r-full);
  background: var(--orange); color: #fff;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid var(--bg); line-height: 1;
}
.bell-badge[data-count="0"],
.bell-badge:empty { display: none; }

.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: min(380px, 94vw);
  background: var(--surface); border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown); overflow: hidden; display: none;
  flex-direction: column;
}
.notif-panel.is-open {
  display: flex;
  animation: dropdown-enter 160ms var(--ease-out) both;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--rule-faint); flex-shrink: 0;
}
.notif-panel-title { font-weight: 600; font-size: var(--t-small); letter-spacing: var(--ls-tight); }
.notif-mark-all {
  font-family: var(--font-mono); font-size: var(--t-micro); color: var(--orange);
  text-transform: uppercase; letter-spacing: var(--ls-caps); cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.notif-mark-all:hover { opacity: 0.7; }

.notif-list { overflow-y: auto; max-height: 420px; }
.notif-item {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--rule-faint);
  cursor: pointer; transition: background var(--dur-fast) var(--ease-out);
  text-decoration: none; color: inherit;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-alt); }
.notif-item.is-unread { background: rgba(255,80,0,0.025); }
.notif-type-icon {
  width: 34px; height: 34px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.notif-type-icon--call        { background: var(--info-tint);     border: 1px solid var(--info-border); }
.notif-type-icon--order       { background: var(--success-tint);  border: 1px solid var(--success-border); }
.notif-type-icon--allergy     { background: var(--danger-tint);   border: 1px solid var(--danger-border); }
.notif-type-icon--system      { background: var(--warning-tint);  border: 1px solid var(--warning-border); }
.notif-type-icon--subscription{ background: var(--orange-tint);   border: 1px solid var(--orange-tint-md); }
.notif-type-icon--performance { background: var(--neutral-tint);  border: 1px solid var(--neutral-border); }
.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: var(--t-small); color: var(--ink-soft); line-height: 1.4; margin-bottom: 2px;
}
.notif-item.is-unread .notif-title { color: var(--ink); font-weight: 500; }
.notif-time { font-family: var(--font-mono); font-size: var(--t-micro); color: var(--ink-faint); }
.notif-unread-dot {
  width: 6px; height: 6px; border-radius: var(--r-full);
  background: var(--orange); flex-shrink: 0; margin-top: 5px;
  transition: opacity var(--dur-base) var(--ease-out);
}
.notif-item:not(.is-unread) .notif-unread-dot { opacity: 0; pointer-events: none; }
.notif-panel-footer {
  padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--rule-faint);
  text-align: center; flex-shrink: 0;
}
.notif-panel-footer a {
  font-family: var(--font-mono); font-size: var(--t-micro);
  text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--orange);
}
.notif-panel-footer a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   20. ENHANCED USER DROPDOWN
═══════════════════════════════════════════════ */
.user-dd-menu {
  background: var(--surface); border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown); overflow: hidden;
  display: none; min-width: 224px;
}
.user-dd-menu.is-open {
  display: block;
  animation: dropdown-enter 160ms var(--ease-out) both;
}
.user-dd-profile {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4); border-bottom: 1px solid var(--rule-faint);
}
.user-dd-avatar {
  width: 36px; height: 36px; border-radius: var(--r-full);
  background: var(--orange); color: #fff;
  font-family: var(--font-mono); font-size: var(--t-micro); font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-dd-info { min-width: 0; }
.user-dd-name {
  font-size: var(--t-small); font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-dd-email {
  font-family: var(--font-mono); font-size: var(--t-micro); color: var(--ink-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-dd-section { padding: var(--sp-1) 0; border-bottom: 1px solid var(--rule-faint); }
.user-dd-section:last-child { border-bottom: none; }
.user-dd-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); font-size: var(--t-small);
  color: var(--ink-soft); text-decoration: none; cursor: pointer;
  width: 100%; text-align: left;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.user-dd-item:hover { background: var(--surface-alt); color: var(--ink); }
.user-dd-item svg {
  width: 14px; height: 14px; stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; opacity: 0.55;
}
.user-dd-item-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.user-dd-item-right .theme-lbl {
  font-family: var(--font-mono); font-size: var(--t-micro); color: var(--ink-faint);
}
.user-dd-item-right svg { width: 12px; height: 12px; opacity: 0.45; }
/* SA-only items in user dropdown */
.user-dd-item.sa-only { display: none; }
body.is-superadmin .user-dd-item.sa-only { display: flex; }

/* Danger (logout) */
.user-dd-item--danger { color: var(--danger); }
.user-dd-item--danger:hover { background: var(--danger-tint); color: var(--danger); }
.user-dd-item--danger svg { opacity: 0.7; }

/* Theme sub-panel (accordion inside dropdown).
   LOCK-002 canonical (2026-05-13): horizontal pill-radio-group pattern
   spejlet fra restaurant mockup. 3 pill-buttons med solid-ink active state. */
.theme-sub {
  display: none; flex-direction: row;
  padding: var(--sp-2) var(--sp-4); gap: var(--sp-2);
  background: var(--surface-alt);
  border-top: 1px solid var(--rule-faint);
  border-bottom: 1px solid var(--rule-faint);
}
.theme-sub.is-open { display: flex; }
.theme-opt {
  flex: 1; padding: 5px var(--sp-2);
  font-family: var(--font-mono); font-size: var(--t-micro);
  text-transform: uppercase; letter-spacing: var(--ls-caps); font-weight: 600;
  border: var(--rule-w) solid var(--rule-mid);
  border-radius: var(--r-sm);
  color: var(--ink-soft); background: var(--surface);
  cursor: pointer; text-align: center;
  transition: all var(--dur-fast) var(--ease-out);
}
.theme-opt:hover { border-color: var(--ink); color: var(--ink); }
.theme-opt.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.theme-sub-chevron { transition: transform var(--dur-fast) var(--ease-out); }
.user-dd-item.theme-open .theme-sub-chevron { transform: rotate(180deg); }

/* ═══════════════════════════════════════════════
   21. UNLOCK MODAL (Facebook Chatbot premium)
═══════════════════════════════════════════════ */
.unlock-overlay {
  position: fixed; inset: 0;
  background: oklch(8% 0.005 90 / 0.60);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4); z-index: var(--z-modal);
  animation: fade-in var(--dur-base) var(--ease-out) both;
}
.unlock-overlay[hidden] { display: none; }
.unlock-modal {
  background: var(--surface); border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-xl); box-shadow: var(--shadow-xl);
  width: 100%; max-width: 540px;
  animation: modal-enter var(--dur-modal) var(--ease-spring) both;
}
.unlock-eyebrow {
  font-family: var(--font-mono); font-size: var(--t-micro);
  text-transform: uppercase; letter-spacing: var(--ls-caps);
  color: var(--orange); margin-bottom: var(--sp-1);
}
.unlock-desc {
  font-size: var(--t-small); color: var(--ink-soft);
  margin-top: var(--sp-3); line-height: var(--lh-loose);
}
.plan-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sp-4); margin-top: var(--sp-5);
}
.plan-card {
  border: var(--rule-w) solid var(--rule-mid);
  border-radius: var(--r-lg); padding: var(--sp-5); position: relative;
}
.plan-card--featured { border-color: var(--orange); background: var(--orange-tint); }
.plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--orange); color: #fff;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 8px; border-radius: var(--r-full);
}
.plan-name {
  font-family: var(--font-mono); font-size: var(--t-micro);
  text-transform: uppercase; letter-spacing: var(--ls-caps);
  color: var(--ink-faint); margin-bottom: var(--sp-2);
}
.plan-price {
  font-family: var(--font-mono); font-size: 1.375rem; font-weight: 700;
  color: var(--ink); letter-spacing: -0.03em; margin-bottom: var(--sp-3);
}
.plan-price span { font-size: var(--t-small); font-weight: 400; color: var(--ink-faint); }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.plan-features li {
  font-size: var(--t-small); color: var(--ink-soft);
  display: flex; align-items: center; gap: var(--sp-2);
}
.plan-features li::before { content: "✓"; color: var(--success); font-weight: 700; font-size: 11px; }

/* ═══════════════════════════════════════════════
   22. MOBILE TOUCH TARGETS + RESPONSIVE
═══════════════════════════════════════════════ */

/* Touch targets ≥ 44×44px (WCAG 2.5.5) */
@media (max-width: 900px) {
  .nav-item { min-height: 44px; }
  .sidebar-logout { min-height: 44px; }
  .sidebar-user { min-height: 44px; }
  .tenant-switcher { min-height: 44px; }
  .topbar-bell { width: 44px; height: 44px; }
  .user-pill { min-height: 44px; }
  .btn:not(.btn--sm):not(.btn--icon-only) { min-height: 44px; }
}

/* Topbar: shrink search on tablet */
@media (max-width: 1024px) {
  .topbar-search { width: clamp(100px, 14vw, 200px); }
}

/* Topbar: hide search text on mobile (Cmd+K still works) */
@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap; height: auto;
    padding: var(--sp-3) var(--sp-4); gap: var(--sp-2);
  }
  .topbar-title-group { flex: 1; order: 1; }
  .topbar-actions     { order: 2; }
  .topbar-search      { order: 3; width: 100%; max-width: none; }
  /* On very small screens, hide user name, keep avatar */
  @media (max-width: 480px) {
    .user-pill > span:not(.user-avatar) { display: none; }
    .user-pill { padding: 4px; border-radius: var(--r-full); }
    .ai-toggle .ai-label { display: none; }
    .ai-toggle { padding: 6px 8px; }
  }
  /* Notif panel full-width on mobile */
  .notif-panel {
    position: fixed; top: auto;
    left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3);
    width: auto; max-height: 80vh;
  }
  /* Plan grid stacks */
  .plan-grid { grid-template-columns: 1fr; }
  /* Cmd palette nearly full-screen */
  .cmd-overlay { padding-top: 4vh; align-items: flex-start; }
  .cmd-palette { max-height: 88vh; }
}

/* Prevent scroll when modal open */
body.modal-open { overflow: hidden; }

/* ═══════════════════════════════════════════════
   23. EXTRA KEYFRAMES (shared)
═══════════════════════════════════════════════ */
@keyframes dropdown-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Mockup-only dev-comments · hidden i prod === */
/* Customer-pages indeholder <div class="mockup-note"> dev-internal commentary
   til design-iteration. Skjul globalt så customer ikke ser dem. */
/* Re-enable lokalt via inline `<style>` hvis nødvendigt for mockup-review. */
.mockup-note { display: none; }

/* ═════ mockup-stubs · universal toast for stub-buttons ═════ */
.mockup-stub-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2a1810;
  color: #fef9f3;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font: 14px/1.4 'DM Sans', system-ui, sans-serif;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: min(400px, calc(100vw - 40px));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 9999;
  pointer-events: none;
}
.mockup-stub-toast--show {
  opacity: 1;
  transform: translateY(0);
}
.mockup-stub-toast__icon {
  font-size: 16px;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .mockup-stub-toast {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}
