/* ================================================================
   DESIGN SYSTEM INTERNO — RESORTS.COM.BR v1.0  (seção 15, verbatim)
   Copiado de ~/projects/sistema-visual-resorts/design-system-interno/
   design-system-interno-resorts.md §15. NÃO reescrever tokens aqui —
   ao precisar de novo token, copiar da fonte e versionar lá.
   Componentes consomem SÓ a Camada 2 (semantic). Tema via [data-theme].
   ================================================================ */

/* ---------------- CAMADA 1 — PRIMITIVES ---------------- */
:root {
  /* Brand */
  --blue-900: #093A75;
  --blue-700: #095898;
  --blue-600: #0B6BB8;
  --blue-500: #2B7FC7;
  --blue-300: #7FB3E0;
  --blue-50:  #EFF6FC;
  --gold-500: #EFB93C;
  --gold-300: #F5D483;
  --gold-50:  #FDF7E8;
  --wine-600: #8B2942;
  --wine-50:  #FBEEF1;

  /* Neutros */
  --stone-950: #0A1929;
  --stone-900: #122238;
  --stone-800: #1E2E44;
  --stone-700: #2D3E55;
  --stone-600: #4A5A70;
  --stone-500: #6B7B91;
  --stone-400: #9AA5B5;
  --stone-300: #C5CCD6;
  --stone-200: #E1E5EB;
  --stone-100: #EEF0F3;
  --stone-50:  #F7F5F2;
  --stone-25:  #FAFAF9;
  --white:     #FFFFFF;

  /* Status */
  --green-600: #16A34A;
  --green-50:  #ECFDF5;
  --amber-600: #D97706;
  --amber-50:  #FFFBEB;
  --red-600:   #DC2626;
  --red-50:    #FEF2F2;
  --blue-info-600: #2563EB;
  --blue-info-50:  #EFF6FF;

  /* Domain — Lead temperature */
  --hot-600:  #EA580C;
  --hot-50:   #FFF7ED;
  --warm-600: #D97706;
  --warm-50:  #FFFBEB;
  --cold-600: #64748B;
  --cold-50:  #F1F5F9;

  /* ---------------- DIMENSIONAL (não muda entre temas) ---------------- */

  /* Fontes */
  --font-sans: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;

  /* Tamanhos de fonte */
  --text-2xs: 11px;
  --text-xs:  12px;
  --text-sm:  13px;
  --text-base: 14px;
  --text-lg:  16px;
  --text-xl:  19px;
  --text-2xl: 24px;
  --text-3xl: 30px;

  /* Pesos */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;

  /* Line-height */
  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.5;

  /* Tracking */
  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.08em;

  /* Spacing */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-none: 0;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-full: 9999px;

  /* Shadow base (valores, aplicados via semantic) */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04), 0 1px 3px 0 rgb(0 0 0 / 0.06);
  --shadow-md: 0 2px 4px -1px rgb(0 0 0 / 0.06), 0 4px 6px -1px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Z-index */
  --z-base:     0;
  --z-dropdown: 1000;
  --z-sticky:   1100;
  --z-overlay:  1200;
  --z-modal:    1300;
  --z-popover:  1400;
  --z-tooltip:  1500;
  --z-toast:    1600;

  /* Motion */
  --duration-fast:   120ms;
  --duration-base:   180ms;
  --duration-slow:   250ms;
  --easing-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --easing-ease-in:  cubic-bezier(0.7, 0, 0.84, 0);
}

