:root {
  /* DARK THEME - Matching Landing Page */
  --carrot-bg-black: #000000; /* Pure black background */
  --carrot-bg-start: #000000;
  --carrot-bg-end: #000000;

  /* Glass surfaces - dark theme */
  --carrot-surface: rgba(255, 255, 255, 0.05); /* Glass effect */
  --carrot-surface-strong: rgba(255, 255, 255, 0.08); /* Stronger glass */
  --carrot-surface-muted: rgba(255, 255, 255, 0.03); /* Subtle glass */

  /* Borders - light for dark theme */
  --carrot-border: rgba(255, 255, 255, 0.1);
  --carrot-border-strong: rgba(255, 255, 255, 0.15);

  /* Shadows - darker */
  --carrot-shadow-soft: 0 20px 55px rgba(0, 0, 0, 0.5);
  --carrot-shadow-card: 0 28px 65px rgba(0, 0, 0, 0.4);

  /* Text colors - light for dark background */
  --carrot-text-primary: rgba(255, 255, 255, 1); /* White */
  --carrot-text-secondary: rgba(255, 255, 255, 0.8); /* Light gray */
  --carrot-text-muted: rgba(255, 255, 255, 0.6); /* Muted gray */
  --carrot-heading: rgba(255, 255, 255, 1); /* White headings */

  /* Accent colors - from landing page */
  --carrot-accent: #ff6b35; /* Landing page carrot color */
  --carrot-accent-strong: #ff8c5f; /* carrot-light */
  --carrot-accent-soft: rgba(255, 107, 53, 0.2);
  --carrot-accent-dark: #e54d1c; /* carrot-dark */

  /* Status colors */
  --carrot-success: #56c584;
  --carrot-warning: #f5b75c;
  --carrot-danger: #ff7a7a;

  /* Spacing & sizing */
  --carrot-radius-lg: 28px;
  --carrot-radius-md: 18px;
  --carrot-radius-sm: 12px;
  --carrot-radius-xs: 8px;
  --carrot-spacing-1: 4px;
  --carrot-spacing-2: 8px;
  --carrot-spacing-3: 12px;
  --carrot-spacing-4: 16px;
  --carrot-spacing-5: 20px;
  --carrot-spacing-6: 24px;
  --carrot-spacing-7: 32px;
  --carrot-spacing-8: 40px;

  /* Fonts */
  --carrot-font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  --carrot-font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Roboto Mono", "Source Code Pro", monospace;

  --carrot-shell-max: 1600px;
  --carrot-shell-padding: clamp(20px, 5vw, 72px);

  /* ===========================
     Filter System Tokens (Spec §5–7)
     =========================== */
  /* surfaces */
  --filter-bg: rgba(25, 25, 30, 0.97);
  --filter-bg-hover: color-mix(in oklab, var(--filter-bg), white 6%);
  --filter-bg-active: rgba(255, 107, 53, 0.15);

  /* text */
  --filter-text: var(--carrot-text-primary, rgba(255, 255, 255, 1));
  --filter-text-muted: var(--carrot-text-muted, rgba(255, 255, 255, 0.6));
  --filter-text-active: var(--carrot-accent-strong, #ff8c5f);

  /* borders & focus */
  --filter-border: var(--carrot-border, rgba(255, 255, 255, 0.1));
  --filter-border-active: var(--carrot-accent, #ff6b35);
  --filter-border-focus: var(--carrot-accent-strong, #ff8c5f);
  --filter-ring-width: 2px;
  --filter-ring-offset: 2px;

  /* geometry & spacing */
  --chip-radius: 9999px;
  --chip-gap: var(--carrot-spacing-2, 0.5rem);
  --group-gap: var(--carrot-spacing-2, 0.5rem);
  --bar-gap-x: var(--carrot-spacing-3, 0.75rem);
  --bar-gap-y: var(--carrot-spacing-2, 0.5rem);

  /* sizes */
  --ctl-h-sm: 28px;
  --ctl-h-md: 36px;
  --ctl-h-lg: 44px;

  --chip-px-sm: 10px; --chip-px-md: 12px; --chip-px-lg: 14px;
  --chip-py-sm: 4px;  --chip-py-md: 6px;  --chip-py-lg: 8px;

  --font-sm: 0.875rem;
  --font-md: 0.95rem;
  --font-lg: 1rem;

  /* badge */
  --badge-bg: var(--carrot-accent, #ff6b35);
  --badge-text: rgba(255, 255, 255, 1);

  /* motion */
  --motion-fast: 120ms;
  --motion-med: 180ms;

  color-scheme: dark;
}

/* LIGHT MODE THEME */
html.light-mode {
  /* Light backgrounds */
  --carrot-bg-black: #ffffff; /* White background */
  --carrot-bg-start: #fef8f3; /* Cream/warm white */
  --carrot-bg-end: #ffffff;

  /* Glass surfaces - light theme */
  --carrot-surface: rgba(0, 0, 0, 0.02); /* Subtle glass */
  --carrot-surface-strong: rgba(0, 0, 0, 0.04); /* Stronger glass */
  --carrot-surface-muted: rgba(0, 0, 0, 0.01);

  /* Borders - dark for light theme */
  --carrot-border: rgba(0, 0, 0, 0.1);
  --carrot-border-strong: rgba(0, 0, 0, 0.15);

  /* Shadows - softer for light theme */
  --carrot-shadow-soft: 0 10px 35px rgba(0, 0, 0, 0.08);
  --carrot-shadow-card: 0 15px 45px rgba(0, 0, 0, 0.12);

  /* Text colors - dark for light background */
  --carrot-text-primary: rgba(0, 0, 0, 0.9); /* Near black */
  --carrot-text-secondary: rgba(0, 0, 0, 0.7); /* Dark gray */
  --carrot-text-muted: rgba(0, 0, 0, 0.5); /* Muted gray */
  --carrot-heading: rgba(0, 0, 0, 0.95); /* Dark headings */

  /* Filter System Light Mode Overrides */
  --filter-bg: rgba(255, 255, 255, 1);
  --filter-bg-hover: color-mix(in oklab, var(--filter-bg), black 3%);
  --filter-bg-active: rgba(255, 107, 53, 0.1);

  --filter-text: rgba(0, 0, 0, 0.9);
  --filter-text-muted: rgba(0, 0, 0, 0.5);
  --filter-text-active: rgba(255, 77, 35, 1);

  --filter-border: rgba(0, 0, 0, 0.1);
  --filter-border-active: var(--carrot-accent, #ff6b35);
  --filter-border-focus: var(--carrot-accent-dark, #e54d1c);

  color-scheme: light;
}

/* Light mode body background */
html.light-mode body {
  background: linear-gradient(135deg, #fef8f3 0%, #ffffff 100%);
}

/* Light mode animated blobs */
html.light-mode body::before {
  background-image:
    radial-gradient(circle 384px at 25% 25%, rgba(255, 107, 53, 0.05), transparent 70%),
    radial-gradient(circle 384px at 75% 75%, rgba(139, 92, 246, 0.05), transparent 70%),
    radial-gradient(circle 512px at 50% 50%, rgba(57, 192, 201, 0.03), transparent 70%),
    radial-gradient(circle 256px at 10% 90%, rgba(0, 153, 255, 0.05), transparent 70%);
}

/* Light mode glass effects */
html.light-mode .glass,
html.light-mode .admin-toolbar {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Light mode toolbar links */
html.light-mode .admin-toolbar__link {
  color: rgba(0, 0, 0, 0.6);
}

html.light-mode .admin-toolbar__link:hover {
  color: rgba(0, 0, 0, 0.9);
}

html.light-mode .admin-toolbar__link.is-active {
  color: var(--carrot-accent);
}

/* Light mode icons */
html.light-mode .admin-toolbar__icon {
  color: rgba(0, 0, 0, 0.7);
}

html.light-mode .admin-toolbar__icon:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Light mode dropdown */
html.light-mode #lang-dropdown-admin {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

html.light-mode #lang-dropdown-admin button {
  color: rgba(0, 0, 0, 0.8);
}

html.light-mode #lang-dropdown-admin button:hover {
  background: rgba(255, 107, 53, 0.1);
  color: rgba(0, 0, 0, 0.95);
}

/* Light mode mobile drawer */
html.light-mode .admin-toolbar__nav-mobile {
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}

html.light-mode .admin-toolbar__drawer-close {
  color: rgba(0, 0, 0, 0.6);
}

/* Light mode cards and sections */
html.light-mode .admin-card,
html.light-mode .admin-section {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

html.light-mode .admin-card:hover,
html.light-mode .admin-section:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Light mode tables */
html.light-mode .admin-table {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

html.light-mode .admin-table thead th {
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.6);
}

html.light-mode .admin-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.01);
}

html.light-mode .admin-table tbody tr:hover {
  background: rgba(255, 107, 53, 0.1);
}

html.light-mode .admin-table tbody td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.8);
}

/* Light mode buttons */
html.light-mode .btn {
  background: var(--carrot-accent);
  color: white;
}

html.light-mode .btn:hover {
  background: var(--carrot-accent-strong);
}

html.light-mode .btn-secondary {
  background: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.9);
  border-color: rgba(0, 0, 0, 0.2);
}

html.light-mode .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.15);
}

html.light-mode .btn-outline {
  background: rgba(0, 0, 0, 0.02);
  color: rgba(0, 0, 0, 0.9);
  border-color: rgba(0, 0, 0, 0.2);
}

html.light-mode .btn-outline:hover {
  background: rgba(0, 0, 0, 0.05);
}

html.light-mode .btn-link {
  color: var(--carrot-accent);
}

/* Light mode callouts */
html.light-mode .callout {
  background: rgba(255, 255, 255, 0.75);
  color: var(--carrot-text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

html.light-mode .callout--warning {
  background: rgba(255, 245, 230, 0.9);
  color: rgba(0, 0, 0, 0.9);
}

html.light-mode .callout--info {
  background: rgba(234, 237, 255, 0.72);
  color: rgba(0, 0, 0, 0.9);
}

html.light-mode .callout--danger {
  background: rgba(255, 226, 226, 0.82);
  color: rgba(0, 0, 0, 0.9);
}

/* Light mode forms */
html.light-mode .admin-form input,
html.light-mode .admin-form select,
html.light-mode .admin-form textarea {
  background: rgba(255, 255, 255, 0.82);
  color: rgba(0, 0, 0, 0.9);
}

html.light-mode .admin-form select {
  color-scheme: light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(0,0,0,0.5)' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: right 12px center;
  background-size: 12px 12px;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

html.light-mode .admin-form select option {
  background: white;
  color: rgba(0, 0, 0, 0.9);
  text-decoration: none;
  border: none;
  outline: none;
}

html.light-mode .admin-form select:invalid,
html.light-mode .admin-form select[value=""],
html.light-mode .admin-form select option[value=""] {
  color: rgba(0, 0, 0, 0.5);
  text-decoration: none;
}

html.light-mode .admin-form select:focus option,
html.light-mode .admin-form select:hover option,
html.light-mode .admin-form select option:hover,
html.light-mode .admin-form select option:focus,
html.light-mode .admin-form select option:checked {
  text-decoration: none;
  outline: none;
  border: none;
}

html.light-mode .admin-form input:focus,
html.light-mode .admin-form select:focus,
html.light-mode .admin-form textarea:focus {
  border-color: rgba(10, 22, 40, 0.32);
}

/* Light mode modal */
html.light-mode .modal__dialog {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 246, 230, 0.98) 100%);
  border: 1px solid rgba(10, 22, 40, 0.12);
  box-shadow: 0 40px 80px rgba(16, 20, 36, 0.28);
}

html.light-mode .modal__close {
  background: rgba(255, 255, 255, 0.8);
  color: var(--carrot-text-strong);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.14);
}

html.light-mode .modal__close:hover {
  color: var(--carrot-accent-dark);
}

/* Light mode dropdowns */
html.light-mode .admin-toolbar__dropdown-menu {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(31, 36, 56, 0.12);
  box-shadow: 0 18px 42px rgba(16, 20, 36, 0.18);
}

html.light-mode .admin-toolbar__dropdown-item {
  background: rgba(255, 255, 255, 0.65);
  color: var(--carrot-text-secondary);
}

html.light-mode .admin-toolbar__dropdown-item:hover {
  background: rgba(248, 145, 32, 0.15);
  color: var(--carrot-accent-dark);
}

/* Light mode badges, pills, and empty state */
html.light-mode .admin-empty-state {
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(10, 22, 40, 0.14);
}

