/* Tokens do CRM Folli — copiados 1:1 do painel exemplo (referencias/painel-exemplo.html),
   que segue a marca Pilares (referencias/marca-pilares.png). Mudar visual = mudar aqui. */

/* Folli — color tokens. Base palette from the "Pilares" brand direction:
   Esmeralda #0F5A43 · Floresta #04160F · Creme #F2EBDD · Latão #C8A464 · Pedra #8FA399
   Usage ratio (brand): Floresta 48 · Esmeralda 30 · Creme 12 · Latão 6 · Pedra 4 */
:root{
  /* Brand core */
  --folli-esmeralda:#0F5A43;
  --folli-floresta:#04160F;
  --folli-creme:#F2EBDD;
  --folli-latao:#C8A464;
  --folli-pedra:#8FA399;

  /* Forest ramp (dark neutrals, green-tinted) */
  --forest-1000:#020E09;
  --forest-950:#04160F;
  --forest-925:#061C14;
  --forest-900:#082A20;
  --forest-850:#0A2219;
  --forest-800:#0D281E;
  --forest-750:#11352A;
  --forest-700:#163D30;
  --forest-650:#1E4A3B;
  --forest-600:#2F5A4B;

  /* Emerald ramp */
  --emerald-900:#083527;
  --emerald-800:#0B4535;
  --emerald-700:#0F5A43;
  --emerald-600:#14705A;
  --emerald-500:#1C8A6B;
  --emerald-400:#3FA886;
  --emerald-300:#7CC7AB;
  --emerald-200:#A9C7BA;
  --emerald-100:#D6E7DF;

  /* Stone ramp (Pedra — muted greys) */
  --stone-100:#E4EAE6;
  --stone-200:#C4CFC7;
  --stone-300:#A9B8AF;
  --stone-400:#8FA399;
  --stone-500:#5F7A6E;
  --stone-600:#45604F;

  /* Cream ramp */
  --cream-0:#FFFDF8;
  --cream-50:#FAF6EE;
  --cream-100:#F2EBDD;
  --cream-200:#E7DDC9;
  --cream-300:#D8CBB2;
  --cream-400:#BFAF91;

  /* Brass ramp (Latão — highlights only) */
  --brass-200:#E8D5AE;
  --brass-300:#DCC08A;
  --brass-400:#C8A464;
  --brass-500:#B08A47;
  --brass-600:#8C6A2E;

  /* Status hues (tuned to sit next to forest + cream) */
  --green-400:#5FC79A;
  --green-600:#1F7A55;
  --amber-400:#E2B04A;
  --amber-600:#8F6410;
  --red-400:#E8735C;
  --red-600:#B23A26;
  --blue-400:#73B1D6;
  --blue-600:#1F5F86;

  /* ---------- Semantic — DARK (default) ---------- */
  --bg-app:var(--forest-950);
  --bg-sidebar:#03120C;
  --bg-glow:rgba(15,90,67,.55);
  --surface-1:#071E16;          /* cards */
  --surface-2:#0A271D;          /* inner tiles, inputs */
  --surface-3:#0E3125;          /* hover, selected row */
  --surface-inverse:var(--cream-100);
  --surface-brand:var(--emerald-700);
  --surface-overlay:rgba(2,14,9,.72);

  --border-subtle:#0F2E23;
  --border-default:var(--forest-700);
  --border-strong:var(--forest-650);
  --border-focus:var(--brass-400);

  --text-1:var(--cream-100);    /* primary */
  --text-2:var(--stone-200);    /* secondary */
  --text-3:var(--stone-400);    /* muted, labels */
  --text-4:var(--stone-500);    /* placeholder, disabled */
  --text-inverse:var(--forest-950);
  --text-on-brand:var(--cream-100);
  --text-accent:var(--brass-400);
  --text-link:var(--brass-300);

  --action-primary-bg:var(--cream-100);
  --action-primary-bg-hover:#FFFFFF;
  --action-primary-fg:var(--forest-950);
  --action-brand-bg:var(--emerald-700);
  --action-brand-bg-hover:var(--emerald-600);
  --action-brand-fg:var(--cream-100);
  --action-secondary-bg:var(--surface-2);
  --action-secondary-bg-hover:var(--surface-3);
  --action-secondary-fg:var(--text-1);

  --accent:var(--brass-400);
  --accent-soft:rgba(200,164,100,.14);

  --success:var(--green-400);
  --success-soft:rgba(95,199,154,.12);
  --warning:var(--amber-400);
  --warning-soft:rgba(226,176,74,.13);
  --danger:var(--red-400);
  --danger-soft:rgba(232,115,92,.13);
  --info:var(--blue-400);
  --info-soft:rgba(115,177,214,.13);
  --neutral:var(--stone-300);
  --neutral-soft:rgba(169,184,175,.12);

  --chart-1:var(--brass-400);
  --chart-2:var(--emerald-400);
  --chart-3:var(--cream-200);
  --chart-4:var(--blue-400);
  --chart-5:var(--stone-500);
  --chart-grid:rgba(143,163,153,.12);
  --spark-line:var(--emerald-300);
  --progress-from:var(--emerald-500);
  --progress-to:var(--emerald-300);
  --brand-tone:var(--emerald-300);
  --brand-tone-soft:rgba(15,90,67,.45);
  --chart-area-top:rgba(124,199,171,.32);
  --chart-area-bottom:rgba(124,199,171,0);

  --control-on:var(--emerald-500);
  --logo-symbol:var(--brass-400);
  --logo-word:var(--cream-100);
  --control-checked-bg:var(--cream-100);
  --control-checked-fg:var(--forest-950);
  --scrim:rgba(2,14,9,.6);
  color-scheme:dark;
}