/* ---------------- CAMADA 2 — SEMANTIC — LIGHT ---------------- */
[data-theme="light"] {
  --surface-base:     var(--stone-25);
  --surface-raised:   var(--white);
  --surface-sunken:   var(--stone-100);
  --surface-overlay:  var(--white);
  --surface-hover:    var(--stone-100);
  --surface-selected: var(--blue-50);
  --surface-disabled: var(--stone-100);
  --surface-accent:   var(--stone-50);

  --text-primary:   var(--stone-950);
  --text-secondary: var(--stone-600);
  --text-tertiary:  var(--stone-500);
  --text-disabled:  var(--stone-400);
  --text-inverse:   var(--white);
  --text-link:      var(--blue-700);
  --text-on-brand:  var(--white);

  --border-subtle:   var(--stone-200);
  --border-default:  var(--stone-300);
  --border-strong:   var(--stone-600);
  --border-focus:    var(--blue-500);
  --border-disabled: var(--stone-200);

  --action-primary-bg:        var(--blue-700);
  --action-primary-bg-hover:  var(--blue-900);
  --action-primary-bg-active: #06427A;
  --action-primary-text:      var(--white);

  --action-secondary-bg:        transparent;
  --action-secondary-bg-hover:  var(--stone-100);
  --action-secondary-bg-active: var(--stone-200);
  --action-secondary-text:      var(--stone-900);
  --action-secondary-border:    var(--stone-300);

  --action-tertiary-text:       var(--stone-700);
  --action-tertiary-bg-hover:   var(--stone-200);
  --action-tertiary-bg-active:  var(--stone-300);

  --action-destructive-bg:        var(--red-600);
  --action-destructive-bg-hover:  #B91C1C;
  --action-destructive-bg-active: #991B1B;
  --action-destructive-text:      var(--white);

  --action-disabled-bg:   var(--stone-100);
  --action-disabled-text: var(--stone-400);

  --status-info-bg:        var(--blue-info-50);
  --status-info-fg:        var(--blue-info-600);
  --status-info-border:    #BFDBFE;
  --status-success-bg:     var(--green-50);
  --status-success-fg:     var(--green-600);
  --status-success-border: #A7F3D0;
  --status-warning-bg:     var(--amber-50);
  --status-warning-fg:     var(--amber-600);
  --status-warning-border: #FDE68A;
  --status-danger-bg:      var(--red-50);
  --status-danger-fg:      var(--red-600);
  --status-danger-border:  #FECACA;

  --lead-hot-bg:   var(--hot-50);
  --lead-hot-fg:   var(--hot-600);
  --lead-warm-bg:  var(--warm-50);
  --lead-warm-fg:  var(--warm-600);
  --lead-cold-bg:  var(--cold-50);
  --lead-cold-fg:  var(--cold-600);

  --sla-ontime-fg:   var(--green-600);
  --sla-warning-fg:  var(--amber-600);
  --sla-breached-fg: var(--wine-600);

  --priority-urgent-fg: var(--stone-950);
  --priority-high-fg:   var(--stone-700);

  --focus-ring:   var(--blue-500);
  --selection-bg: var(--blue-50);

  --brand-deep:   var(--blue-900);
  --brand-accent: var(--gold-500);

  --skeleton-bg:      var(--stone-200);
  --skeleton-shimmer: var(--stone-100);

  --shadow-card:  var(--shadow-sm);
  --shadow-modal: var(--shadow-lg);

  --overlay-bg: rgba(10, 25, 41, 0.4);

  --chart-positive: var(--green-600);
  --chart-negative: var(--red-600);
  --chart-neutral:  var(--stone-500);
  --chart-grid:     var(--stone-200);
  --chart-axis:     var(--stone-400);
}