html.light-mode .badge {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(31, 36, 56, 0.1);
  color: var(--carrot-text-secondary);
}

html.light-mode .pill {
  background: rgba(31, 36, 56, 0.08);
}

html.light-mode .pill--success {
  color: #108046;
}

html.light-mode .pill--warning {
  color: #8a4c05;
}

html.light-mode .pill--danger {
  color: #97243c;
}

html.light-mode .status-dot {
  background: rgba(31, 36, 56, 0.2);
}

html.light-mode .divider {
  background: rgba(31, 36, 56, 0.08);
}

/* Light mode - Bulk mapping components */
html.light-mode .bulk-mapping__table thead th {
  background: rgba(255, 255, 255, 0.9);
}

html.light-mode .bulk-mapping__select {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 36, 56, 0.18);
  color: var(--carrot-text-strong);
}

html.light-mode .bulk-summary__stats > div {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(31, 36, 56, 0.1);
}

html.light-mode .bulk-summary__issues,
html.light-mode .bulk-summary__duplicates {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 36, 56, 0.12);
}

/* Light mode - Auth pages */
html.light-mode .auth-hero {
  background: linear-gradient(135deg, rgba(255, 246, 220, 0.88) 0%, rgba(255, 220, 150, 0.62) 100%);
}

html.light-mode .auth-hero__panel {
  background: rgba(255, 255, 255, 0.9);
}

html.light-mode .auth-hero__card {
  background: rgba(255, 255, 255, 0.92);
  border: none;
  box-shadow: 0 18px 48px rgba(248, 145, 32, 0.15);
}

html.light-mode .qr {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 36, 56, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 28px rgba(248, 145, 32, 0.15);
}

/* Light mode - Table borders and containers */
html.light-mode .table-scroll {
  border: none;
  background: transparent;
  box-shadow: none;
}

html.light-mode .bulk-mapping__table {
  border: 1px solid rgba(31, 36, 56, 0.12);
}

html.light-mode .bulk-mapping__table th,
html.light-mode .bulk-mapping__table td {
  border-bottom: 1px solid rgba(31, 36, 56, 0.08);
}

html.light-mode .stat-card {
  border: 1px solid rgba(31, 36, 56, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

html.light-mode .admin-table tbody tr {
  border: 1px solid rgba(31, 36, 56, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

html.light-mode .back-section {
  border: 1px solid rgba(31, 36, 56, 0.12);
  background: rgba(255, 255, 255, 0.88);
}

html.light-mode .back-section__remove {
  background: rgba(10, 22, 40, 0.08);
  color: var(--carrot-accent-dark);
}

html.light-mode .back-section__remove:hover,
html.light-mode .back-section__remove:focus-visible {
  background: rgba(10, 22, 40, 0.16);
}

html.light-mode .home-tile {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(31, 36, 56, 0.08);
  box-shadow: 0 18px 38px rgba(182, 153, 102, 0.22);
}

html.light-mode .home-placeholder-badge {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(31, 36, 56, 0.12);
}

html.light-mode .admin-stat {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(31, 36, 56, 0.08);
}

html.light-mode .admin-action-card {
  background: white;
  border: 1px solid rgba(31, 36, 56, 0.12);
}

html.light-mode .admin-action-card:hover {
  border-color: var(--carrot-accent);
  box-shadow: 0 4px 12px rgba(248, 145, 32, 0.15);
}

html.light-mode .input-readonly {
  background: #f5f5f5 !important;
}

html.light-mode .validation-panel {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

html.light-mode .validation-results {
  background: white;
  border: 1px solid #dee2e6;
}

html.light-mode .validation-summary {
  border-bottom: 1px solid #dee2e6;
}

html.light-mode .validation-badge--success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

html.light-mode .validation-badge--warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

html.light-mode .validation-badge--error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

html.light-mode .validation-issue {
  background: transparent;
}

html.light-mode .validation-issue--error {
  background: #fff5f5;
}

html.light-mode .validation-issue--warning {
  background: #fffdf5;
}

html.light-mode .validation-issue--info {
  background: #f5f9ff;
}

html.light-mode .validation-issue__field {
  background: #f8f9fa;
}

html.light-mode .validation-success {
  background: #d4edda;
  color: #155724;
}

html.light-mode .permission-item label {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

html.light-mode .permission-item label:hover {
  background: #e9ecef;
}

html.light-mode select {
  background-color: rgba(255, 255, 255, 0.8);
  color: rgba(0, 0, 0, 0.9);
  color-scheme: light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23000000' d='M1.41 0L6 4.58L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: right 14px center;
  background-size: 12px 8px;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

html.light-mode select option {
  background: white !important;
  background-image: none !important;
  color: rgba(0, 0, 0, 0.9);
  text-decoration: none;
  border: none;
  outline: none;
}

html.light-mode select:invalid,
html.light-mode select[value=""],
html.light-mode select option[value=""] {
  color: rgba(0, 0, 0, 0.5);
  text-decoration: none;
}

html.light-mode select:focus option,
html.light-mode select:hover option,
html.light-mode select option:hover,
html.light-mode select option:focus,
html.light-mode select option:checked {
  text-decoration: none;
  outline: none;
  border: none;
}

html.light-mode .lang-dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

html.light-mode .lang-dropdown-item {
  color: rgba(0, 0, 0, 0.8);
}

html.light-mode .lang-dropdown-item:hover {
  background: rgba(248, 145, 32, 0.15);
  color: rgba(0, 0, 0, 0.95);
}

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

body {
  /* Dark theme matching landing page */
  background: #000000; /* Pure black */
  color: var(--carrot-text-primary);
  font-family: var(--carrot-font-family);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
  padding: var(--carrot-shell-padding);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Animated Background Gradient Blobs - from landing page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle 384px at 25% 25%, rgba(255, 107, 53, 0.1), transparent 70%),
    radial-gradient(circle 384px at 75% 75%, rgba(139, 92, 246, 0.1), transparent 70%),
    radial-gradient(circle 512px at 50% 50%, rgba(57, 192, 201, 0.05), transparent 70%),
    radial-gradient(circle 256px at 10% 90%, rgba(0, 153, 255, 0.1), transparent 70%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

a {
  color: var(--carrot-accent); /* Orange links */
  text-decoration: none;
}

a:hover {
  color: var(--carrot-accent-strong);
}

code,
pre {
  font-family: var(--carrot-font-mono);
  background: rgba(255, 255, 255, 0.1); /* Dark theme code background */
  color: var(--carrot-text-primary); /* White text */
  border-radius: var(--carrot-radius-xs);
  padding: 3px 8px;
}

/* Style ALL select dropdowns to match dark theme */
select {
  background-color: rgba(255, 255, 255, 0.05); /* Glass */
  border: 1px solid var(--carrot-border);
  border-radius: var(--carrot-radius-sm);
  color: var(--carrot-text-primary); /* White text */
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--carrot-font-family);
  transition: border 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;

  /* Remove ALL default browser styling */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Custom dropdown arrow - white for dark theme */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M1.41 0L6 4.58L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 40px;

  /* Tell browser to use dark color scheme for native dropdown */
  color-scheme: dark;

  /* Remove any text decoration that could cause lines */
  text-decoration: none;
  outline: none;
}

/* Remove focus ring that might look like lines */
select::-moz-focus-inner {
  border: 0;
  padding: 0;
}

/* Remove default arrow on IE */
select::-ms-expand {
  display: none;
}

select option {
  background: rgba(10, 22, 40, 0.95) !important;
  background-image: none !important;
  color: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  text-decoration: none;
  border: none;
  outline: none;
}

/* Fix for empty/placeholder selects */
select:invalid,
select[value=""],
select option[value=""] {
  color: var(--carrot-text-muted);
  text-decoration: none;
}

select option[value=""]:first-child {
  color: var(--carrot-text-muted);
  text-decoration: none;
}

/* Ensure NO underlines or decorations on any select state */
select:focus option,
select:hover option,
select option:hover,
select option:focus,
select option:checked {
  text-decoration: none;
  outline: none;
  border: none;
}

select:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

select:focus {
  outline: none;
  border-color: var(--carrot-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.25);
}

select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.03);
}

/* Style inputs and textareas for dark theme */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
textarea {
  background: rgba(255, 255, 255, 0.05); /* Glass */
  border: 1px solid var(--carrot-border);
  border-radius: var(--carrot-radius-sm);
  color: var(--carrot-text-primary); /* White text */
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--carrot-font-family);
  transition: border 0.15s ease, box-shadow 0.15s ease;
  resize: none; /* Disable manual resizing (fields have character limits) */
}

input::placeholder,
textarea::placeholder {
  color: var(--carrot-text-muted); /* rgba(255, 255, 255, 0.6) */
}

input:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--carrot-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

input:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.03);
}

.admin-shell {
  margin: 0 auto;
  width: 100%;
  max-width: min(var(--carrot-shell-max), 100%);
  display: grid;
  gap: clamp(var(--carrot-spacing-6), 4vw, var(--carrot-spacing-8));
  position: relative;
  z-index: 1; /* Above animated background */
}

/* admin-shell::before removed - using body::before for animated background instead */

/* Glass morphism effect - from landing page */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fade-in animation for toolbar */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-toolbar {
  /* Glass morphism effect - modern look from landing page */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* NO border-radius - matching landing page sharp edges */
  /* NO box-shadow - matching landing page clean look */

  /* Fixed positioning - stays at top */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  /* No entrance animation - prevents bounce when navigating between pages */
  /* animation: fadeInDown 0.6s ease-out; -- REMOVED */

  overflow: visible; /* Ensure dropdown menu is visible */
}

/* Container for centering content - matching landing page max-w-7xl */
.admin-toolbar__container {
  max-width: 1280px; /* max-w-7xl = 80rem = 1280px */
  margin: 0 auto;
  padding: clamp(12px, 2vw, 16px) clamp(24px, 4vw, 40px);
  width: 100%;
}

/* Inner flex layout - matching landing page justify-between */
.admin-toolbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(var(--carrot-spacing-4), 3vw, var(--carrot-spacing-6));
}

.admin-toolbar__brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.admin-toolbar__brand-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  object-position: left center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Desktop navigation - shown inline */
.admin-toolbar__nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(var(--carrot-spacing-1), 0.8vw, var(--carrot-spacing-2));
  flex: 1 1 auto;
  justify-content: flex-end; /* Align menu items to the right */
  margin-right: clamp(var(--carrot-spacing-4), 3vw, var(--carrot-spacing-6)); /* Add space before actions */
  overflow: visible;
}

/* Mobile drawer navigation - hidden by default */
.admin-toolbar__nav-mobile {
  display: none;
}

/* Close button - hidden on desktop, shown on mobile drawer */
.admin-toolbar__nav-close {
  display: none !important; /* v2: Hidden on desktop */
}

.admin-toolbar__link {
  /* Landing page style - minimal, clean */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--carrot-spacing-2);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.6); /* text-gray-400 */
  transition: color 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.admin-toolbar__link:hover,
.admin-toolbar__link:focus-visible {
  color: rgba(255, 255, 255, 1); /* text-white */
  outline: none;
}

.admin-toolbar__link.is-active {
  color: var(--carrot-accent); /* Orange highlight for active */
  font-weight: 600;
}

/* Special admin role links - visible in both light and dark modes */
.admin-toolbar__link--super,
.admin-toolbar__link--org {
  color: var(--carrot-accent); /* Use Carrot orange for visibility */
  font-weight: 600;
}

.admin-toolbar__link--super:hover,
.admin-toolbar__link--org:hover {
  color: rgba(255, 255, 255, 1);
}

.admin-toolbar__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 2px 6px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--carrot-text-strong);
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
}

.admin-toolbar__link:hover .admin-toolbar__count {
  background: rgba(0, 0, 0, 0.12);
}

.admin-toolbar__link.is-active .admin-toolbar__count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.admin-results-count {
  margin: var(--carrot-spacing-4) 0;
  font-size: 14px;
  color: var(--carrot-text);
  text-align: right;
}

.admin-results-count strong {
  font-weight: 600;
  color: var(--carrot-text-strong);
}

/* Filter toolbar row - align filters and results on same line */
.admin-filter-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--carrot-spacing-3);
  margin-bottom: var(--carrot-spacing-4);
}

.admin-filter-row .admin-results-count {
  margin: 0;
  margin-left: auto;
}

/* Bulk actions in filter row */
.admin-bulk-actions {
  display: flex;
  gap: var(--carrot-spacing-2);
  align-items: center;
}

