/**
 * MarketFox Design Base
 * Apple-style Design System
 * 
 * Правило радиусов: outer r = inner r + padding
 */

:root {
  /* ============================================
   * GRAY SCALE (from design_base contrast ratios)
   * Target contrast ratio from gray-100
   * ============================================ */
  --gray-900: #1d1d1f;  /* 12.80 - Text content */
  --gray-800: #3a3a3c;  /* 8.00  - Text content */
  --gray-700: #48484a;  /* 4.67  - Text content */
  --gray-600: #636366;  /* 3.00  - Placeholder text */
  --gray-500: #8e8e93;  /* 1.92  - Disabled text */
  --gray-400: #aeaeb2;  /* 1.50  */
  --gray-300: #d1d1d6;  /* 1.19  */
  --gray-200: #e5e5e7;  /* 1.10  */
  --gray-100: #f5f5f7;  /* 1.00  - Base background */
  --gray-75: #f7f7f8;   /* 1.04  - Alternate background */
  --gray-50: #fafafa;   /* 1.09  */

  /* ============================================
   * COLORFUL PALETTE (from design_base RGB values)
   * ============================================ */
  --color-danger: #FF3B30;    /* R255 G59 B48 - danger, cancel, delete */
  --color-warning: #FF9500;   /* R255 G149 B0 - warning */
  --color-yellow: #FFCC00;    /* R255 G204 B0 */
  --color-success: #34C759;   /* R52 G199 B89 - success, ok, save */
  --color-cyan: #5AC8FA;      /* R90 G200 B250 */
  --color-primary: #007AFF;   /* R0 G122 B255 - primary, link */
  --color-purple: #5856D6;    /* R88 G86 B214 */
  --color-pink: #FF2D55;      /* R255 G45 B85 */

  /* ============================================
   * LEGACY ALIASES (for backward compatibility)
   * ============================================ */
  --apple-gray-100: var(--gray-100);
  --apple-gray-200: var(--gray-200);
  --apple-gray-300: var(--gray-300);
  --apple-gray-400: var(--gray-400);
  --apple-gray-500: var(--gray-500);
  --apple-gray-600: var(--gray-600);
  --apple-gray-700: var(--gray-700);
  --apple-gray-800: var(--gray-800);
  --apple-gray-900: var(--gray-900);
  --apple-blue: var(--color-primary);
  --apple-green: var(--color-success);
  --apple-red: var(--color-danger);
  --apple-orange: var(--color-warning);
  --apple-glass: rgba(255, 255, 255, 0.1);

  /* ============================================
   * Z-INDEX SCALE
   * ============================================ */
  --z-content: 10;       /* floating elements within content */
  --z-sidebar: 40;       /* sidebar */
  --z-modal: 50;         /* modal overlays */
  --z-modal-above: 60;   /* stacked modals (on top of another modal) */
  --z-toast: 200;        /* alert toasts, notifications */
}

/* ============================================
 * BASE STYLES
 * ============================================ */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--gray-900);
  background-color: var(--gray-50);
}

/* SVG safety net — prevent unsized SVGs from expanding to fill viewport */
svg:not([width]):not([height]):not([class*="w-"]):not([class*="h-"]) {
  max-width: 1.5rem;
  max-height: 1.5rem;
}

/* ============================================
 * SIDEBAR LAYOUT — critical rules to prevent content shift on load
 * Full sidebar styles in /css/sidebar.css
 *
 * Pattern: html.has-sidebar is set synchronously via inline <script>
 * in <head> BEFORE any CSS loads. This ensures padding-left is applied
 * at first paint, preventing layout shift when sidebar.css loads later.
 *
 * body.sidebar-ready is added by sidebar.js after DOM is ready —
 * it enables transitions and reveals .content-card.
 * ============================================ */
/* Mobile: reserve header space immediately (sidebar.css loads async) */
html.has-sidebar body {
  padding-top: 56px;    /* --header-height */
}