/* ---------- Semantic — LIGHT (cream) ---------- */
[data-theme="light"]{
  --bg-app:var(--cream-50);
  --bg-sidebar:var(--cream-100);
  --bg-glow:rgba(200,164,100,.22);
  --surface-1:var(--cream-0);
  --surface-2:#F6F1E6;
  --surface-3:#EEE6D5;
  --surface-inverse:var(--forest-950);
  --surface-brand:var(--emerald-700);
  --surface-overlay:rgba(250,246,238,.8);

  --border-subtle:#EFE7D7;
  --border-default:#E3D8C3;
  --border-strong:var(--cream-300);
  --border-focus:var(--emerald-700);

  --text-1:var(--forest-950);
  --text-2:var(--forest-600);
  --text-3:var(--stone-500);
  --text-4:var(--stone-400);
  --text-inverse:var(--cream-100);
  --text-accent:var(--brass-600);
  --text-link:var(--emerald-700);

  --action-primary-bg:var(--forest-950);
  --action-primary-bg-hover:var(--forest-900);
  --action-primary-fg:var(--cream-100);
  --action-secondary-bg:var(--cream-0);
  --action-secondary-bg-hover:var(--surface-3);

  --accent:var(--brass-500);
  --accent-soft:rgba(176,138,71,.14);

  --success:var(--green-600);
  --success-soft:rgba(31,122,85,.1);
  --warning:var(--amber-600);
  --warning-soft:rgba(226,176,74,.18);
  --danger:var(--red-600);
  --danger-soft:rgba(178,58,38,.09);
  --info:var(--blue-600);
  --info-soft:rgba(31,95,134,.09);
  --neutral:var(--stone-500);
  --neutral-soft:rgba(95,122,110,.1);

  --chart-1:var(--brass-500);
  --chart-2:var(--emerald-700);
  --chart-3:var(--forest-950);
  --chart-4:var(--blue-600);
  --chart-5:var(--cream-400);
  --chart-grid:rgba(95,122,110,.14);
  --spark-line:var(--emerald-700);
  --progress-from:var(--emerald-700);
  --progress-to:var(--emerald-500);
  --brand-tone:var(--emerald-700);
  --brand-tone-soft:rgba(15,90,67,.1);
  --chart-area-top:rgba(15,90,67,.2);
  --chart-area-bottom:rgba(15,90,67,0);

  --control-on:var(--emerald-700);
  --logo-symbol:var(--emerald-700);
  --logo-word:var(--emerald-700);
  --control-checked-bg:var(--emerald-700);
  --control-checked-fg:var(--cream-100);
  --scrim:rgba(4,22,15,.35);
  color-scheme:light;
}

/* Folli — typography. Young Serif for titles and hero numbers, Instrument Sans for UI and body,
   Geist Mono for eyebrows, codes and timestamps. */
:root{
  --font-display:'Young Serif',Georgia,'Times New Roman',serif;
  --font-sans:'Instrument Sans',ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'Geist Mono',ui-monospace,'SFMono-Regular',Menlo,monospace;

  --weight-regular:400;
  --weight-medium:500;
  --weight-semibold:600;
  --weight-bold:700;

  /* Display (Young Serif, 400 only) */
  --type-display-xl:400 48px/1 var(--font-display);
  --type-display-l:400 38px/1.03 var(--font-display);
  --type-display-m:400 28px/1.1 var(--font-display);
  --type-display-s:400 22px/1.15 var(--font-display);
  --type-kpi:400 34px/1 var(--font-display);
  --type-kpi-s:400 26px/1 var(--font-display);
  --tracking-display:-.02em;
  --tracking-kpi:-.03em;

  /* UI / body (Instrument Sans) */
  --type-heading:600 16px/1.3 var(--font-sans);
  --type-subheading:600 14px/1.35 var(--font-sans);
  --type-body-l:400 15px/1.55 var(--font-sans);
  --type-body:400 14px/1.5 var(--font-sans);
  --type-body-s:400 13px/1.45 var(--font-sans);
  --type-caption:400 12px/1.4 var(--font-sans);
  --type-micro:500 11px/1.3 var(--font-sans);
  --type-button:600 14px/1 var(--font-sans);
  --type-button-s:600 13px/1 var(--font-sans);

  /* Labels */
  --type-eyebrow:500 11px/1 var(--font-mono);       /* uppercase, .12em */
  --tracking-eyebrow:.12em;
  --type-label-caps:600 11px/1 var(--font-sans);    /* uppercase, .22em — brand "Rótulo" */
  --tracking-label-caps:.22em;
  --type-mono:500 12px/1.4 var(--font-mono);

  /* Semantic aliases */
  --text-page-title:var(--type-display-m);
  --text-card-title:var(--type-heading);
  --text-body:var(--type-body);
  --text-table:var(--type-body-s);
}