.admin-bulk-actions .btn {
  padding: 0 12px;
  font-size: 15px;
  border-radius: 8px;
  height: 36px;
}

/* On mobile, stack vertically */
@media (max-width: 576px) {
  .admin-filter-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.admin-toolbar__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  flex: 0 0 auto;
}

.admin-toolbar__menu-toggle {
  display: none !important; /* Hidden by default on desktop - !important to override .admin-toolbar__icon */
}

/* Explicitly hide hamburger on desktop (above 768px) */
@media (min-width: 769px) {
  .admin-toolbar__menu-toggle {
    display: none !important;
  }

  /* Show desktop navigation */
  .admin-toolbar__nav {
    display: flex !important;
  }
}

.admin-toolbar__icon {
  /* Landing page style - minimal, clean */
  padding: 8px;
  border-radius: 9999px; /* rounded-full */
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  border: none;
}

.admin-toolbar__icon:hover {
  background: rgba(255, 255, 255, 0.1); /* hover:bg-white/10 */
  color: rgba(255, 255, 255, 1);
}

.admin-toolbar__icon:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.1);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 60px);
  z-index: 120;
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
}

.modal__dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - clamp(48px, 8vw, 120px));
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.05); /* Dark mode: subtle glass effect */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--carrot-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.modal__header,
.modal__footer {
  padding: var(--carrot-spacing-5) clamp(var(--carrot-spacing-5), 4vw, var(--carrot-spacing-7));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--carrot-spacing-3);
}

.modal__body {
  padding: 0 clamp(var(--carrot-spacing-5), 4vw, var(--carrot-spacing-7)) var(--carrot-spacing-5);
  display: grid;
  gap: var(--carrot-spacing-4);
}

.modal__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 600;
  color: var(--carrot-heading);
}

.modal__close {
  border: none;
  background: rgba(255, 255, 255, 0.1); /* Dark mode: subtle glass */
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--carrot-text);
  box-shadow: none;
}

.modal__close:hover,
.modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: var(--carrot-accent);
  outline: none;
}

/* Field Editor Modal - Dark Mode */
.field-modal-content {
  background: rgba(255, 255, 255, 0.05); /* Dark mode: subtle glass */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
  color: var(--carrot-text-primary);
}

/* Light mode override for field modal */
html.light-mode .field-modal-content {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 246, 230, 0.98) 100%);
  border: 1px solid rgba(10, 22, 40, 0.12);
  box-shadow: 0 40px 80px rgba(16, 20, 36, 0.28);
}

.bulk-step {
  display: grid;
  gap: var(--carrot-spacing-4);
}

.bulk-step__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.bulk-step__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--carrot-spacing-3);
  flex-wrap: wrap;
}

.bulk-mapping__table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(255, 255, 255, 0.1); /* Dark mode: light border */
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--carrot-shadow-soft);
}

.bulk-mapping__table th,
.bulk-mapping__table td {
  padding: var(--carrot-spacing-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Dark mode: light border */
  text-align: left;
}

.bulk-mapping__table thead th {
  background: rgba(255, 255, 255, 0.08); /* Dark mode: subtle glass header */
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--carrot-text-muted);
}

.bulk-mapping__table tbody tr:last-child td {
  border-bottom: none;
}

.bulk-mapping__select {
  width: 100%;
  padding: var(--carrot-spacing-2);
  border-radius: var(--carrot-radius-sm);
  border: 1px solid var(--carrot-border);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.05); /* Dark mode: glass effect */
  color: var(--carrot-text);
}

.bulk-summary__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--carrot-spacing-3);
}

.bulk-summary__stats > div {
  background: rgba(255, 255, 255, 0.05); /* Dark mode: subtle glass */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-md);
  padding: var(--carrot-spacing-3);
  display: grid;
  gap: var(--carrot-spacing-1);
  text-align: center;
}

.bulk-summary__stats strong {
  font-size: 22px;
  font-weight: 600;
  color: var(--carrot-heading);
}

.bulk-summary__stats span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--carrot-text-muted);
}

.bulk-summary__issues,
.bulk-summary__duplicates {
  background: rgba(255, 255, 255, 0.05); /* Dark mode: subtle glass */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-md);
  padding: var(--carrot-spacing-4);
  display: grid;
  gap: var(--carrot-spacing-2);
}

.bulk-summary__issues ul,
.bulk-summary__duplicates ul {
  margin: 0;
  padding-left: var(--carrot-spacing-4);
  color: var(--carrot-text-secondary);
}

.bulk-duplicates {
  margin: var(--carrot-spacing-4) 0;
  display: grid;
  gap: var(--carrot-spacing-2);
  border: none;
  padding: 0;
}

.bulk-duplicates legend {
  font-weight: 600;
  margin-bottom: var(--carrot-spacing-2);
}

.bulk-duplicates label {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  font-size: 14px;
}

.callout#bulkMappingWarnings,
.callout#bulkFinalWarnings {
  font-size: 14px;
}

.text-error {
  color: #b42318;
}

.text-success {
  color: #0f7a4d;
}

.admin-toolbar__user-dropdown {
  position: relative;
}

.admin-toolbar__dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.05); /* Dark mode: subtle glass */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-sm);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
  padding: var(--carrot-spacing-3);
  display: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
}

.admin-toolbar__dropdown-menu.is-open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.admin-toolbar__dropdown-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--carrot-spacing-3);
}

.admin-toolbar__dropdown-header strong {
  font-size: 14px;
  color: var(--carrot-heading);
  word-break: break-word;
}

.admin-toolbar__dropdown-item {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  padding: 10px var(--carrot-spacing-3);
  border-radius: var(--carrot-radius-xs);
  border: none;
  background: rgba(255, 255, 255, 0.05); /* Dark mode: subtle background */
  color: var(--carrot-text);
  cursor: pointer;
  font-weight: 600;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease;
}

.admin-toolbar__dropdown-item:hover,
.admin-toolbar__dropdown-item:focus-visible {
  background: rgba(248, 145, 32, 0.2);
  color: var(--carrot-accent);
  outline: none;
}

/* Language Switcher Dropdown */
.lang-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  margin-top: 8px;
  width: 132px;
  border-radius: var(--carrot-radius-md);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 1100;
}

.lang-dropdown-item {
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-dropdown-item:hover {
  background: rgba(248, 145, 32, 0.2);
  color: white;
}

/* Page-level user info - aligned with subtitle on same horizontal line */
.admin-page-user-info {
  font-size: 15px; /* Match admin-subtitle font-size exactly */
  color: var(--carrot-text-muted);
  line-height: 1.5; /* Match admin-subtitle to ensure same baseline */
  position: absolute;
  right: clamp(26px, 4vw, 42px);
  text-align: right;
  z-index: 10;
  /* Position to align with first card's subtitle (between button and results count):
     From admin-content top:
     - Card padding: clamp(26px, 4vw, 42px)
     - Title height: ~36-47px (responsive)
     - Subtitle margin: 8px
     Total: approximately 70-97px */
  top: 76px;
}

/* Old toolbar user info - kept for non-carrot layout compatibility */
.admin-toolbar__user-info {
  font-size: 13px;
  color: var(--carrot-text-muted);
  padding: 0 clamp(24px, 4vw, 40px);
  text-align: right;
}

.admin-toolbar__logout-form {
  display: none;
}

.admin-notify-form {
  display: grid;
  gap: var(--carrot-spacing-6);
}

.admin-notify-panel {
  display: grid;
  gap: var(--carrot-spacing-4);
}

.admin-notify-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--carrot-spacing-3);
  margin-top: var(--carrot-spacing-3);
}

.admin-notify-actions .btn {
  min-width: 180px;
}

.admin-table__select {
  text-align: center;
  width: 1%;
}

.admin-table__select input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.admin-table__sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--carrot-text-muted);
  text-decoration: none;
  font-size: 12px;
}

.admin-table__sort:hover,
.admin-table__sort:focus-visible {
  color: var(--carrot-accent-dark);
  outline: none;
}

.admin-table__sort.is-sorted {
  color: var(--carrot-heading);
}

.admin-table__sort-indicator {
  font-size: 11px;
  line-height: 1;
}

.admin-content {
  display: grid;
  gap: clamp(var(--carrot-spacing-6), 4vw, var(--carrot-spacing-8));
  /* Add padding-top to prevent content hiding under fixed navbar */
  padding-top: 35px; /* Navbar height + minimal spacing */
  position: relative; /* For absolute positioning of user info */
}

/* Responsive padding for mobile - navbar is taller on small screens */
@media (max-width: 768px) {
  .admin-content {
    padding-top: 70px;
  }
}

.admin-card,
.admin-section {
  /* Glass morphism - matching landing page cards */
  background: rgba(255, 255, 255, 0.05); /* .glass from landing page */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px; /* rounded-2xl from landing page */
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* NO box-shadow - matching landing page */
  padding: clamp(26px, 4vw, 42px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); /* Landing page hover-lift transition */
}

/* Hover effect - matching landing page hover:glass-strong */
.admin-card:hover,
.admin-section:hover {
  background: rgba(255, 255, 255, 0.08); /* .glass-strong from landing page */
  transform: translateY(-4px); /* Subtle lift effect */
}

/* Consistent spacing between adjacent sections */
.admin-section + .admin-section {
  margin-top: var(--carrot-spacing-6); /* 24px consistent spacing */
}

/* NO gradient overlay ::after - landing page doesn't use this */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--carrot-spacing-5);
  margin-bottom: clamp(var(--carrot-spacing-5), 3vw, var(--carrot-spacing-7));
  position: relative; /* For positioning user info within header */
}

.admin-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--carrot-heading);
  line-height: 1.3; /* Explicit line-height for consistent spacing */
}

.admin-subtitle {
  margin: var(--carrot-spacing-2) 0 0;
  color: var(--carrot-text-secondary);
  font-size: 15px;
  line-height: 1.5; /* Explicit line-height for alignment */
}

.admin-actions {
  display: inline-flex;
  gap: var(--carrot-spacing-3);
  flex-wrap: wrap;
}

.admin-empty-state {
  text-align: center;
  padding: clamp(var(--carrot-spacing-6), 5vw, 72px) var(--carrot-spacing-6);
  color: var(--carrot-text-muted);
  font-size: 16px;
  border-radius: var(--carrot-radius-md);
  background: rgba(255, 255, 255, 0.03); /* Dark mode: very subtle */
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.callout {
  border-radius: var(--carrot-radius-md);
  padding: var(--carrot-spacing-4);
  border: 1px solid var(--carrot-border-strong);
  background: rgba(255, 255, 255, 0.05); /* Dark mode: subtle glass effect */
  color: var(--carrot-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: grid;
  gap: var(--carrot-spacing-2);
}

.callout--warning {
  border-color: rgba(248, 145, 32, 0.4);
  background: rgba(248, 145, 32, 0.15); /* Dark mode: subtle orange tint */
  color: rgba(255, 255, 255, 0.95);
}

.callout--info {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.15); /* Dark mode: subtle purple tint */
  color: rgba(255, 255, 255, 0.95);
}

.callout--danger {
  border-color: rgba(255, 122, 122, 0.5);
  background: rgba(255, 122, 122, 0.15); /* Dark mode: subtle red tint */
  color: rgba(255, 255, 255, 0.95);
}

.btn {
  /* Landing page button style - simple and clean */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--carrot-spacing-2);
  padding: 8px 16px; /* Matching landing page px-4 py-2 */
  border-radius: 999px; /* rounded-full from landing page */
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease; /* Simple transition - matching landing page */
  background: var(--carrot-accent); /* Solid bg-carrot from landing page - NO gradient */
  color: white;
  /* NO box-shadow - landing page has none */
}

.btn:hover {
  background: var(--carrot-accent-strong); /* hover:bg-carrot-light from landing page */
}

.btn:active {
  background: var(--carrot-accent-dark);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  /* Glass button for dark theme */
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--carrot-border);
  color: var(--carrot-text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-outline {
  /* Glass outline button */
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--carrot-border);
  color: var(--carrot-text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  /* Danger button - solid color, no gradient */
  background: var(--carrot-danger);
  color: white;
}

.btn-danger:hover {
  background: #ff5171;
}

.btn-link {
  /* Link-style button */
  background: transparent;
  border: none;
  color: var(--carrot-accent);
  padding: 0;
}

.btn-link:hover {
  color: var(--carrot-accent-strong);
}

.btn-full {
  width: 100%;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--carrot-text-secondary);
  min-width: 100%;
  table-layout: auto;
  font-size: 14px;
  /* Glass morphism container - matching landing page */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px; /* rounded-2xl from landing page */
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden; /* Ensure rounded corners clip content */
}