@media (min-width: 1024px) {
  /* Immediate padding — prevents layout shift at first paint */
  html.has-sidebar body {
    padding-left: 240px;  /* --sidebar-width */
    padding-top: 56px;    /* --header-height */
  }
  html.has-sidebar.sidebar-collapsed body {
    padding-left: 72px;   /* --sidebar-collapsed-width */
  }

  /* Hide content briefly until sidebar is ready, then reveal */
  html.has-sidebar .content-card {
    opacity: 0;
  }
  html.has-sidebar body.sidebar-ready .content-card {
    opacity: 1;
    transition: opacity 0.15s ease;
  }

  /* Fallback: reveal content after 0.5s even if sidebar.js fails */
  @keyframes content-reveal-fallback {
    to { opacity: 1; }
  }
  html.has-sidebar .content-card {
    animation: content-reveal-fallback 0s 0.5s forwards;
  }
  html.has-sidebar body.sidebar-ready .content-card {
    animation: none;
  }

  /* Smooth padding transitions only after sidebar JS signals ready */
  body.sidebar-ready {
    transition: padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ============================================
 * TYPOGRAPHY (from design_base size/line-height)
 * ============================================ */
.text-large-title { font-size: 34px; line-height: 41px; font-weight: 700; }
.text-title1 { font-size: 28px; line-height: 34px; font-weight: 700; }
.text-title2 { font-size: 22px; line-height: 28px; font-weight: 700; }
.text-title3 { font-size: 20px; line-height: 25px; font-weight: 700; }
.text-headline { font-size: 17px; line-height: 22px; font-weight: 600; }
.text-body { font-size: 17px; line-height: 22px; font-weight: 400; }
.text-body-bold { font-size: 17px; line-height: 22px; font-weight: 700; }
.text-callout { font-size: 16px; line-height: 21px; font-weight: 400; }
.text-callout-bold { font-size: 16px; line-height: 21px; font-weight: 700; }
.text-subheadline { font-size: 15px; line-height: 20px; font-weight: 400; }
.text-subheadline-bold { font-size: 15px; line-height: 20px; font-weight: 700; }
.text-footnote { font-size: 13px; line-height: 18px; font-weight: 400; }
.text-footnote-bold { font-size: 13px; line-height: 18px; font-weight: 700; }
.text-caption1 { font-size: 12px; line-height: 16px; font-weight: 400; }
.text-caption1-bold { font-size: 12px; line-height: 16px; font-weight: 700; }
.text-caption2 { font-size: 11px; line-height: 13px; font-weight: 400; }
.text-caption2-bold { font-size: 11px; line-height: 13px; font-weight: 700; }

/* Page title — unified header for all pages */
.page-title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--gray-800);
}

/* Content area — calm centered layout */
.content-area {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
}

/* ============================================
 * COLOR UTILITIES - Complete System
 * Replaces Tailwind color classes
 * ============================================ */

/* --- GRAY TEXT COLORS --- */
.text-gray-900, .c-gray-900 { color: var(--gray-900); }
.text-gray-800, .c-gray-800 { color: var(--gray-800); }
.text-gray-700, .c-gray-700 { color: var(--gray-700); }
.text-gray-600, .c-gray-600 { color: var(--gray-600); }
.text-gray-500, .c-gray-500 { color: var(--gray-500); }
.text-gray-400, .c-gray-400 { color: var(--gray-400); }
.text-gray-300, .c-gray-300 { color: var(--gray-300); }
.text-gray-200, .c-gray-200 { color: var(--gray-200); }