/* ---------------- CAMADA 2 — SEMANTIC — DARK ---------------- */
[data-theme="dark"] {
  --surface-base:     var(--stone-950);
  --surface-raised:   var(--stone-900);
  --surface-sunken:   #050E1A;
  --surface-overlay:  var(--stone-800);
  --surface-hover:    var(--stone-800);
  --surface-selected: #1A2E4A;
  --surface-disabled: var(--stone-900);
  --surface-accent:   var(--stone-800);

  --text-primary:   #E6EDF3;
  --text-secondary: var(--stone-300);
  --text-tertiary:  var(--stone-400);
  --text-disabled:  var(--stone-600);
  --text-inverse:   var(--stone-950);
  --text-link:      var(--blue-300);
  --text-on-brand:  var(--white);

  --border-subtle:   var(--stone-800);
  --border-default:  var(--stone-700);
  --border-strong:   var(--stone-500);
  --border-focus:    var(--blue-300);
  --border-disabled: var(--stone-800);

  --action-primary-bg:        var(--blue-600);
  --action-primary-bg-hover:  var(--blue-500);
  --action-primary-bg-active: var(--blue-700);
  --action-primary-text:      var(--white);

  --action-secondary-bg:        transparent;
  --action-secondary-bg-hover:  var(--stone-800);
  --action-secondary-bg-active: var(--stone-700);
  --action-secondary-text:      #E6EDF3;
  --action-secondary-border:    var(--stone-700);

  --action-tertiary-text:       var(--stone-300);
  --action-tertiary-bg-hover:   var(--stone-700);
  --action-tertiary-bg-active:  var(--stone-600);

  --action-destructive-bg:        #EF4444;
  --action-destructive-bg-hover:  var(--red-600);
  --action-destructive-bg-active: #B91C1C;
  --action-destructive-text:      var(--white);

  --action-disabled-bg:   var(--stone-800);
  --action-disabled-text: var(--stone-600);

  --status-info-bg:        #0C2340;
  --status-info-fg:        #60A5FA;
  --status-info-border:    #1E3A5F;
  --status-success-bg:     #052E1A;
  --status-success-fg:     #4ADE80;
  --status-success-border: #0F3D28;
  --status-warning-bg:     #3A2708;
  --status-warning-fg:     #FBBF24;
  --status-warning-border: #553A0E;
  --status-danger-bg:      #3B0F12;
  --status-danger-fg:      #FCA5A5;
  --status-danger-border:  #5A1A1F;

  --lead-hot-bg:   #3A1A08;
  --lead-hot-fg:   #FB923C;
  --lead-warm-bg:  #3A2708;
  --lead-warm-fg:  #FBBF24;
  --lead-cold-bg:  var(--stone-800);
  --lead-cold-fg:  var(--stone-400);

  --sla-ontime-fg:   #4ADE80;
  --sla-warning-fg:  #FBBF24;
  --sla-breached-fg: #F4A8B4;

  --priority-urgent-fg: #E6EDF3;
  --priority-high-fg:   var(--stone-300);

  --focus-ring:   var(--blue-300);
  --selection-bg: #1A2E4A;

  --brand-deep:   #050E1A;
  --brand-accent: var(--gold-300);

  --skeleton-bg:      var(--stone-800);
  --skeleton-shimmer: var(--stone-700);

  --shadow-card:  none;
  --shadow-modal: 0 10px 25px -5px rgb(0 0 0 / 0.5);

  --overlay-bg: rgba(0, 0, 0, 0.6);

  --chart-positive: #4ADE80;
  --chart-negative: #F87171;
  --chart-neutral:  var(--stone-400);
  --chart-grid:     var(--stone-800);
  --chart-axis:     var(--stone-600);
}

/* ---------------- DENSIDADE ---------------- */
.density-compact {
  --d-row-padding-y: 6px;
  --d-row-padding-x: 12px;
  --d-card-padding:  12px;
  --d-gap:           8px;
  --d-badge-padding: 2px 6px;
  --d-font-size:     13px;
}

.density-default {
  --d-row-padding-y: 10px;
  --d-row-padding-x: 16px;
  --d-card-padding:  16px;
  --d-gap:           12px;
  --d-badge-padding: 3px 8px;
  --d-font-size:     14px;
}

.density-comfortable {
  --d-row-padding-y: 14px;
  --d-row-padding-x: 20px;
  --d-card-padding:  20px;
  --d-gap:           16px;
  --d-badge-padding: 4px 10px;
  --d-font-size:     14px;
}

/* ---------------- BASE ---------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-sans);
  font-size: var(--text-base);
}

body {
  background: var(--surface-base);
  color: var(--text-primary);
  line-height: var(--leading-normal);
  font-feature-settings: "cv11", "ss01";
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- MOTION ---------------- */
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- FOCUS VISIBLE GLOBAL ---------------- */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