.admin-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 14px;
  font-weight: 600;
  color: var(--carrot-text-muted); /* Light gray for dark theme */
  padding: var(--carrot-spacing-4);
  text-align: left;
  background: rgba(255, 255, 255, 0.08); /* Subtle glass header */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Light border for dark theme */
}

.admin-table tbody tr {
  background: transparent; /* No background by default */
  transition: background 0.18s ease, transform 0.18s ease;
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02); /* Very subtle alternating rows */
}

.admin-table tbody tr:hover {
  background: rgba(255, 107, 53, 0.1); /* Carrot orange hover - matching landing page */
  transform: translateY(-1px);
}

.admin-table tbody td {
  padding: var(--carrot-spacing-4) var(--carrot-spacing-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Subtle border for dark theme */
  vertical-align: top;
  color: var(--carrot-text-secondary); /* White/light gray text */
  word-break: break-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 200px;
}

.admin-table th:first-child,
.admin-table td:first-child,
.admin-table th:last-child,
.admin-table td:last-child {
  white-space: nowrap;
  width: 1%;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* Font consistency override for all admin tables - ensures uniform text appearance across all columns */
/* Force 14px font size for table itself, overriding any media query rules */
.admin-table {
  font-size: 14px !important;
}

/* Ensure all child elements within table cells use consistent 14px font */
.admin-table td,
.admin-table th,
.admin-table td *,
.admin-table th * {
  font-size: 14px !important;
  font-weight: 400 !important; /* Use regular weight for consistency */
}

/* Specific overrides for badge and pill classes */
.admin-table td .badge,
.admin-table td .pill,
.admin-table th .badge,
.admin-table th .pill {
  font-size: 14px !important;
  font-weight: 400 !important;
  text-transform: none !important; /* Remove uppercase transformation for better readability */
  letter-spacing: normal !important; /* Remove extra letter spacing to match regular text */
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--carrot-spacing-2);
}

.table-actions form {
  margin: 0;
}

.form-compact {
  max-width: 340px;
}

.form-compact select,
.form-compact input {
  width: 100%;
}

.wide-input {
  max-width: 420px;
  width: 100%;
}

.color-pair {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  flex-wrap: wrap;
}

.color-pair input[type="color"] {
  width: 48px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
}

.color-pair input[type="text"] {
  width: 120px;
  font-family: var(--carrot-font-mono);
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--carrot-spacing-2);
}

.upload-row input[type="text"] {
  flex: 1 1 240px;
}

.upload-row input[type="file"] {
  flex: 1 1 220px;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
}

.auth-hero {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr);
  min-height: calc(100vh - var(--carrot-shell-padding) * 2);
  background: rgba(255, 255, 255, 0.05); /* Dark mode: subtle glass */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--carrot-radius-lg);
  overflow: hidden;
  box-shadow: var(--carrot-shadow-card);
}

.auth-hero__panel {
  background: rgba(255, 255, 255, 0.03); /* Dark mode: very subtle */
  padding: clamp(32px, 6vw, 72px);
  display: grid;
  gap: clamp(var(--carrot-spacing-6), 5vw, var(--carrot-spacing-8));
}

.auth-hero__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-3);
}

.auth-hero__brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--carrot-accent-dark), rgba(16, 20, 36, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--carrot-accent);
  box-shadow: 0 16px 32px rgba(10, 22, 40, 0.3);
}

.auth-hero__brand-label {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.auth-hero__brand-name {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--carrot-heading);
}

.auth-hero__brand-sub {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--carrot-text-muted);
}

.auth-hero__card {
  background: rgba(255, 255, 255, 0.05); /* Dark mode: glass effect */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-lg);
  padding: clamp(var(--carrot-spacing-6), 5vw, var(--carrot-spacing-7));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  display: grid;
  gap: var(--carrot-spacing-5);
  max-width: 380px;
}

.auth-hero__title {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
  color: var(--carrot-heading);
  letter-spacing: -0.02em;
}

.auth-hero__subtitle {
  margin: 0;
  color: var(--carrot-text-secondary);
  font-size: 15px;
}

.auth-hero__callout {
  margin: 0;
}

.auth-hero__form {
  max-width: 360px;
}

.auth-hero__art {
  position: relative;
  background: linear-gradient(135deg, rgba(10, 22, 40, 0.82), rgba(21, 16, 50, 0.72));
}

.auth-hero__art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 232, 188, 0.4), rgba(248, 145, 32, 0.25)), radial-gradient(circle at 65% 35%, rgba(248, 145, 32, 0.5), transparent 60%);
  opacity: 0.85;
}

.auth-hero__art-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(248, 145, 32, 0.3), transparent 55%), radial-gradient(circle at 80% 80%, rgba(255, 187, 120, 0.35), transparent 60%);
  mix-blend-mode: screen;
}

.qr {
  display: inline-flex;
  padding: var(--carrot-spacing-1);
  border-radius: var(--carrot-radius-sm);
  background: rgba(255, 255, 255, 0.1); /* Dark mode: subtle glass */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  width: fit-content;
}

.qr img {
  width: 78px;
  height: 78px;
  display: block;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--carrot-text-secondary);
}

.pill--success {
  background: rgba(86, 197, 132, 0.18);
  color: #56c584;
}

.pill--warning {
  background: rgba(248, 145, 32, 0.18);
  color: rgba(248, 145, 32, 1); /* Dark mode: bright readable orange */
}

.pill--danger {
  background: rgba(255, 122, 122, 0.24);
  color: rgba(255, 122, 122, 1); /* Dark mode: bright readable red */
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.status-dot--success {
  background: #2ea964;
}

.status-dot--warning {
  background: #f5b75c;
}

.status-dot--danger {
  background: #ff7a7a;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  padding: 4px 10px;
  border-radius: var(--carrot-radius-xs);
  background: rgba(255, 255, 255, 0.08); /* Dark mode: subtle glass */
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 600;
  color: var(--carrot-text);
}

.badge--accent {
  background: var(--carrot-accent-soft);
  color: var(--carrot-accent-dark);
}

.badge--muted {
  color: var(--carrot-text-muted);
}

.admin-form {
  display: grid;
  gap: var(--carrot-spacing-5);
}

.admin-form__row {
  display: grid;
  gap: var(--carrot-spacing-2);
}

.admin-form label {
  font-weight: 600;
  color: var(--carrot-text-secondary);
  font-size: 14px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  background: rgba(255, 255, 255, 0.05); /* Dark mode: subtle glass effect */
  border: 1px solid var(--carrot-border-strong);
  border-radius: var(--carrot-radius-sm);
  color: var(--carrot-text);
  padding: 12px 16px;
  font-size: 15px;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

.admin-form select {
  /* Ensure select dropdowns adapt to dark mode */
  color-scheme: dark;

  /* Remove ALL default browser styling */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* Custom dropdown arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.7)' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: right 12px center;
  background-size: 12px 12px;
  padding-right: 36px;

  /* Remove any text decoration that could cause lines */
  text-decoration: none;
}

/* Remove focus ring that might look like lines */
.admin-form select::-moz-focus-inner {
  border: 0;
  padding: 0;
}

/* Remove default arrow on IE */
.admin-form select::-ms-expand {
  display: none;
}

.admin-form select option {
  background: rgba(10, 22, 40, 0.95) !important;
  background-image: none !important;
  color: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  text-decoration: none;
  border: none;
  outline: none;
}

/* Fix for empty/placeholder selects in forms */
.admin-form select:invalid,
.admin-form select[value=""],
.admin-form select option[value=""] {
  color: var(--carrot-text-muted);
  text-decoration: none;
}

/* Ensure NO underlines or decorations on form select options */
.admin-form select:focus option,
.admin-form select:hover option,
.admin-form select option:hover,
.admin-form select option:focus,
.admin-form select option:checked {
  text-decoration: none;
  outline: none;
  border: none;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--carrot-accent);
  box-shadow: 0 0 0 3px rgba(248, 145, 32, 0.25);
}

.admin-form__hint {
  color: var(--carrot-text-muted);
  font-size: 13px;
}

.admin-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--carrot-spacing-3);
}

.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  flex-wrap: wrap;
}

.muted {
  color: var(--carrot-text-muted);
}

.success {
  color: #108046;
}

.warning {
  color: #8a4c05;
}

.danger {
  color: #97243c;
}

.grid-cols-2 {
  display: grid;
  gap: var(--carrot-spacing-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.stack {
  display: grid;
  gap: var(--carrot-spacing-4);
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: var(--carrot-spacing-5) 0;
}

.table-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--carrot-spacing-4);
  color: var(--carrot-text-secondary);
}

.table-caption__title {
  font-size: 18px;
  font-weight: 600;
}

.table-caption__meta {
  font-size: 13px;
  color: var(--carrot-text-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--carrot-spacing-2);
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); /* Dark mode: subtle glass */
  border: 1px solid rgba(255, 255, 255, 0.1); /* Dark mode: light border */
  color: var(--carrot-text);
  font-size: 13px;
}

.chip--accent {
  background: var(--carrot-accent-soft);
  color: var(--carrot-accent-dark);
}

.template-editor__layout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--carrot-spacing-7);
  align-items: flex-start;
}

.template-editor-nav {
  flex: 0 0 clamp(68px, 8vw, 96px);
  position: sticky;
  top: var(--carrot-spacing-6);
  display: flex;
  flex-direction: column;
  gap: var(--carrot-spacing-2);
  z-index: 1;
}

.template-editor-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--carrot-spacing-2);
}

.template-editor-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--carrot-spacing-1);
  padding: var(--carrot-spacing-2) var(--carrot-spacing-2);
  border-radius: var(--carrot-radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--carrot-text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.template-editor-nav__item .template-editor-nav__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.template-editor-nav__item .template-editor-nav__label {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
}

.template-editor-nav__item:hover {
  border-color: var(--carrot-border);
  color: var(--carrot-text-primary);
}

.template-editor-nav__item.active,
.template-editor-nav__item.active:hover,
.template-editor-nav .tab-btn.active,
.template-editor-nav__item[aria-current="page"] {
  background: var(--carrot-surface-strong);
  color: var(--carrot-text-primary);
  border-color: var(--carrot-border);
  box-shadow: 0 12px 30px rgba(15, 25, 48, 0.25);
}

.template-editor-nav .tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--carrot-spacing-1);
  border: 1px solid transparent;
  border-bottom: none;
  padding: var(--carrot-spacing-3) var(--carrot-spacing-2);
  width: 100%;
  background: transparent;
  color: inherit;
}

.template-editor-nav .tab-btn:hover {
  border-color: var(--carrot-border);
  color: var(--carrot-text-primary);
}

.template-form {
  flex: 0 0 clamp(420px, 42vw, 520px);
}

.template-editor-section {
  display: grid;
  gap: var(--carrot-spacing-4);
  margin-bottom: var(--carrot-spacing-6);
}

.template-preview-panel {
  flex: 1 1 360px;
  position: sticky;
  top: var(--carrot-spacing-6);
  display: flex;
  flex-direction: column;
  gap: var(--carrot-spacing-4);
}

.template-preview-panel.is-hidden {
  display: none;
}

.preview-grid {
  display: grid;
  gap: var(--carrot-spacing-5);
  align-items: stretch;
}

.preview-grid--unified {
  margin-top: var(--carrot-spacing-5);
  padding-top: var(--carrot-spacing-4);
  border-top: 1px solid rgba(31, 36, 56, 0.08);
}

.preview-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--carrot-spacing-3);
  margin-bottom: var(--carrot-spacing-4);
  flex-wrap: wrap;
}

.preview-mode-toggle__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--carrot-text-muted);
}

.preview-mode-toggle__buttons {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--carrot-border);
  padding: 4px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.preview-mode-btn {
  border: none;
  background: transparent;
  color: var(--carrot-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.preview-mode-btn:hover {
  color: var(--carrot-text-primary);
}

.preview-mode-btn.active {
  background: var(--carrot-surface-strong);
  color: var(--carrot-text-primary);
  border: 1px solid var(--carrot-border-strong);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14);
}

html.light-mode .preview-mode-toggle__buttons {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .preview-mode-btn.active {
  background: #ffffff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
}

.preview-panel {
  display: grid;
  gap: var(--carrot-spacing-2);
}

.preview-panel__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--carrot-spacing-2);
}

