/* =========================================================
   Navnira WhatsApp dashboard: design tokens
   One token set, two themes. Components must only use these.
   ========================================================= */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* ---- Type ---- */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --text-xs: 12px;   --lh-xs: 16px;    /* captions, meta */
  --text-sm: 13px;   --lh-sm: 18px;    /* secondary labels */
  --text-md: 14px;   --lh-md: 20px;    /* dense UI body (inbox, tables) */
  --text-base: 15px; --lh-base: 22px;  /* roomy pages body */
  --text-lg: 17px;   --lh-lg: 24px;    /* section titles */
  --text-xl: 20px;   --lh-xl: 28px;    /* panel titles */
  --text-2xl: 26px;  --lh-2xl: 32px;   /* page titles */
  --text-3xl: 32px;  --lh-3xl: 38px;   /* key numbers */
  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 680;
  --tracking-tight: -0.018em; --tracking-title: -0.024em;

  /* ---- Space (4px base) ---- */
  --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 (by hierarchy, not one-size-fits-all) ---- */
  --radius-xs: 4px;   /* tags, checkboxes */
  --radius-sm: 6px;   /* buttons, inputs */
  --radius-md: 10px;  /* panels, popovers, message bubbles */
  --radius-lg: 16px;  /* device previews */
  --radius-pill: 999px;

  /* ---- Control sizes ---- */
  --control-sm: 32px; --control-md: 40px; --control-lg: 48px;
  --row-dense: 44px;  --row-roomy: 56px;

  /* ---- Layout ---- */
  --sidebar-w: 240px; --list-w: 328px; --context-w: 288px; --page-max: 1120px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(.2,.7,.2,1); --dur: 140ms;
}

/* ---------------- LIGHT ---------------- */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg:            #F6F5F2;  /* app canvas (warm paper) */
  --surface:       #FFFFFF;  /* panels, tables */
  --surface-2:     #F0EFEB;  /* hover, subtle fills */
  --surface-3:     #E6E4DF;  /* active / pressed */
  --sidebar:       #EFEEEA;
  --border:        #E2E0DA;
  --border-strong: #CBC8C0;
  --text:          #16161A;  /* 17.6:1 on white */
  --text-2:        #4E4E56;  /* 8.4:1 */
  --text-3:        #6E6E76;  /* 5.1:1 */
  --text-on-solid: #FFFFFF;

  --accent:        #0D6B70;  /* PINE (chosen): primary actions, links, selection */
  --accent-hover:  #0A585C;
  --accent-text:   #0B6469;
  --accent-tint:   #E3F0EF;
  --accent-border: #B3D6D5;

  --success:       #157A47;  --success-tint: #E5F3EB;  --success-border: #B9DEC8;
  --warning:       #9A5800;  --warning-tint: #FCF1DE;  --warning-border: #F0D3A0;  --warning-solid: #E39A1F;
  --danger:        #BE2E1F;  --danger-tint:  #FBEAE7;  --danger-border:  #F1C3BC;
  --neutral-tint:  #EEEDE9;

  --bubble-in:     #FFFFFF;
  --bubble-out:    #ECE7DD;  /* warm sand: stays distinct from pine selection + WhatsApp green */
  --thread-bg:     #F6F5F2;
  --wa-chat-bg:    #EFE9E0;  /* phone preview only */
  --wa-header:     #1F5C4B;

  --av-sand-bg:#ECE1D1; --av-sand-fg:#6B4E2A; --av-sky-bg:#DCE6EF; --av-sky-fg:#2C4A63;
  --av-olive-bg:#E4E8D6; --av-olive-fg:#4C5A26; --av-rose-bg:#EEDDE3; --av-rose-fg:#6A3448;
  --av-slate-bg:#E0E0E9; --av-slate-fg:#40405A;
  --focus:         0 0 0 3px rgba(13,107,112,.28);
  --shadow-pop:    0 1px 2px rgba(22,22,26,.06), 0 8px 24px rgba(22,22,26,.08);
  --shadow-device: 0 2px 6px rgba(22,22,26,.08), 0 24px 48px rgba(22,22,26,.10);
}