/* Folli — spacing, radii, sizing, layout. 4px base. */
:root{
  --space-0:0;
  --space-0-5:2px;
  --space-1:4px;
  --space-1-5:6px;
  --space-2:8px;
  --space-2-5:10px;
  --space-3:12px;
  --space-4:16px;
  --space-5:20px;
  --space-6:24px;
  --space-7:28px;
  --space-8:32px;
  --space-10:40px;
  --space-12:48px;
  --space-16:64px;

  --radius-xs:6px;
  --radius-sm:8px;
  --radius-md:10px;      /* buttons, inputs */
  --radius-lg:12px;      /* inner tiles, brand fichas */
  --radius-xl:16px;      /* cards */
  --radius-2xl:20px;     /* sheets, dialogs */
  --radius-pill:999px;

  --control-h-s:32px;
  --control-h-m:40px;
  --control-h-l:48px;
  --hit-min:44px;        /* mobile touch target */
  --icon-s:16px;
  --icon-m:18px;
  --icon-l:20px;

  /* Layout */
  --sidebar-w:248px;
  --sidebar-w-collapsed:72px;
  --topbar-h:68px;
  --bottombar-h:64px;
  --content-max:1440px;
  --gutter-desktop:28px;
  --gutter-tablet:20px;
  --gutter-mobile:16px;
  --card-pad:20px;
  --card-pad-mobile:16px;
  --grid-gap:16px;
}

/* Folli — elevation, borders, motion, blur, z-index. */
:root{
  --border-w:1px; /* @kind other */
  --highlight-inset:inset 0 1px 0 rgba(242,235,221,.045);

  --shadow-0:none;
  --shadow-1:var(--highlight-inset),0 1px 2px rgba(0,0,0,.28);
  --shadow-2:var(--highlight-inset),0 8px 24px -8px rgba(0,0,0,.5);
  --shadow-3:var(--highlight-inset),0 24px 56px -12px rgba(0,0,0,.65);
  --shadow-focus:0 0 0 3px rgba(200,164,100,.32);

  --glow-card:linear-gradient(160deg,rgba(242,235,221,.035) 0%,rgba(242,235,221,0) 40%); /* @kind other */
  --glow-kpi:radial-gradient(120% 90% at 100% 100%,rgba(15,90,67,.55) 0%,rgba(15,90,67,0) 60%); /* @kind other */
  --glow-app:radial-gradient(60% 420px at 62% -120px,var(--bg-glow) 0%,transparent 70%); /* @kind other */

  --blur-glass:saturate(140%) blur(16px); /* @kind other */

  --ease-out:cubic-bezier(.2,.8,.2,1); /* @kind other */
  --ease-in-out:cubic-bezier(.65,0,.35,1); /* @kind other */
  --ease-spring:cubic-bezier(.34,1.4,.64,1); /* @kind other */
  --dur-fast:120ms; /* @kind other */
  --dur-base:180ms; /* @kind other */
  --dur-slow:260ms; /* @kind other */
  --dur-sheet:360ms; /* @kind other */

  --z-sticky:10; /* @kind other */
  --z-sidebar:30; /* @kind other */
  --z-dropdown:40; /* @kind other */
  --z-overlay:50; /* @kind other */
  --z-dialog:60; /* @kind other */
  --z-toast:70; /* @kind other */
  --z-tooltip:80; /* @kind other */
}
[data-theme="light"]{
  --highlight-inset:inset 0 1px 0 rgba(255,255,255,.7);
  --shadow-1:0 1px 2px rgba(4,22,15,.05),0 2px 8px rgba(4,22,15,.04);
  --shadow-2:0 2px 4px rgba(4,22,15,.05),0 12px 28px -10px rgba(4,22,15,.14);
  --shadow-3:0 4px 8px rgba(4,22,15,.06),0 28px 56px -16px rgba(4,22,15,.22);
  --shadow-focus:0 0 0 3px rgba(15,90,67,.22);
  --glow-card:none; /* @kind other */
  --glow-kpi:radial-gradient(120% 90% at 100% 100%,rgba(200,164,100,.16) 0%,rgba(200,164,100,0) 60%); /* @kind other */
}