.preview-panel__title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--carrot-text-muted);
}

.preview-panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  background: var(--carrot-surface);
  border: 1px solid var(--carrot-border);
  color: var(--carrot-text-muted);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.preview-panel__body {
  border-radius: var(--carrot-radius-md);
  background: var(--carrot-surface-strong);
  border: 1px solid var(--carrot-border);
  padding: var(--carrot-spacing-4);
  min-height: 320px;
  box-shadow: var(--carrot-shadow-soft);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.unified-preview-slot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.light-mode .preview-panel__body {
  background: #ffffff;
}

.preview-placeholder {
  font-size: 0.8rem;
  color: var(--carrot-text-muted);
  text-align: center;
}

.field-mapping-card {
  display: flex;
  flex-direction: column;
  gap: var(--carrot-spacing-3);
  margin-top: var(--carrot-spacing-6);
  padding: var(--carrot-spacing-4);
  border-radius: var(--carrot-radius-md);
  background: var(--carrot-surface-strong);
  border: 1px solid var(--carrot-border);
  box-shadow: var(--carrot-shadow-soft);
}

.field-mapping-card__header {
  display: flex;
  flex-direction: column;
  gap: var(--carrot-spacing-1);
}

.field-mapping-card__title {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--carrot-text-muted);
}

.field-mapping-card__subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--carrot-text-secondary);
}

.field-mapping-card__body {
  overflow-x: auto;
}

.field-mapping-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.field-mapping-table th,
.field-mapping-table td {
  padding: var(--carrot-spacing-2) var(--carrot-spacing-3);
  border-bottom: 1px solid var(--carrot-border);
  text-align: left;
  font-size: 0.85rem;
}

.field-mapping-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--carrot-text-muted);
}

.field-mapping-slot {
  font-weight: 600;
  color: var(--carrot-text-secondary);
  white-space: nowrap;
}

.field-mapping-label {
  font-weight: 500;
  color: var(--carrot-text-primary);
}

.field-mapping-value {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-1);
  color: var(--carrot-text-primary);
  font-size: 0.85rem;
}

.field-mapping-value--shared {
  color: var(--carrot-text-secondary);
}

.field-mapping-value--override {
  color: var(--carrot-accent-light);
  font-weight: 600;
}

.field-mapping-value--empty {
  color: var(--carrot-text-muted);
  font-style: italic;
}

.field-mapping-tag {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--carrot-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.field-mapping-tag--override {
  background: rgba(255, 107, 53, 0.15);
  border-color: rgba(255, 107, 53, 0.25);
  color: var(--carrot-accent-light);
}

.field-mapping-empty {
  margin-top: var(--carrot-spacing-2);
  font-size: 0.8rem;
  color: var(--carrot-text-muted);
}

.field-mapping-platform__editor {
  display: flex;
  flex-wrap: wrap;
  gap: var(--carrot-spacing-2);
  margin-top: var(--carrot-spacing-2);
}

.field-mapping-input-label {
  display: flex;
  flex-direction: column;
  gap: var(--carrot-spacing-1);
  min-width: 160px;
  font-size: 0.75rem;
  color: var(--carrot-text-muted);
}

.field-mapping-input-label__text {
  font-weight: 600;
  color: var(--carrot-text-secondary);
}

.field-mapping-input {
  border: 1px solid var(--carrot-border-strong);
  border-radius: var(--carrot-radius-sm);
  background: var(--carrot-surface);
  color: var(--carrot-text-primary);
  padding: 6px 8px;
  font-size: 0.85rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field-mapping-input:focus {
  outline: none;
  border-color: var(--carrot-accent-light);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.field-mapping-label--override {
  display: inline-flex;
  align-items: center;
  gap: var(--carrot-spacing-1);
  margin-right: var(--carrot-spacing-2);
  color: var(--carrot-accent-light);
  font-size: 0.78rem;
}

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

@media (min-width: 1100px) {
  .preview-grid {
    grid-template-columns: repeat(2, 340px);
    justify-content: center;
  }
}

@media (max-width: 1099px) {
  .preview-grid {
    grid-template-columns: 1fr;
  }
}

.preview-status {
  font-size: 13px;
  color: var(--carrot-text-muted);
}

.preview-status.is-error {
  color: var(--carrot-danger);
}

.preview-warnings {
  font-size: 12px;
  padding: var(--carrot-spacing-3);
  border-radius: var(--carrot-radius-sm);
  border: 1px solid rgba(248, 145, 32, 0.35);
  background: rgba(255, 245, 230, 0.95);
  color: #8a4c05;
}

.preview-warnings.is-hidden {
  display: none;
}

.template-color-grid {
  display: grid;
  gap: var(--carrot-spacing-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.apple-pass-preview-card,
.google-pass-preview-card {
  width: 100%;
  border-radius: 22px;
  box-shadow: var(--carrot-shadow-card);
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(24, 35, 58, 0.92));
  border: 1px solid var(--carrot-border);
  color: var(--carrot-text-primary);
  padding: var(--carrot-spacing-5);
  display: flex;
  flex-direction: column;
  gap: var(--carrot-spacing-4);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.apple-pass-preview-card .apple-pass-header,
.google-pass-preview-card .google-pass-header {
  display: flex;
  align-items: center;
  gap: var(--carrot-spacing-3);
  color: var(--carrot-heading);
}

.apple-pass-preview-card img.apple-pass-logo,
.google-pass-preview-card img.google-pass-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--carrot-surface);
  border: 1px solid var(--carrot-border);
}

.apple-pass-preview-card .apple-pass-org,
.google-pass-preview-card .google-pass-org {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--carrot-heading);
}

.apple-pass-preview-card .apple-pass-desc,
.google-pass-preview-card .google-pass-desc {
  font-size: 0.85rem;
  color: var(--carrot-text-secondary);
}

.apple-pass-preview-card .apple-pass-strip,
.google-pass-preview-card .google-pass-hero,
.google-pass-preview-card .google-pass-strip {
  width: 100%;
  height: 132px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  background-size: cover;
  background-position: center;
}

.apple-pass-preview-card .apple-pass-body,
.google-pass-preview-card .google-pass-body {
  display: grid;
  gap: var(--carrot-spacing-3);
}

.apple-pass-preview-card .apple-pass-fields,
.google-pass-preview-card .google-pass-section {
  display: grid;
  gap: var(--carrot-spacing-2);
}

.apple-pass-preview-card .apple-pass-field,
.google-pass-preview-card .google-pass-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.apple-pass-preview-card .apple-pass-field .label,
.google-pass-preview-card .google-pass-field .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--carrot-text-muted);
}

.apple-pass-preview-card .apple-pass-field .value,
.google-pass-preview-card .google-pass-field .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--carrot-text-primary);
}

.apple-pass-preview-card .apple-pass-barcode,
.google-pass-preview-card .google-pass-barcode {
  display: grid;
  gap: var(--carrot-spacing-2);
  justify-items: center;
  font-size: 0.75rem;
  color: var(--carrot-text-muted);
}

.apple-pass-preview-card .barcode-placeholder,
.google-pass-preview-card .barcode-placeholder {
  width: 100%;
  border-radius: 10px;
  padding: var(--carrot-spacing-4);
  background: rgba(255, 255, 255, 0.12);
  text-align: center;
  letter-spacing: 0.18em;
  color: var(--carrot-text-muted);
}

html.light-mode .apple-pass-preview-card,
html.light-mode .google-pass-preview-card {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--carrot-text-primary);
}

html.light-mode .apple-pass-preview-card .apple-pass-strip,
html.light-mode .google-pass-preview-card .google-pass-hero,
html.light-mode .google-pass-preview-card .google-pass-strip {
  background: rgba(0, 0, 0, 0.05);
}

html.light-mode .apple-pass-preview-card .apple-pass-field,
html.light-mode .google-pass-preview-card .google-pass-field {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}

html.light-mode .apple-pass-preview-card .barcode-placeholder,
html.light-mode .google-pass-preview-card .barcode-placeholder {
  background: rgba(0, 0, 0, 0.04);
}