/* ---------------- DARK ---------------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #111113;
  --surface:       #17171A;
  --surface-2:     #1F1F23;
  --surface-3:     #2A2A2F;
  --sidebar:       #0D0D0F;
  --border:        #2A2A30;
  --border-strong: #3C3C44;
  --text:          #EDEDEF;
  --text-2:        #B0B0B8;
  --text-3:        #8B8B94;
  --text-on-solid: #FFFFFF;

  --accent:        #127A80;  /* PINE: solid button bg, 5.1:1 with white */
  --accent-hover:  #178A90;
  --accent-text:   #6CCBCB;  /* links/labels on dark, 9.4:1 on surface */
  --accent-tint:   #0F2829;
  --accent-border: #1E4A4C;

  --success:       #4CC488;  --success-tint: #11271B;  --success-border: #1F4A33;
  --warning:       #EDB04B;  --warning-tint: #2B2112;  --warning-border: #4E3A17;  --warning-solid: #E39A1F;
  --danger:        #F2766A;  --danger-tint:  #321715;  --danger-border:  #5A2621;
  --neutral-tint:  #232328;

  --bubble-in:     #1F1F23;
  --bubble-out:    #2A2621;
  --thread-bg:     #111113;
  --wa-chat-bg:    #0B141A;
  --wa-header:     #1F2C33;

  --av-sand-bg:#3A3024; --av-sand-fg:#E3CBA8; --av-sky-bg:#22303D; --av-sky-fg:#B4CCE2;
  --av-olive-bg:#2D3220; --av-olive-fg:#C9D3A3; --av-rose-bg:#3A2630; --av-rose-fg:#E8B9C9;
  --av-slate-bg:#2B2B38; --av-slate-fg:#C4C4DA;
  --focus:         0 0 0 3px rgba(108,203,203,.32);
  --shadow-pop:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.45);
  --shadow-device: 0 2px 6px rgba(0,0,0,.4), 0 24px 48px rgba(0,0,0,.5);
}

/* =========================================================
   ACCENT VARIANTS: <html data-accent="pine|clay|ochre|cobalt">
   DEFAULT = PINE (values above). Other variants are optional.
   Each variant sets every accent token for light, then dark.
   Dark rules use [data-theme][data-accent] (higher specificity),
   so they always win over the light accent rule.
   Some variants also nudge one status hue so the accent never
   looks like a status (documented inline).
   ========================================================= */

/* ---- A · Pine (deep green-teal) ---- */
[data-accent="pine"] {
  --accent: #0D6B70; --accent-hover: #0A585C; --accent-text: #0B6469;
  --accent-tint: #E3F0EF; --accent-border: #B3D6D5;
  --focus: 0 0 0 3px rgba(13,107,112,.28);
  /* outgoing bubble goes warm-neutral so it doesn't merge with the teal selection tint */
  --bubble-out: #ECE7DD;
}
[data-theme="dark"][data-accent="pine"] {
  --accent: #127A80; --accent-hover: #178A90; --accent-text: #6CCBCB;
  --accent-tint: #0F2829; --accent-border: #1E4A4C;
  --focus: 0 0 0 3px rgba(108,203,203,.32);
  --bubble-out: #2A2621;
}

/* ---- B · Clay (terracotta / burnt clay) ---- */
[data-accent="clay"] {
  --accent: #A8472A; --accent-hover: #913B22; --accent-text: #9E4226;
  --accent-tint: #F7EAE3; --accent-border: #E9C5B7;
  --focus: 0 0 0 3px rgba(168,71,42,.26);
  /* danger shifts from orange-red to raspberry so errors never look like the brand */
  --danger: #B0234A; --danger-tint: #FAE8EE; --danger-border: #EFC1CF;
}
[data-theme="dark"][data-accent="clay"] {
  --accent: #B5502D; --accent-hover: #C45D38; --accent-text: #F0A07E;
  --accent-tint: #2D1C15; --accent-border: #5A3324;
  --focus: 0 0 0 3px rgba(240,160,126,.30);
  --danger: #F27394; --danger-tint: #33161F; --danger-border: #5E2638;
}

/* ---- C · Ochre (rich amber-brown) ---- */
[data-accent="ochre"] {
  --accent: #8A5A10; --accent-hover: #734B0C; --accent-text: #845510;
  --accent-tint: #F5EEDE; --accent-border: #E2CFA0;
  --focus: 0 0 0 3px rgba(138,90,16,.28);
  /* warning shifts from amber to burnt orange so "Being checked" never looks like the brand */
  --warning: #B04A0C; --warning-tint: #FCECE2; --warning-border: #F2C9AE; --warning-solid: #E2682A;
}
[data-theme="dark"][data-accent="ochre"] {
  --accent: #97640F; --accent-hover: #A8721A; --accent-text: #E4B65E;
  --accent-tint: #2A2213; --accent-border: #574116;
  --focus: 0 0 0 3px rgba(228,182,94,.30);
  --warning: #F28C55; --warning-tint: #2E1C12; --warning-border: #59321C; --warning-solid: #E2682A;
}

/* ---- Fallback · Cobalt (original) ---- */
[data-accent="cobalt"] {
  --accent: #2B4ACB; --accent-hover: #223DAE; --accent-text: #2B4ACB;
  --accent-tint: #EDF0FC; --accent-border: #C6D0F4;
  --focus: 0 0 0 3px rgba(43,74,203,.28);
}
[data-theme="dark"][data-accent="cobalt"] {
  --accent: #3D5FE6; --accent-hover: #4D6DF0; --accent-text: #8EA5FF;
  --accent-tint: #1A2142; --accent-border: #2E3B78;
  --focus: 0 0 0 3px rgba(142,165,255,.35);
}