/* --- SEMANTIC TEXT COLORS --- */
.text-primary, .c-primary { color: var(--color-primary); }
.text-primary-hover { color: #0066d6; }
.text-success, .c-success { color: var(--color-success); }
.text-success-hover { color: #2db84d; }
.text-danger, .c-danger { color: var(--color-danger); }
.text-danger-hover { color: #e6342b; }
.text-warning, .c-warning { color: var(--color-warning); }
.text-warning-hover { color: #e08600; }
.text-purple, .c-purple { color: var(--color-purple); }
.text-cyan, .c-cyan { color: var(--color-cyan); }
.text-pink, .c-pink { color: var(--color-pink); }
.text-yellow { color: var(--color-yellow); }
.text-white { color: #ffffff; }

/* --- GRAY BACKGROUND COLORS --- */
.bg-gray-900 { background-color: var(--gray-900); }
.bg-gray-800 { background-color: var(--gray-800); }
.bg-gray-700 { background-color: var(--gray-700); }
.bg-gray-600 { background-color: var(--gray-600); }
.bg-gray-500 { background-color: var(--gray-500); }
.bg-gray-400 { background-color: var(--gray-400); }
.bg-gray-300 { background-color: var(--gray-300); }
.bg-gray-200 { background-color: var(--gray-200); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-75 { background-color: var(--gray-75); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-white { background-color: #ffffff; }

/* --- SEMANTIC SOLID BACKGROUNDS --- */
.bg-primary { background-color: var(--color-primary) !important; }
.bg-primary-hover { background-color: #0066d6 !important; }
.bg-success { background-color: var(--color-success) !important; }
.bg-success-hover { background-color: #2db84d !important; }
.bg-danger { background-color: var(--color-danger) !important; }
.bg-danger-hover { background-color: #e6342b !important; }
.bg-warning { background-color: var(--color-warning) !important; }
.bg-warning-hover { background-color: #e68600 !important; }
.bg-purple { background-color: var(--color-purple) !important; }
.bg-purple-hover { background-color: #4a48c4 !important; }
.bg-yellow { background-color: var(--color-yellow) !important; }

/* --- SOFT BACKGROUNDS (12% opacity) --- */
.bg-primary-light, .bg-primary-soft { background-color: rgba(0, 122, 255, 0.12); }
.bg-success-light, .bg-success-soft { background-color: rgba(52, 199, 89, 0.12); }
.bg-danger-light, .bg-danger-soft { background-color: rgba(255, 59, 48, 0.12); }
.bg-warning-light, .bg-warning-soft { background-color: rgba(255, 149, 0, 0.12); }
.bg-purple-light, .bg-purple-soft { background-color: rgba(88, 86, 214, 0.12); }
.bg-yellow-light, .bg-yellow-soft { background-color: rgba(255, 204, 0, 0.12); }
.bg-info-light, .bg-info-soft { background-color: rgba(0, 122, 255, 0.10); }
.text-info, .c-info { color: #007AFF; }
.border-info-soft { border-color: rgba(0, 122, 255, 0.20); }
.bg-cyan-light { background-color: rgba(90, 200, 250, 0.12); }
.bg-pink-light { background-color: rgba(255, 45, 85, 0.12); }

/* --- ULTRA SOFT BACKGROUNDS (8% opacity) --- */
.bg-primary-50, .bg-primary-ultra { background-color: rgba(0, 122, 255, 0.08); }
.bg-success-50, .bg-success-ultra { background-color: rgba(52, 199, 89, 0.08); }
.bg-danger-50, .bg-danger-ultra { background-color: rgba(255, 59, 48, 0.08); }
.bg-warning-50, .bg-warning-ultra { background-color: rgba(255, 149, 0, 0.08); }
.bg-purple-50, .bg-purple-ultra { background-color: rgba(88, 86, 214, 0.08); }
.bg-yellow-50 { background-color: rgba(255, 204, 0, 0.08); }

/* --- MEDIUM BACKGROUNDS (20% opacity) --- */
.bg-primary-100 { background-color: rgba(0, 122, 255, 0.12); }
.bg-primary-200 { background-color: rgba(0, 122, 255, 0.2); }
.bg-success-100 { background-color: rgba(52, 199, 89, 0.12); }
.bg-success-200 { background-color: rgba(52, 199, 89, 0.2); }
.bg-danger-100 { background-color: rgba(255, 59, 48, 0.12); }
.bg-danger-200 { background-color: rgba(255, 59, 48, 0.2); }
.bg-warning-100 { background-color: rgba(255, 149, 0, 0.12); }
.bg-warning-200 { background-color: rgba(255, 149, 0, 0.2); }
.bg-purple-100 { background-color: rgba(88, 86, 214, 0.12); }
.bg-purple-200 { background-color: rgba(88, 86, 214, 0.2); }
.bg-yellow-100 { background-color: rgba(255, 204, 0, 0.12); }

/* --- BORDER COLORS --- */
.border-gray-100 { border-color: var(--gray-100); }
.border-gray-200 { border-color: var(--gray-200); }
.border-gray-300 { border-color: var(--gray-300); }
.border-gray-400 { border-color: var(--gray-400); }
.border-primary { border-color: var(--color-primary); }
.border-primary-light { border-color: rgba(0, 122, 255, 0.3); }
.border-primary-200 { border-color: rgba(0, 122, 255, 0.2); }
.border-primary-300 { border-color: rgba(0, 122, 255, 0.3); }
.border-success { border-color: var(--color-success); }
.border-success-light { border-color: rgba(52, 199, 89, 0.3); }
.border-danger { border-color: var(--color-danger); }
.border-danger-light { border-color: rgba(255, 59, 48, 0.3); }
.border-warning { border-color: var(--color-warning); }
.focus\:border-primary:focus { border-color: var(--color-primary); }
.hover-opacity:hover { opacity: 0.8; }

/* Header icon hover */
.header-icon { color: var(--gray-500); }
.header-icon:hover { color: var(--gray-700); background: var(--gray-100); }

/* Close button hover */
.btn-close-icon { color: var(--gray-400); }
.btn-close-icon:hover { color: var(--gray-600); }

/* Text hover to primary */
.hover-primary:hover { color: var(--color-primary); }

/* Delete button hover */
.btn-delete-icon { color: var(--gray-400); }
.btn-delete-icon:hover { color: var(--color-danger); background: rgba(239, 68, 68, 0.06); }

/* Icon wrapper hover bg */
.hover-bg-gray-200:hover { background: var(--gray-200); }
/* Primary tint hover bg */
.hover-bg-primary-ultra:hover { background: rgba(0, 122, 255, 0.06); }

/* Soft borders for alerts */
.border-primary-soft { border-color: rgba(0, 122, 255, 0.3); }
.border-success-soft { border-color: rgba(52, 199, 89, 0.3); }
.border-danger-soft { border-color: rgba(255, 59, 48, 0.3); }
.border-warning-soft { border-color: rgba(255, 149, 0, 0.3); }
.border-purple-soft { border-color: rgba(88, 86, 214, 0.2); }

/* --- HOVER STATES --- */
.hover\:text-gray-600:hover { color: var(--gray-600); }
.hover\:text-gray-700:hover { color: var(--gray-700); }
.hover\:text-gray-900:hover { color: var(--gray-900); }
.hover\:text-primary:hover { color: var(--color-primary); }
.hover\:text-primary-hover:hover { color: #0066d6; }
.hover\:text-danger:hover { color: var(--color-danger); }
.hover\:text-danger-hover:hover { color: #e6342b; }

.hover\:bg-gray-50:hover { background-color: var(--gray-50) !important; }
.hover\:bg-gray-100:hover { background-color: var(--gray-100) !important; }
.hover\:bg-gray-200:hover { background-color: var(--gray-200) !important; }
.hover\:bg-primary:hover { background-color: var(--color-primary) !important; }
.hover\:bg-primary-hover:hover { background-color: #0066d6 !important; }
.hover\:bg-primary-100:hover { background-color: rgba(0, 122, 255, 0.12) !important; }
.hover\:bg-primary-200:hover { background-color: rgba(0, 122, 255, 0.2) !important; }
.hover\:bg-success-hover:hover { background-color: #2db84d !important; }
.hover\:bg-danger-hover:hover { background-color: #e6342b !important; }
.hover\:bg-warning-hover:hover { background-color: #e68600 !important; }
.hover\:bg-danger-50:hover { background-color: rgba(255, 59, 48, 0.06) !important; }

/* --- FOCUS STATES --- */
.focus\:border-primary:focus { border-color: var(--color-primary); }
.focus\:ring-primary:focus { box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3); }

/* --- DISABLED STATES --- */
.disabled\:bg-primary-light:disabled { background-color: rgba(0, 122, 255, 0.4); }
.disabled\:bg-success-light:disabled { background-color: rgba(52, 199, 89, 0.4); }
.disabled\:bg-danger-light:disabled { background-color: rgba(255, 59, 48, 0.4); }
.disabled\:bg-gray-200:disabled { background-color: var(--gray-200); }
.disabled\:c-gray-400:disabled { color: var(--gray-400); }

/* Accent color for inputs (checkboxes, radios) */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-primary);
}

/* ============================================
 * STATUS BADGES
 * ============================================ */
.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  letter-spacing: -0.2px;
}

.status-completed,
.status-success {
  background: rgba(52, 199, 89, 0.12);
  color: var(--color-success);
}

.status-pending {
  background: rgba(255, 149, 0, 0.12);
  color: var(--color-warning);
}

.status-processing {
  background: rgba(0, 122, 255, 0.12);
  color: var(--color-primary);
}

.status-failed,
.status-error {
  background: rgba(255, 59, 48, 0.12);
  color: var(--color-danger);
}

.status-cancelled {
  background: rgba(142, 142, 147, 0.12);
  color: var(--gray-500);
}

.status-info {
  background: rgba(88, 86, 214, 0.12);
  color: var(--color-purple);
}

/* ============================================
 * BUTTONS
 * ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  color: white;
}

.btn-primary {
  background-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: #0066d6;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary:disabled:hover {
  background-color: var(--color-primary);
}

.btn-success {
  background-color: var(--color-success);
}

.btn-success:hover {
  background-color: #2db84d;
}

.btn-success:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  background-color: var(--color-danger);
}

.btn-danger:hover {
  background-color: #e6342b;
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-warning {
  background-color: var(--color-warning);
}

.btn-warning:hover {
  background-color: #e68600;
}

.btn-warning:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background-color: var(--gray-100);
  color: var(--gray-700);
  transition: background-color 0.15s;
}

.btn-secondary:hover {
  background-color: var(--gray-200);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background-color: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  background-color: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-primary);
}

.btn-ghost:hover {
  background-color: rgba(0, 122, 255, 0.08);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Content card — transparent, blocks have own backgrounds */
.content-card {
  background: transparent;
  border-radius: 20px;
  margin: 20px;
  flex: 1;
  overflow-x: hidden;
}

.content-card > * {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1023px) {
  .content-card {
    margin: 0 0 12px 0;
    border-radius: 0;
  }
}

/* Page sidebar layout — unified pattern for inbox, reviews, etc. */
.page-sidebar-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}
.page-sidebar {
  width: 300px;
  min-width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px 0 0 20px;
  min-height: 0;
  overflow: hidden;
}
.page-sidebar-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 0 20px 20px 0;
}
@media (max-width: 1023px) {
  .page-sidebar-layout { flex-direction: column; }
  .page-sidebar {
    width: 100%; min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
  }
  .page-sidebar-main { border-radius: 0; }
}

/* ============================================
 * CARDS
 * ============================================ */
.card {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--color-primary);
}

/* ============================================
 * INPUTS
 * ============================================ */
.input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  background: white;
  transition: all 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.input::placeholder {
  color: var(--gray-600);
}

.input:disabled {
  background-color: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

/* ============================================
 * TOGGLE SWITCH (iOS-style)
 * Standard: 52×32, checked = success green
 * ============================================ */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 32px;
  overflow: hidden;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  border: none;
  z-index: -1;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ============================================
 * MODALS
 * ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-container {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  max-height: 85vh;
  overflow-y: auto;
  width: 90%;
  max-width: 500px;
}

.modal-header {
  padding: 24px 24px 16px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin: 0;
}
.modal-subtitle {
  font-size: 14px;
  color: var(--gray-600);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.modal-body {
  padding: 0 24px;
}

.modal-footer {
  padding: 16px 24px 24px;
}

/* ============================================
 * ANIMATIONS
 * ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html.has-sidebar .content-card {
    opacity: 1 !important;
  }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
}
.skeleton-circle {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 50%;
}

/* ============================================
 * SPINNERS
 * ============================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
}

.spinner-light {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: white;
}

.spinner-dark {
  border-color: var(--gray-200);
  border-top-color: var(--gray-600);
}

.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  opacity: 0.9;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* Spinner inside buttons */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.btn-spinner-dark {
  border-color: var(--gray-200);
  border-top-color: var(--gray-600);
}

/* Button loading state */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading .btn-text {
  visibility: hidden;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.btn-loading.btn-outline::after,
.btn-loading.btn-ghost::after,
.btn-loading.btn-secondary::after {
  border-color: var(--gray-200);
  border-top-color: var(--gray-600);
}

/* ============================================
 * UTILITY CLASSES
 * ============================================ */
/* Scroll lock for modals */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background-color: rgba(0, 122, 255, 0.2);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ============================================
   TAILWIND OVERRIDES - Using CSS Variables
   These override Tailwind's hardcoded colors
   ============================================ */

/* Text Gray Overrides */
.text-gray-900 { color: var(--gray-900) !important; }
.text-gray-800 { color: var(--gray-800) !important; }
.text-gray-700 { color: var(--gray-700) !important; }
.text-gray-600 { color: var(--gray-600) !important; }
.text-gray-500 { color: var(--gray-500) !important; }
.text-gray-400 { color: var(--gray-400) !important; }
.text-gray-300 { color: var(--gray-300) !important; }
.text-gray-200 { color: var(--gray-200) !important; }

/* Background Gray Overrides */
.bg-gray-50 { background-color: var(--gray-50) !important; }
.bg-gray-100 { background-color: var(--gray-100) !important; }
.bg-gray-200 { background-color: var(--gray-200) !important; }
.bg-gray-300 { background-color: var(--gray-300) !important; }
.bg-gray-400 { background-color: var(--gray-400) !important; }
.bg-gray-700 { background-color: var(--gray-700) !important; }

/* Border Gray Overrides */
.border-gray-200 { border-color: var(--gray-200) !important; }
.border-gray-300 { border-color: var(--gray-300) !important; }

/* Blue → Primary Overrides */
.text-blue-600 { color: var(--color-primary) !important; }
.text-blue-700 { color: #0066d6 !important; }
.text-blue-500 { color: var(--color-primary) !important; }
.text-blue-400 { color: rgba(0, 122, 255, 0.7) !important; }
.text-blue-800 { color: #004eb3 !important; }
.text-blue-900 { color: #003d8f !important; }
.bg-blue-50 { background-color: rgba(0, 122, 255, 0.08) !important; }
.bg-blue-100 { background-color: rgba(0, 122, 255, 0.12) !important; }
.bg-blue-200 { background-color: rgba(0, 122, 255, 0.2) !important; }
.bg-blue-300 { background-color: rgba(0, 122, 255, 0.3) !important; }
.bg-blue-500 { background-color: var(--color-primary) !important; }
.bg-blue-600 { background-color: var(--color-primary) !important; }
.bg-blue-700 { background-color: #0066d6 !important; }
.border-blue-200 { border-color: rgba(0, 122, 255, 0.2) !important; }
.border-blue-300 { border-color: rgba(0, 122, 255, 0.3) !important; }
.border-blue-400 { border-color: rgba(0, 122, 255, 0.4) !important; }

/* Red → Danger Overrides */
.text-red-500 { color: var(--color-danger) !important; }
.text-red-600 { color: var(--color-danger) !important; }
.text-red-700 { color: #e6342b !important; }
.text-red-800 { color: #c62b23 !important; }
.bg-red-50 { background-color: rgba(255, 59, 48, 0.08) !important; }
.bg-red-100 { background-color: rgba(255, 59, 48, 0.12) !important; }
.bg-red-200 { background-color: rgba(255, 59, 48, 0.2) !important; }
.bg-red-500 { background-color: var(--color-danger) !important; }
.bg-red-600 { background-color: #e6342b !important; }
.border-red-200 { border-color: rgba(255, 59, 48, 0.2) !important; }
.border-red-300 { border-color: rgba(255, 59, 48, 0.3) !important; }

/* Green → Success Overrides */
.text-green-500 { color: var(--color-success) !important; }
.text-green-600 { color: var(--color-success) !important; }
.text-green-700 { color: #2db84d !important; }
.text-green-800 { color: #26a043 !important; }
.bg-green-50 { background-color: rgba(52, 199, 89, 0.08) !important; }
.bg-green-100 { background-color: rgba(52, 199, 89, 0.12) !important; }
.bg-green-300 { background-color: rgba(52, 199, 89, 0.3) !important; }
.bg-green-600 { background-color: var(--color-success) !important; }
.bg-green-700 { background-color: #2db84d !important; }
.border-green-200 { border-color: rgba(52, 199, 89, 0.2) !important; }
.border-green-300 { border-color: rgba(52, 199, 89, 0.3) !important; }

/* Yellow → Warning Overrides */
.text-yellow-400 { color: var(--color-yellow) !important; }
.text-yellow-600 { color: var(--color-warning) !important; }
.text-yellow-700 { color: #e08600 !important; }
.text-yellow-800 { color: #c77700 !important; }
.bg-yellow-50 { background-color: rgba(255, 149, 0, 0.08) !important; }
.bg-yellow-100 { background-color: rgba(255, 149, 0, 0.12) !important; }
.bg-yellow-500 { background-color: var(--color-warning) !important; }
.bg-yellow-600 { background-color: #e08600 !important; }
.bg-amber-100 { background-color: rgba(255, 149, 0, 0.12) !important; }

/* Purple Overrides */
.text-purple-500 { color: var(--color-purple) !important; }
.text-purple-600 { color: var(--color-purple) !important; }
.bg-purple-100 { background-color: rgba(88, 86, 214, 0.12) !important; }
.bg-purple-500 { background-color: var(--color-purple) !important; }
.bg-purple-600 { background-color: #4f4dc2 !important; }

/* Orange Overrides */
.text-orange-600 { color: var(--color-warning) !important; }
.text-orange-700 { color: #e08600 !important; }

/* Hover State Overrides */
.hover\:bg-gray-50:hover { background-color: var(--gray-50) !important; }
.hover\:bg-gray-100:hover { background-color: var(--gray-100) !important; }
.hover\:bg-gray-200:hover { background-color: var(--gray-200) !important; }
.hover\:text-gray-600:hover { color: var(--gray-600) !important; }
.hover\:text-gray-700:hover { color: var(--gray-700) !important; }
.hover\:text-gray-900:hover { color: var(--gray-900) !important; }
.hover\:bg-blue-600:hover { background-color: #0066d6 !important; }
.hover\:bg-blue-700:hover { background-color: #0055b3 !important; }
.hover\:text-blue-600:hover { color: var(--color-primary) !important; }
.hover\:text-blue-700:hover { color: #0066d6 !important; }
.hover\:bg-red-50:hover { background-color: rgba(255, 59, 48, 0.08) !important; }
.hover\:bg-red-600:hover { background-color: #e6342b !important; }
.hover\:text-red-600:hover { color: var(--color-danger) !important; }
.hover\:text-red-700:hover { color: #e6342b !important; }
.hover\:bg-green-100:hover { background-color: rgba(52, 199, 89, 0.12) !important; }
.hover\:bg-green-700:hover { background-color: #2db84d !important; }
.hover\:text-orange-700:hover { color: #e08600 !important; }
.hover\:underline:hover { text-decoration: underline !important; }

/* Focus State Overrides */
.focus\:border-blue-500:focus { border-color: var(--color-primary) !important; }

/* ============================================
 * LOAD MORE BUTTON
 * ============================================ */
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  background: rgba(0, 122, 255, 0.08);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}
.load-more-btn:hover { background: rgba(0, 122, 255, 0.14); }
.load-more-btn:disabled { opacity: 0.5; pointer-events: none; }

/* ============================================
 * COMMAND PALETTE (Cmd+K)
 * ============================================ */
.cmd-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
  opacity: 0; transition: opacity 0.15s ease;
}
.cmd-overlay.cmd-visible { opacity: 1; }

.cmd-palette {
  width: 560px; max-width: 90vw;
  background: #fff; border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  overflow: hidden;
  transform: scale(0.98) translateY(-8px);
  transition: transform 0.15s ease;
}
.cmd-visible .cmd-palette { transform: scale(1) translateY(0); }

.cmd-search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.cmd-search-icon { color: var(--gray-400); flex-shrink: 0; }
.cmd-input {
  flex: 1; border: none; outline: none;
  font-size: 15px; color: var(--gray-900);
  background: transparent;
}
.cmd-input::placeholder { color: var(--gray-400); }
.cmd-esc {
  font-size: 11px; font-weight: 500; color: var(--gray-400);
  padding: 2px 6px; border-radius: 4px;
  background: var(--gray-100); border: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.cmd-results {
  max-height: 360px; overflow-y: auto;
  padding: 8px;
}
.cmd-result {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: background 0.1s;
  cursor: pointer;
}
.cmd-result:hover, .cmd-result-active { background: var(--gray-100); }
.cmd-icon { color: var(--gray-500); flex-shrink: 0; display: flex; }
.cmd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmd-label { font-size: 14px; font-weight: 500; color: var(--gray-800); }
.cmd-desc { font-size: 12px; color: var(--gray-400); margin-top: 1px; }
.cmd-hint {
  font-size: 11px; color: var(--gray-400);
  opacity: 0; transition: opacity 0.1s;
}
.cmd-result-active .cmd-hint { opacity: 1; }
.cmd-empty {
  padding: 2rem; text-align: center;
  font-size: 14px; color: var(--gray-400);
}

/* ============================================
 * EMPTY STATES (unified)
 * ============================================ */
.empty-state {
  text-align: center; padding: 3rem 1.5rem;
}
.empty-state-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  background: var(--gray-100); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
}
.empty-state-title {
  font-size: 16px; font-weight: 600; color: var(--gray-700);
  margin-bottom: 4px;
}
.empty-state-text {
  font-size: 14px; color: var(--gray-500); margin-bottom: 1rem;
  line-height: 1.5;
}

/* ============================================
 * FILTER TABS (pill-style filter buttons)
 * ============================================ */
.filter-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 10px;
  background: #fff;
  color: var(--gray-500);
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.filter-tab:hover {
  background: var(--gray-50);
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.filter-tab.active {
  background: rgba(0, 122, 255, 0.06);
  color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.1);
}
.filter-tab img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
}
.filter-tab:not(.active) img {
  opacity: 0.55;
  filter: grayscale(40%);
}
.filter-tab.active img {
  opacity: 1;
  filter: none;
}

/* ============================================
 * MARKETPLACE TABS
 * ============================================ */
.mp-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  background: #fff;
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.mp-tab:hover {
  background: var(--gray-50);
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.mp-tab.active {
  background: rgba(0, 122, 255, 0.06);
  color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.1);
}
.mp-tab img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
}
.mp-tab:not(.active) img {
  opacity: 0.55;
  filter: grayscale(40%);
}
.mp-tab.active img {
  opacity: 1;
  filter: none;
}
.mp-tab svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.mp-tab:not(.active) svg {
  opacity: 0.55;
}
.mp-tab.active svg {
  opacity: 1;
}

/* ============================================
 * PERIOD BUTTONS (time range selectors)
 * ============================================ */
.period-btns {
  display: flex;
  gap: 4px;
}
.period-btn {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  background: #fff;
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: all 0.15s;
}
.period-btn:hover {
  border-color: var(--gray-300);
}
.period-btn.active {
  background: rgba(0, 122, 255, 0.06);
  color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 600;
}
.period-btn-sm {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.period-btn-sm:hover {
  background: var(--gray-100);
}
.period-btn-sm.active {
  background: rgba(0, 122, 255, 0.08);
  color: var(--color-primary);
  font-weight: 600;
}

/* ============================================
 * FORM COMPONENTS
 * ============================================ */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 2px;
}
.form-input,
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--gray-900);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus,
.form-select:focus {
  border-color: var(--color-primary);
}
.form-input::placeholder {
  color: var(--gray-500);
}
.form-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
textarea.form-input {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

/* ============================================
 * MODAL FORM FIELDS
 * ============================================ */
.modal-fields {
  display: flex;
  flex-direction: column;
}
.modal-fields .form-field:last-child {
  margin-bottom: 0;
}

/* ============================================
 * ONBOARDING TIP
 * ============================================ */
.onboarding-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 1rem;
  background: rgba(0, 122, 255, 0.04);
  border: 1px solid rgba(0, 122, 255, 0.12);
  border-radius: 10px;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
}
.onboarding-tip-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  margin-top: 1px;
}
.onboarding-tip-close {
  flex-shrink: 0;
  padding: 2px;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  margin-left: auto;
  transition: color 0.15s;
}
.onboarding-tip-close:hover { color: var(--gray-600); }

/* ============================================
 * VARIABLES PANEL (shared for editors)
 * ============================================ */
.variables-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--gray-50);
  border-radius: 10px;
  margin-top: 6px;
}
.variable-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: rgba(0, 122, 255, 0.08);
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
  color: var(--color-primary);
  cursor: pointer;
  transition: background 0.15s;
  border: none;
}
.variable-chip:hover { background: rgba(0, 122, 255, 0.15); }

/* ============================================
 * INLINE EDITOR (shared for card editing)
 * ============================================ */
.inline-editor {
  margin-top: 10px;
  animation: fadeSlideIn 0.2s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.inline-editor textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 13px;
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.15s;
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  background: var(--gray-50);
}
.inline-editor textarea:focus { border-color: var(--color-primary); background: #fff; }
.inline-editor-name {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 8px;
}
.inline-editor-name:focus { border-color: var(--color-primary); }
.inline-editor-desc {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 13px;
  color: var(--gray-700);
  outline: none;
  transition: border-color 0.15s;
  margin-top: 8px;
}
.inline-editor-desc:focus { border-color: var(--color-primary); }
.inline-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.inline-editor-actions .btn-save {
  padding: 7px 18px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.inline-editor-actions .btn-save:hover { opacity: 0.9; }
.inline-editor-actions .btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
.inline-editor-actions .btn-cancel-inline {
  padding: 7px 14px;
  background: var(--gray-100);
  color: var(--gray-700);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.inline-editor-actions .btn-cancel-inline:hover { background: var(--gray-200); }

/* ============================================
 * PREVIEW PANEL
 * ============================================ */
.preview-panel {
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-700);
  white-space: pre-line;
  min-height: 40px;
  margin-top: 6px;
}
.preview-panel .var-highlight {
  background: rgba(0, 122, 255, 0.1);
  color: var(--color-primary);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 500;
}

/* ============================================
 * EDITOR BUTTONS (shared for inline card editors)
 * ============================================ */
.editor-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding-top: 0.5rem;
}
.editor-buttons .btn-secondary,
.editor-buttons .btn-primary {
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  width: 100%;
  text-align: center;
}

/* ============================================
 * SEARCH INPUT (shared search bar)
 * ============================================ */
.search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.15s;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
}
.search-input:focus { border-color: var(--color-primary); }

/* ============================================
 * UTILITY
 * ============================================ */
.hidden {
  display: none !important;
}

/* ============================================
 * MOBILE RESPONSIVE (640px breakpoint)
 * ============================================ */
@media (max-width: 640px) {
  /* Page titles */
  .page-title { font-size: 20px; }

  /* Actions row */
  .list-item-actions { gap: 6px; }
  .list-item-actions .action-btn { width: 36px; height: 36px; padding: 6px; }
  .list-item-actions .action-btn svg { width: 18px; height: 18px; }

  /* Filter tabs */
  .filter-tab { padding: 6px 12px; font-size: 12px; }

  /* Modals */
  .modal-content { width: 95%; border-radius: 16px; }
  .modal-header { padding: 20px 20px 12px; }
  .modal-body { padding: 0 20px; }
  .modal-footer { padding: 12px 20px 20px; }
  .modal-title { font-size: 16px; }

  /* Section cards */
  .section-card { border-radius: 12px; }

  /* Switch */
  .switch { transform: scale(0.9); }

  /* Search */
  .search-input { font-size: 14px; }
}