.stat-grid {
  display: grid;
  gap: var(--carrot-spacing-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.stat-card {
  padding: var(--carrot-spacing-5);
  border-radius: var(--carrot-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  box-shadow: var(--carrot-shadow-soft);
  display: grid;
  gap: var(--carrot-spacing-3);
}

.stat-card__label {
  color: var(--carrot-text-muted);
  font-size: 13px;
}

.stat-card__value {
  font-size: 30px;
  font-weight: 600;
  color: var(--carrot-heading);
  letter-spacing: -0.02em;
}

.stat-card__trend {
  font-size: 13px;
  color: var(--carrot-text-secondary);
}

/* Responsive Breakpoints */

/* Compact layout before switching to hamburger */
@media (min-width: 1201px) and (max-width: 1450px) {
  .admin-toolbar {
    gap: var(--carrot-spacing-2);
    padding-left: clamp(20px, 3vw, 32px);
    padding-right: clamp(20px, 3vw, 32px);
  }

  .admin-toolbar__brand {
    margin-right: var(--carrot-spacing-2);
  }

  .admin-toolbar__nav {
    gap: 6px; /* Very tight spacing */
  }

  .admin-toolbar__link {
    padding: 8px 10px; /* Compact padding */
    font-size: 13px;
  }
}

/* Mobile drawer link styling handled in main mobile section below */

@media (max-width: 1400px) {
  /* Hide ID column on medium screens */
  .admin-table thead th:nth-child(1),
  .admin-table tbody td:nth-child(1) {
    display: none;
  }
}

@media (max-width: 1200px) {
  /* Hide USER and SERIAL columns */
  .admin-table thead th:nth-child(4),
  .admin-table tbody td:nth-child(4),
  .admin-table thead th:nth-child(7),
  .admin-table tbody td:nth-child(7) {
    display: none;
  }
  
  .admin-table {
    font-size: 13px;
  }
}

@media (max-width: 1024px) {
  body {
    padding: clamp(24px, 6vw, 56px);
  }

  .admin-card,
  .admin-section {
    padding: clamp(22px, 5vw, 32px);
  }

  .admin-toolbar {
    align-items: flex-start;
  }

  .admin-toolbar__nav {
    justify-content: center;
    gap: var(--carrot-spacing-2);
  }

  .auth-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-hero__art {
    min-height: 320px;
  }

  /* Switch tables to card layout */
  .table-scroll {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    overflow: visible;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tbody {
    display: grid;
    gap: var(--carrot-spacing-4);
  }

  .admin-table tbody tr {
    border-radius: var(--carrot-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: var(--carrot-spacing-4);
    display: grid;
    gap: var(--carrot-spacing-3);
    box-shadow: var(--carrot-shadow-soft);
  }

  .admin-table tbody td {
    padding: 0;
    border: none;
    display: grid;
    gap: var(--carrot-spacing-1);
    max-width: 100%;
  }

  .admin-table tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--carrot-text-muted);
  }

  .table-actions {
    display: grid;
    gap: var(--carrot-spacing-2);
  }

  .table-actions .btn,
  .table-actions button,
  .table-actions a {
    width: 100%;
  }

  .template-preview-panel {
    position: static;
    width: 100%;
    align-items: center;
  }

  .template-editor__layout {
    flex-direction: column;
  }

  .template-editor-nav {
    position: static;
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }

  .template-editor-nav__list {
    flex-direction: row;
    justify-content: center;
  }

  .template-editor-nav__item {
    flex-direction: row;
    gap: var(--carrot-spacing-2);
    padding: var(--carrot-spacing-2) var(--carrot-spacing-3);
  }

  .template-editor-nav__item .template-editor-nav__label {
    font-size: 0.7rem;
  }
}

/* Activate hamburger menu to prevent navigation wrapping - matching landing page md: breakpoint (768px) */
@media (max-width: 768px) {
  .admin-toolbar__container {
    padding: clamp(16px, 4vw, 22px) clamp(20px, 4vw, 28px);
  }

  .admin-toolbar__inner {
    gap: var(--carrot-spacing-3);
  }

  .admin-toolbar__brand {
    flex: 0 0 auto;
  }

  .admin-toolbar__actions {
    margin-left: auto;
    gap: var(--carrot-spacing-2);
  }

  .admin-toolbar__menu-toggle {
    display: inline-flex !important; /* Force show hamburger menu */
  }

  /* Hide desktop navigation on mobile */
  .admin-toolbar__nav {
    display: none !important;
  }

  /* Backdrop overlay for mobile drawer */
  .admin-toolbar__nav-mobile::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: -1; /* Behind the drawer content */
    pointer-events: none;
  }

  .admin-toolbar__nav-mobile.is-open::before {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Mobile drawer navigation */
  .admin-toolbar__nav-mobile {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    width: min(340px, 85vw);
    flex-direction: column;
    align-items: stretch;
    gap: var(--carrot-spacing-2);
    padding: var(--carrot-spacing-6) var(--carrot-spacing-4);
    background: rgba(0, 0, 0, 0.95); /* Dark background with slight transparency */
    backdrop-filter: blur(20px); /* Glass effect */
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--carrot-border);
    box-shadow: -2px 0 24px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .admin-toolbar__nav-mobile.is-open {
    right: 0;
  }

  /* Ensure drawer content (links, close button) is above backdrop */
  .admin-toolbar__nav-mobile > * {
    position: relative;
    z-index: 1;
  }

  .admin-toolbar__nav-close {
    display: flex !important; /* Force show in mobile drawer */
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    width: 44px;
    height: 44px;
    margin-bottom: var(--carrot-spacing-3);
    border: none;
    background: transparent;
    color: var(--carrot-text-primary); /* White for dark theme */
    cursor: pointer;
    border-radius: var(--carrot-radius-sm);
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .admin-toolbar__nav-close:hover {
    background: rgba(255, 255, 255, 0.1); /* Light hover for dark background */
  }

  .admin-toolbar__nav-close:active {
    background: rgba(255, 255, 255, 0.15);
  }

  .admin-toolbar__link {
    width: 100%;
    justify-content: flex-start;
    /* Landing page style - no background/border */
    background: transparent;
    padding: 12px 18px;
    flex-wrap: nowrap;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.8); /* Lighter text for mobile drawer */
  }

  .admin-toolbar__link:hover {
    background: rgba(248, 145, 32, 0.1); /* Subtle hover like landing page */
    color: rgba(255, 255, 255, 1);
  }
}

@media (max-width: 640px) {
  .admin-toolbar {
    gap: var(--carrot-spacing-2);
  }

  .admin-toolbar__brand-logo {
    height: 48px; /* Increased from 36px for better visibility */
  }

  .admin-toolbar__actions {
    gap: var(--carrot-spacing-2);
  }

  .admin-toolbar__icon {
    width: 40px;
    height: 40px;
  }

  .admin-toolbar__nav {
    padding: var(--carrot-spacing-2) var(--carrot-spacing-3);
  }
}

@media (max-width: 540px) {
  .admin-toolbar__container {
    padding: clamp(14px, 5vw, 20px) clamp(16px, 4vw, 24px);
  }

  .admin-toolbar__brand {
    padding: 0;
    margin-right: 0;
  }

  .admin-toolbar__brand-logo {
    height: 36px;
  }

  .admin-toolbar__nav {
    width: calc(100vw - 32px);
    right: 0;
    left: 0;
    margin: 0 auto;
    padding: var(--carrot-spacing-3);
  }

  .admin-toolbar__link {
    padding: 13px 18px;
    font-size: 15px;
  }

  .admin-toolbar__icon {
    width: 44px;
    height: 44px;
  }
}

@media (min-width: 1025px) {
  /* Truncate long text in table cells on desktop */
  .admin-table tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .admin-table tbody td:nth-child(11) {
    max-width: none;
  }
  
  .admin-table tbody td:nth-child(7) {
    font-family: var(--carrot-font-mono);
    font-size: 12px;
    max-width: 160px;
  }
}

@media (max-width: 900px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-actions {
    width: 100%;
    flex-direction: column;
    gap: var(--carrot-spacing-2);
  }

  .admin-actions .btn {
    width: 100%;
  }

  /* Adjust user info positioning for stacked header layout */
  .admin-page-user-info {
    position: static;
    margin: 0;
    padding: 0 var(--carrot-spacing-4);
    margin-bottom: var(--carrot-spacing-4);
    text-align: left;
  }
}

@media (max-width: 720px) {
  body {
    padding: clamp(20px, 7vw, 40px);
  }

  .admin-toolbar {
    align-items: stretch;
  }

  .admin-toolbar__nav {
    justify-content: flex-start;
  }

  .admin-toolbar__actions {
    justify-content: flex-start;
    gap: var(--carrot-spacing-2);
  }

  .admin-toolbar__user-info {
    padding: 0 var(--carrot-spacing-4);
  }

  /* On mobile, move user info below the header instead of overlapping */
  .admin-page-user-info {
    position: static;
    margin: 0;
    padding: 0 var(--carrot-spacing-4);
    margin-bottom: var(--carrot-spacing-4);
  }

  .admin-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  :root {
    --carrot-shell-padding: 16px;
  }
  
  body {
    padding: 16px;
  }
  
  .admin-title {
    font-size: 24px;
  }
  
  .auth-hero {
    grid-template-columns: 1fr;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}
.back-sections {
  display: grid;
  gap: var(--carrot-spacing-4);
}

.back-sections__actions {
  display: flex;
  justify-content: flex-start;
  margin-top: var(--carrot-spacing-2);
}

.back-sections__actions .btn {
  min-width: 140px;
}

.back-section {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-md);
  padding: var(--carrot-spacing-4);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  box-shadow: var(--carrot-shadow-soft);
  display: grid;
  gap: var(--carrot-spacing-3);
}

.back-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--carrot-spacing-3);
}

.back-section__controls {
  display: inline-flex;
  gap: var(--carrot-spacing-2);
}

.back-section__counter {
  font-weight: 600;
  font-size: 14px;
  color: var(--carrot-heading);
}

.back-section__remove {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--carrot-accent);
  border-radius: var(--carrot-radius-xs);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}

.back-section__remove:hover,
.back-section__remove:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
}

.back-section__editor .ql-editor {
  min-height: 140px;
}

/* Home page dashboard tiles */
.home-tile {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-md);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
  padding: var(--carrot-spacing-5);
  display: grid;
  gap: var(--carrot-spacing-3);
  position: relative;
  overflow: hidden;
}

.home-placeholder-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--carrot-text-muted);
}

/* Dashboard Chart Styles */
.dashboard-controls {
  display: flex;
  align-items: center;
  gap: var(--carrot-spacing-4);
  padding: var(--carrot-spacing-4);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--carrot-radius-md);
  margin-bottom: var(--carrot-spacing-4);
  flex-wrap: wrap;
}

.dashboard-controls label {
  font-size: 13px;
  font-weight: 500;
  color: var(--carrot-text-secondary);
}

.dashboard-controls select {
  min-width: 140px;
}

.chart-section {
  display: grid;
  gap: var(--carrot-spacing-3);
  text-align: center;
}

.chart-header {
  display: flex;
  align-items: center;
  gap: var(--carrot-spacing-3);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--carrot-warning);
}

.chart-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--carrot-heading);
  margin: 0;
}

.chart-subtitle {
  font-size: 13px;
  color: var(--carrot-text-muted);
  margin: 0;
}

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Loading and Error States */
.dashboard-loading,
.dashboard-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-size: 14px;
  color: var(--carrot-text-muted);
}

.dashboard-error {
  color: var(--carrot-danger);
}

/* Expirations List */
.expirations-list {
  display: grid;
  gap: var(--carrot-spacing-2);
  margin: var(--carrot-spacing-3) 0;
}

.expiration-item {
  display: flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  font-size: 13px;
  color: var(--carrot-text-secondary);
}

.expiration-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.no-expirations {
  font-size: 13px;
  color: var(--carrot-text-muted);
  text-align: center;
  padding: var(--carrot-spacing-3) 0;
}

/* Gauge Chart - Modern Style */
.gauge-container {
  position: relative;
  width: 120px;
  margin: 0 auto;
}

.gauge-container-modern {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.gauge-percentage {
  font-size: 36px;
  font-weight: 700;
  color: var(--carrot-heading);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.gauge-label-inline {
  font-size: 11px;
  font-weight: 500;
  color: var(--carrot-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gauge-label {
  text-align: center;
  font-size: 13px;
  color: var(--carrot-text-muted);
  margin-bottom: var(--carrot-spacing-3);
}

/* Metrics */
.metrics-list {
  display: grid;
  gap: var(--carrot-spacing-3);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 13px;
  color: var(--carrot-text-muted);
}

.metric-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--carrot-heading);
}

.metric-value-small {
  font-size: 18px;
  font-weight: 600;
  color: var(--carrot-heading);
}

.metric-unit {
  font-size: 16px;
  color: var(--carrot-text-muted);
  font-weight: 400;
}

.metric-box {
  margin: var(--carrot-spacing-4) auto 0;
  padding: var(--carrot-spacing-3);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--carrot-radius-sm);
  text-align: center;
  max-width: 300px;
}

/* Follow-ups Section */
.followups-section {
  margin: var(--carrot-spacing-4) auto 0;
  max-width: 400px;
}

.progress-item {
  margin-bottom: var(--carrot-spacing-3);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 12px;
  color: var(--carrot-text-muted);
}

.progress-value {
  font-size: 12px;
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Light Mode Overrides for Dashboard Charts */
html.light-mode .dashboard-controls {
  background: rgba(0, 0, 0, 0.02);
}

html.light-mode .live-badge {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--carrot-warning);
}

html.light-mode .metric-box {
  background: rgba(0, 0, 0, 0.02);
}

html.light-mode .progress-bar {
  background: rgba(0, 0, 0, 0.05);
}

/* Responsive Dashboard Charts */
@media (max-width: 768px) {
  .dashboard-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-controls select {
    width: 100%;
  }

  .chart-title {
    font-size: 16px;
  }

  .metric-value {
    font-size: 20px;
  }
}

/* Super admin dashboard stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.admin-stat {
  padding: var(--carrot-spacing-5);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-md);
  text-align: center;
}

.admin-stat__value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--carrot-accent);
  line-height: 1;
}

.admin-stat__label {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--carrot-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Super admin action cards */
.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-auto-rows: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.admin-action-card {
  padding: var(--carrot-spacing-5);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.admin-action-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--carrot-accent);
  box-shadow: 0 4px 12px rgba(248, 145, 32, 0.3);
  transform: translateY(-2px);
}

.admin-action-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  color: var(--carrot-heading);
}

.admin-action-card .muted {
  margin: 0;
  font-size: 0.875rem;
  color: var(--carrot-text-muted);
}

/* Readonly input field */
.input-readonly {
  background: rgba(255, 255, 255, 0.02) !important;
  cursor: not-allowed !important;
  opacity: 0.7;
}

/* Apple PassKit Validation Panel */
.validation-panel {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-md);
  padding: var(--carrot-spacing-5);
  margin: 1.5rem 0;
}

.validation-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.validation-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--carrot-heading);
}

.validation-results {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--carrot-radius-sm);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.validation-summary {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.validation-summary__status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.validation-summary__text {
  font-size: 0.9375rem;
  color: var(--carrot-text);
}

.validation-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: var(--carrot-radius-xs);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.validation-badge--success {
  background: rgba(86, 197, 132, 0.18);
  color: #56c584;
  border: 1px solid rgba(86, 197, 132, 0.3);
}

.validation-badge--warning {
  background: rgba(248, 145, 32, 0.18);
  color: rgba(248, 145, 32, 1);
  border: 1px solid rgba(248, 145, 32, 0.3);
}

.validation-badge--error {
  background: rgba(255, 122, 122, 0.24);
  color: rgba(255, 122, 122, 1);
  border: 1px solid rgba(255, 122, 122, 0.4);
}

.validation-issues-section {
  margin-top: 1rem;
}

.validation-issues-section__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
}

.validation-issues-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.validation-issue {
  padding: 0.875rem;
  border-radius: var(--carrot-radius-xs);
  border-left: 4px solid;
  background: rgba(255, 255, 255, 0.05);
}

.validation-issue--error {
  border-left-color: #ff7a7a;
}

.validation-issue--warning {
  border-left-color: #f89120;
}

.validation-issue--info {
  border-left-color: #56c584;
}

.validation-issue strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-family: 'Courier New', monospace;
  color: var(--carrot-text);
}

.validation-issue p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--carrot-text-muted);
  line-height: 1.5;
}

.validation-issue__field {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--carrot-text-muted);
  font-family: 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
}

.validation-success {
  padding: 1rem;
  background: rgba(86, 197, 132, 0.15);
  color: #56c584;
  border-radius: var(--carrot-radius-xs);
  margin: 0;
  font-size: 0.9375rem;
  text-align: center;
  font-weight: 500;
}

/* Permissions grid */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.permission-item label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: var(--carrot-spacing-4);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--carrot-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.permission-item label:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--carrot-accent);
}

.permission-item input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.permission-item input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.permission-item label:has(input:disabled) {
  opacity: 0.7;
  cursor: not-allowed;
}

.permission-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.permission-info strong {
  font-size: 0.9375rem;
  color: var(--carrot-heading);
}

.permission-info .muted {
  font-size: 0.8125rem;
}

/* ============================================
   Platform Selection Component (Phase 3)
   ============================================ */

.platform-selection {
  display: flex;
  flex-direction: column;
  gap: var(--carrot-spacing-4);
  margin-top: var(--carrot-spacing-4);
}

.platform-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--carrot-spacing-4);
  padding: var(--carrot-spacing-5);
  background: var(--carrot-surface);
  border: 1px solid var(--carrot-border);
  border-radius: var(--carrot-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.platform-checkbox:hover {
  background: var(--carrot-surface-strong);
  border-color: var(--carrot-accent);
  transform: translateY(-2px);
}

.platform-checkbox:has(input:checked) {
  background: var(--carrot-accent-soft);
  border-color: var(--carrot-accent);
}

.platform-checkbox input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.platform-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.platform-label {
  display: flex;
  flex-direction: column;
  gap: var(--carrot-spacing-1);
  flex: 1;
}

.platform-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--carrot-heading);
  line-height: 1.4;
}

.platform-info {
  font-size: 0.8125rem;
  color: var(--carrot-text-muted);
  line-height: 1.4;
}

/* Responsive: Stack on mobile */
@media (max-width: 640px) {
  .platform-selection {
    gap: var(--carrot-spacing-3);
  }

  .platform-checkbox {
    padding: var(--carrot-spacing-4);
  }

  .platform-icon {
    font-size: 1.5rem;
  }
}

/* ============================================
   Real-Time Validation Styles (Phase 3 Task #3)
   ============================================ */

.validation-error {
  margin-top: var(--carrot-spacing-2);
  padding: var(--carrot-spacing-3);
  background: rgba(220, 38, 38, 0.1);
  border-left: 3px solid var(--carrot-danger);
  border-radius: var(--carrot-radius-xs);
  font-size: 0.875rem;
  color: #dc2626;
  line-height: 1.5;
}

.validation-warning {
  margin-top: var(--carrot-spacing-2);
  padding: var(--carrot-spacing-3);
  background: rgba(245, 183, 92, 0.1);
  border-left: 3px solid var(--carrot-warning);
  border-radius: var(--carrot-radius-xs);
  font-size: 0.875rem;
  color: #f5b75c;
  line-height: 1.5;
}

.platform-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: var(--carrot-accent);
  color: white;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  margin-right: var(--carrot-spacing-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.validation-status-bar {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  background: var(--carrot-surface);
  backdrop-filter: blur(10px);
  padding: var(--carrot-spacing-4);
  border-radius: var(--carrot-radius-md);
  border: 1px solid var(--carrot-border);
  box-shadow: var(--carrot-shadow-soft);
  min-width: 160px;
}

.validation-status {
  display: flex;
  align-items: center;
  gap: var(--carrot-spacing-2);
  font-size: 0.875rem;
  font-weight: 600;
}

.status-icon {
  font-size: 1.125rem;
  line-height: 1;
}

.status-validating {
  color: var(--carrot-text-secondary);
}

.status-validating .status-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

.status-valid {
  color: var(--carrot-success);
}

.status-invalid {
  color: var(--carrot-danger);
}

.status-error {
  color: var(--carrot-warning);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Responsive: Adjust validation status bar */
@media (max-width: 768px) {
  .validation-status-bar {
    top: auto;
    bottom: 20px;
    right: 10px;
    left: 10px;
    width: auto;
  }
}

/* ============================================
   Character Counter Styles (Phase 3 Task #4)
   ============================================ */

.input-with-counter {
  position: relative;
}

.character-counter {
  display: flex;
  gap: var(--carrot-spacing-4);
  margin-top: var(--carrot-spacing-2);
  font-size: 0.75rem;
  font-weight: 500;
}

.counter-apple,
.counter-google {
  display: flex;
  align-items: center;
  gap: var(--carrot-spacing-1);
  transition: color 0.2s ease;
}

.counter-apple::before {
  content: '🍎';
  font-size: 0.875rem;
}

.counter-google::before {
  content: '🤖';
  font-size: 0.875rem;
}

.counter-good {
  color: var(--carrot-success);
}

.counter-warning {
  color: var(--carrot-warning);
  font-weight: 600;
}

.counter-over {
  color: var(--carrot-danger);
  font-weight: 700;
  animation: pulse-error 1.5s ease-in-out infinite;
}

@keyframes pulse-error {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Field limit info icon */
.field-limit-info {
  display: inline-block;
  margin-left: var(--carrot-spacing-2);
  font-size: 0.875rem;
  color: var(--carrot-text-secondary);
  cursor: help;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.field-limit-info:hover {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .character-counter {
    flex-direction: column;
    gap: var(--carrot-spacing-1);
    font-size: 0.7rem;
  }
}

/* ============================================
   Pass Preview Component Styles (Phase 3 Task #5)
   ============================================ */

/* Preview Container */
.pass-preview-container {
  position: sticky;
  top: 80px;
  background: white;
  border: 1px solid var(--carrot-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Preview Header */
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--carrot-border);
}

.preview-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--carrot-text);
}

/* Toggle Buttons */
.preview-toggle {
  display: flex;
  gap: 0.5rem;
}

.preview-toggle-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--carrot-border);
  border-radius: 6px;
  background: white;
  color: var(--carrot-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-toggle-btn:hover {
  background: var(--carrot-background);
  border-color: var(--carrot-primary);
}

.preview-toggle-btn.active {
  background: var(--carrot-primary);
  color: white;
  border-color: var(--carrot-primary);
}

/* Platform and Side Toggle Containers (dark mode default) */
.preview-platform-toggle,
.preview-side-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.preview-side-toggle {
  gap: 0.25rem;
  box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
}

/* Inactive toggle button text (dark mode) */
.preview-platform-toggle button,
.preview-side-toggle button {
  color: rgba(255, 255, 255, 0.7);
}

.preview-platform-toggle button.active,
.preview-side-toggle button.active {
  color: white;
}

/* Light mode overrides for toggle containers */
html.light-mode .preview-platform-toggle,
html.light-mode .preview-side-toggle {
  background: #f3f4f6;
}

html.light-mode .preview-platform-toggle button,
html.light-mode .preview-side-toggle button {
  color: #4b5563;
}

html.light-mode .preview-platform-toggle button.active,
html.light-mode .preview-side-toggle button.active {
  color: white;
}

/* Preview Content */
.preview-content {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 500px;
  padding: 1rem 0;
}

/* Pass Mockup Container */
.pass-mockup {
  flex: 0 0 auto;
  width: 340px;
  transition: opacity 0.3s ease;
}

/* Apple Wallet Card */
.apple-wallet-card {
  --bg-color: #1e3a8a;
  --fg-color: #ffffff;
  --label-color: #93c5fd;
  
  width: 100%;
  border-radius: 26px;
  padding: 18px 18px 22px;
  background: var(--bg-color);
  color: var(--fg-color);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Apple Wallet - Top Section */
.apple-wallet-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 60px;
}

.apple-wallet-logo {
  width: 96px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(15, 23, 42, 0.16));
}

.apple-wallet-header-fields {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.apple-wallet-header-item {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Apple Wallet - Strip Image */
.apple-wallet-strip {
  height: 132px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Apple Wallet - Body */
.apple-wallet-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.apple-wallet-org {
  font-size: 1.1rem;
  font-weight: 600;
}

.apple-wallet-description {
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--label-color);
}

.apple-wallet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.apple-wallet-field-block {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.apple-wallet-field-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label-color);
}

.apple-wallet-field-value {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.2;
}

.apple-wallet-row-primary .apple-wallet-field-value {
  font-size: 1.55rem;
}

.apple-wallet-row-aux .apple-wallet-field-value {
  font-size: 0.95rem;
  opacity: 0.85;
}

/* Apple Wallet - Barcode */
.apple-wallet-barcode {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.apple-wallet-barcode-box {
  width: 148px;
  height: 148px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.apple-wallet-barcode-img {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  background: #0f172a;
  background-size: cover;
  background-position: center;
}

.apple-wallet-barcode-text {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--label-color);
  text-transform: uppercase;
}

/* Google Wallet Card */
.google-wallet-card {
  --bg-color: #1e3a8a;
  --fg-color: #ffffff;
  --label-color: #93c5fd;
  
  width: 100%;
  border-radius: 20px;
  background: var(--bg-color);
  color: var(--fg-color);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

/* Google Wallet - Header */
.google-wallet-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.google-wallet-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.google-wallet-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
}

.google-wallet-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.google-wallet-org {
  font-size: 1.1rem;
  font-weight: 600;
}

.google-wallet-description {
  font-size: 0.875rem;
  color: var(--label-color);
}

/* Google Wallet - Strip Image */
.google-wallet-strip {
  width: 100%;
  height: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: height 0.3s ease;
}

/* Google Wallet - Body */
.google-wallet-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.google-wallet-section {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.google-wallet-section-primary {
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.google-wallet-field-block {
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.google-wallet-field-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label-color);
}

.google-wallet-field-value {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}

.google-wallet-section-primary .google-wallet-field-value {
  font-size: 1.4rem;
}

.google-wallet-section-aux .google-wallet-field-value {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Google Wallet - Barcode */
.google-wallet-barcode {
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.google-wallet-barcode-box {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.google-wallet-barcode-img {
  width: 120px;
  height: 120px;
  border-radius: 6px;
  background: #0f172a;
  background-size: cover;
  background-position: center;
}

.google-wallet-barcode-text {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--label-color);
  text-transform: uppercase;
}

/* Preview Status Indicator */
.preview-status {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--carrot-background);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--carrot-text-secondary);
}

.preview-status-icon {
  font-size: 1.25rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .pass-preview-container {
    position: relative;
    top: auto;
    padding: 1rem;
  }
  
  .preview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .preview-toggle {
    width: 100%;
    justify-content: space-between;
  }
  
  .preview-toggle-btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .preview-content {
    gap: 1rem;
  }
  
  .pass-mockup {
    width: 100%;
    max-width: 340px;
  }
}

@media (max-width: 480px) {
  .apple-wallet-card,
  .google-wallet-card {
    border-radius: 16px;
  }
  
  .apple-wallet-logo,
  .google-wallet-logo {
    width: 60px;
    height: 40px;
  }
  
  .preview-toggle-btn {
    font-size: 0.75rem;
  }
}

/* ========================================================================
   Action Menu Dropdown - Full Specification Compliance
   Portal-based dropdown menus with keyboard navigation and accessibility
   ======================================================================== */

/* Portal container - renders all menus */
#action-menu-portal {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 1000;
}

#action-menu-portal > * {
  pointer-events: auto;
}

/* Action menu container (inline in table) */
.action-menu {
  position: relative;
  display: inline-block;
}

/* Three-dot toggle button */
.action-menu__toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  font-size: 0; /* Hide the Unicode character */
  text-indent: -9999px; /* Push text off-screen */
  overflow: hidden; /* Hide anything outside the box */
  line-height: 1;
  color: var(--carrot-text-secondary, #999);
  transition: all 0.15s ease;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* SVG three-dot icon */
.action-menu__toggle::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  text-indent: 0; /* Reset text-indent from parent */
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='5' r='2.5'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Ccircle cx='12' cy='19' r='2.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='5' r='2.5'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Ccircle cx='12' cy='19' r='2.5'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.action-menu__toggle:hover {
  background: var(--carrot-surface, rgba(255, 255, 255, 0.05));
  color: var(--carrot-text-primary, #fff);
}

.action-menu__toggle:focus-visible {
  outline: 2px solid var(--carrot-accent, #ff7a7a);
  outline-offset: 2px;
}

.action-menu__toggle:active {
  transform: scale(0.95);
}

.action-menu__toggle[aria-expanded="true"] {
  background: var(--carrot-surface, rgba(255, 255, 255, 0.05));
  color: var(--carrot-accent, #ff7a7a);
}

/* Dropdown menu (template in DOM, cloned to portal when opened) */
.action-menu__dropdown {
  /* Hidden by default - portal version will be shown */
  display: none;
}

/* Portal-rendered dropdown menu */
#action-menu-portal .action-menu__dropdown {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  min-width: 180px;
  max-width: 90vw;
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform-origin: top right;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 1000;
  will-change: opacity;
  overflow: hidden;
}

#action-menu-portal .action-menu__dropdown.active {
  opacity: 1;
  visibility: visible;
}

/* Menu list */
.action-menu__list {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 80vh;
  overflow-y: auto;
}

.action-menu__item {
  margin: 0;
}

/* Menu items (links and buttons) */
.action-menu__link,
.action-menu__button {
  display: block !important;
  width: 100%;
  padding: 12px 16px;
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 6px;
  background: transparent;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.action-menu__link:hover,
.action-menu__button:hover {
  background: var(--carrot-surface, rgba(255, 255, 255, 0.1));
  color: var(--carrot-accent, #ff7a7a) !important;
}

.action-menu__link:focus-visible,
.action-menu__button:focus-visible {
  outline: 2px solid var(--carrot-accent, #ff7a7a);
  outline-offset: -2px;
  background: var(--carrot-surface, rgba(255, 255, 255, 0.1));
}

/* Danger variant for destructive actions */
.action-menu__link--danger,
.action-menu__button--danger {
  color: var(--carrot-danger, #ff7a7a) !important;
}

.action-menu__link--danger:hover,
.action-menu__button--danger:hover {
  background: rgba(255, 122, 122, 0.1);
  color: var(--carrot-danger, #ff7a7a) !important;
}

/* Disabled state */
.action-menu__link:disabled,
.action-menu__button:disabled,
.action-menu__link[disabled],
.action-menu__button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Ensure action menu items in admin tables have proper styling */
.admin-table td .action-menu__link,
.admin-table td .action-menu__button {
  font-weight: 500 !important;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  #action-menu-portal .action-menu__dropdown {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* Light theme override */
html.light-mode #action-menu-portal .action-menu__dropdown {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

html.light-mode .action-menu__link,
html.light-mode .action-menu__button {
  color: #333333 !important;
}

html.light-mode .action-menu__link:hover,
html.light-mode .action-menu__button:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  #action-menu-portal .action-menu__dropdown {
    max-width: calc(100vw - 16px);
    min-width: 160px;
  }

  .action-menu__link,
  .action-menu__button {
    padding: 14px 16px;
    font-size: 16px;
  }
}

/* RTL support */
[dir="rtl"] .action-menu__toggle {
  /* Icon already works in RTL */
}

[dir="rtl"] .action-menu__link,
[dir="rtl"] .action-menu__button {
  text-align: right;
}

/* ============================================
   Table Filter Controls - Horizontal Layout
   ============================================ */

.table-filter-controls {
  margin-bottom: var(--carrot-space-md, 1rem);
}

.table-filter-controls__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--carrot-space-sm, 0.75rem);
  align-items: flex-end;
  background: var(--carrot-surface-secondary, #f5f5f5);
  padding: var(--carrot-space-md, 1rem);
}

/* Dark mode support (default - no light-mode class) */
body:not(.light-mode) .table-filter-controls__inner {
  background: rgba(255, 255, 255, 0.05);
}

.table-filter-controls__group {
  display: flex;
  flex-direction: column;
  gap: var(--carrot-space-xs, 0.25rem);
  min-width: 120px;
  flex: 0 1 auto;
}

.table-filter-controls__group label {
  font-size: var(--carrot-font-size-sm, 0.875rem);
  font-weight: 500;
  color: var(--carrot-text-secondary, #666);
  white-space: nowrap;
}

body:not(.light-mode) .table-filter-controls__group label {
  color: rgba(255, 255, 255, 0.7);
}

/* Input field sizing */
.table-filter-controls__group input[type="number"],
.table-filter-controls__group input[type="text"] {
  min-width: 100px;
  max-width: 180px;
}

.table-filter-controls__group input[type="date"] {
  min-width: 140px;
  max-width: 160px;
}

.table-filter-controls__group select {
  min-width: 120px;
  max-width: 200px;
}

/* Button alignment */
.table-filter-controls__inner > .btn {
  align-self: flex-end;
  margin-top: auto;
  white-space: nowrap;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
  .table-filter-controls__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .table-filter-controls__group {
    width: 100%;
    min-width: unset;
  }

  .table-filter-controls__group input,
  .table-filter-controls__group select {
    max-width: 100%;
  }

  .table-filter-controls__inner > .btn {
    width: 100%;
  }
}

/* ============================================
   React Filter Panel Overrides
   Fixes layout when .table-filter-controls are injected into the sidebar
   ============================================ */

.c-filter-panel .table-filter-controls__inner {
  display: flex;
  flex-direction: column; /* Stack vertically */
  align-items: stretch;   /* Full width */
  background: transparent; /* Remove background */
  padding: 0;              /* Remove padding */
  gap: var(--carrot-spacing-4);
}

.c-filter-panel .table-filter-controls__group {
  width: 100%;
  min-width: 0;
}

.c-filter-panel .table-filter-controls__group input,
.c-filter-panel .table-filter-controls__group select {
  max-width: 100%; /* Full width inputs */
  width: 100%;
}

/* Make labels look like titles */
.c-filter-panel .table-filter-controls__group label {
  display: block !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--carrot-text-muted) !important;
  margin-bottom: 4px !important;
}

/* Light mode override for visibility */
html.light-mode .c-filter-panel .table-filter-controls__group label {
  color: #4b5563 !important; /* Dark gray for light mode */
}

/* ===========================
   Filter Component Classes (Spec §7)
   =========================== */

/* Layout containers */
.c-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bar-gap-y) var(--bar-gap-x);
}
.c-filter-bar.is-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--filter-bg);
}

.c-filter-form {
  display: block;
}
.c-filter-form.is-enhanced {
  /* Hook for JS-enhanced state */
}

/* Groups & labels */
.c-filter-group {
  display: flex;
  align-items: center;
  gap: var(--group-gap);
}
.c-filter-label {
  color: var(--filter-text-muted);
  font-size: var(--font-sm);
}

/* Chips (toggle pills) */
.c-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--ctl-h-md);
  padding: var(--chip-py-md) var(--chip-px-md);
  border-radius: var(--chip-radius);
  background: var(--filter-bg);
  border: 1px solid var(--filter-border);
  color: var(--filter-text);
  transition:
    background var(--motion-med),
    border-color var(--motion-med),
    color var(--motion-med);
  cursor: pointer;
}
.c-filter-chip:hover {
  background: var(--filter-bg-hover);
}
.c-filter-chip:focus-visible {
  outline: var(--filter-ring-width) solid var(--filter-border-focus);
  outline-offset: var(--filter-ring-offset);
}
.c-filter-chip.is-active,
.c-filter-chip[aria-pressed="true"] {
  background: var(--filter-bg-active);
  border-color: var(--filter-border-active);
  color: var(--filter-text-active);
}
.c-filter-chip.is-disabled,
.c-filter-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.c-filter-chip.is-loading {
  opacity: 0.7;
}

/* Chip sizes */
.c-filter-chip.size-sm {
  height: var(--ctl-h-sm);
  padding: var(--chip-py-sm) var(--chip-px-sm);
  font-size: var(--font-sm);
}
.c-filter-chip.size-lg {
  height: var(--ctl-h-lg);
  padding: var(--chip-py-lg) var(--chip-px-lg);
  font-size: var(--font-lg);
}

/* Inputs (search/select/range) */
.c-filter-search {
  position: relative;
}
.c-filter-input,
.c-filter-select select,
.c-filter-range input[type="range"] {
  background: var(--filter-bg);
  color: var(--filter-text);
  border: 1px solid var(--filter-border);
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.c-filter-input {
  height: var(--ctl-h-md);
  padding: 0 var(--chip-px-md);
  border-radius: 8px;
}
.c-filter-input:focus-visible,
.c-filter-select select:focus-visible,
.c-filter-range input[type="range"]:focus-visible {
  outline: var(--filter-ring-width) solid var(--filter-border-focus);
  outline-offset: var(--filter-ring-offset);
}
.c-filter-select {
  position: relative;
}
.c-filter-select.is-disabled select,
.c-filter-range.is-disabled input {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Badge (count) */
.c-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.35em;
  border-radius: 9999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.75em;
  line-height: 1;
}
.c-filter-badge.is-zero {
  display: none;
}

/* Reset/Clear button */
.c-filter-reset {
  background: transparent;
  border: 1px solid var(--filter-border);
  color: var(--filter-text);
  height: var(--ctl-h-md);
  padding: 0 var(--chip-px-md);
  border-radius: 8px;
  transition: background var(--motion-fast), border-color var(--motion-fast);
  cursor: pointer;
}
.c-filter-reset:hover {
  background: var(--filter-bg-hover);
}
.c-filter-reset:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* A11y utility */
.u-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===========================
   Filter Panel (fly-out dialog)
   =========================== */

/* Root toggler for mounting/visibility/animation state */
.c-filter-panel-root {
  position: fixed;
  inset: 0;
  pointer-events: none;            /* disabled until open */
  opacity: 0;
  transition: opacity var(--motion-med);
  z-index: 1000;                   /* above app chrome; adjust if needed */
}
.c-filter-panel-root.is-open {
  pointer-events: auto;
  opacity: 1;
}

/* Backdrop */
.c-filter-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.42);
  backdrop-filter: saturate(100%) blur(2px);
  transition: opacity var(--motion-med);
  opacity: 0;
}
.c-filter-panel-root.is-open .c-filter-panel-backdrop {
  opacity: 1;
}

/* Panel container
   Desktop: right-docked sheet (360–420px)
   Mobile (<768px): full screen overlay
*/
.c-filter-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(420px, 90vw);
  background: var(--filter-bg);
  color: var(--filter-text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  border-left: 1px solid var(--filter-border);

  display: grid;
  grid-template-rows: auto 1fr auto;

  transform: translateX(100%);     /* start off-canvas */
  transition: transform var(--motion-med);
}
.c-filter-panel-root.is-open .c-filter-panel {
  transform: translateX(0);
}

/* Head / Body / Foot */
.c-filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--group-gap);
  padding: 16px;
  border-bottom: 1px solid var(--filter-border);
}
.c-filter-panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--filter-text);
}
.c-filter-close {
  background: transparent;
  border: 1px solid var(--filter-border);
  color: var(--filter-text);
  border-radius: 8px;
  height: var(--ctl-h-md);
  padding: 0 var(--chip-px-md);
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.c-filter-close:hover { background: var(--filter-bg-hover); }
.c-filter-close:focus-visible {
  outline: var(--filter-ring-width) solid var(--filter-border-focus);
  outline-offset: var(--filter-ring-offset);
}

.c-filter-panel-body {
  padding: 16px;
  overflow: auto;
  scrollbar-gutter: stable;
  display: grid;
  gap: var(--bar-gap-y);
}

.c-filter-panel-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--group-gap);
  padding: 12px 16px;
  border-top: 1px solid var(--filter-border);
}
.c-filter-apply,
.c-filter-reset {
  height: var(--ctl-h-md);
  padding: 0 var(--chip-px-md);
  border-radius: 8px;
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
  border: 1px solid var(--filter-border);
  background: var(--filter-bg);
  color: var(--filter-text);
}
.c-filter-apply {
  border-color: var(--filter-border-active);
  background: var(--filter-bg-active);
  color: var(--filter-text-active);
}
.c-filter-apply:hover { background: var(--filter-bg-hover); }
.c-filter-reset:hover { background: var(--filter-bg-hover); }
.c-filter-apply:focus-visible,
.c-filter-reset:focus-visible {
  outline: var(--filter-ring-width) solid var(--filter-border-focus);
  outline-offset: var(--filter-ring-offset);
}
.c-filter-apply:disabled,
.c-filter-reset:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Mobile: full-screen take-over */
@media (max-width: 767.98px) {
  .c-filter-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--filter-border);
    transform: translateY(100%);
    right: auto;
    left: 0;
    bottom: 0;
  }
  .c-filter-panel-root.is-open .c-filter-panel {
    transform: translateY(0);
  }
}

/* Reduced motion: avoid large translations */
@media (prefers-reduced-motion: reduce) {
  .c-filter-panel-root,
  .c-filter-panel-backdrop,
  .c-filter-panel {
    transition: none !important;
  }
}

/* Optional: body scroll lock hook (set by JS) */
body[data-lock="scroll"] {
  overflow: hidden;
}

/* Progressive Enhancement rule removed - React-only filtering now */
