/*
 * Semi theme tokens (shadcn/ui variables, same names as auvyx-ui).
 *
 * This is the only file to edit to re-theme the admin. semi.css reads these
 * variables and never hard-codes a color.
 *
 *   html.semi            the theme is on (set before paint by SemiDecorator)
 *   html.dark            dark mode (mirrors the platform's "darkMode" option)
 *   html[data-color=...] accent preset (mirrors the platform's "themeColor"
 *                        swatches: gray, green, blue, red, orange, purple, pink)
 *
 * Any tweakcn / shadcn theme can be pasted over :root / html.dark below.
 */

@font-face {
  font-family: 'Recursive';
  font-style: normal;
  font-display: swap;
  font-weight: 300 1000;
  src: url(/fonts/semi/recursive-vietnamese-wght-normal.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Recursive';
  font-style: normal;
  font-display: swap;
  font-weight: 300 1000;
  src: url(/fonts/semi/recursive-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Recursive';
  font-style: normal;
  font-display: swap;
  font-weight: 300 1000;
  src: url(/fonts/semi/recursive-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-sans: 'Recursive', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --font-weight: 500;          /* Recursive Sans Linear, Medium */
  --font-weight-strong: 600;   /* page titles, numbers */

  /* Style pack: Lyra (shadcn/auvyx-ui) with 3px corners. Compact, 1px rings, no shadows.
   * For the rounder Vega look use:
   *   --radius: 0.625rem;
   *   --control-h: 2.25rem; --control-h-sm: 2rem; --control-h-lg: 2.5rem; --control-px: 1rem;
   *   --space: 1.25rem; --ring-width: 3px; --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
   *   --backdrop: rgb(0 0 0 / 0.5); --backdrop-blur: 0px; */
  --radius: 3px;
  /* Font sizes follow the previous Semi theme. */
  --text-sm: 0.8rem;           /* body, buttons, tables, sidebar */
  --text-control: 0.785rem;    /* inputs, selects */
  --text-xs: 0.7rem;           /* badges, captions, group labels */
  --text-base: 0.875rem;       /* dropdowns, large buttons */
  --text-brand: 1rem;
  --text-page-title: 1.8rem;
  --text-card-title: 1.1rem;
  --control-h: 2rem;
  --control-h-sm: 1.75rem;
  --control-h-lg: 2.25rem;
  --control-px: 0.625rem;
  --space: 1rem;               /* card and modal padding */
  --ring-width: 1px;
  --backdrop: rgb(0 0 0 / 0.1);
  --backdrop-blur: 4px;
  --sidebar-width: 220px;      /* AdminLTE default is 250px */

  /* Radius scale derived from --radius; never below 0. */
  /* Small radii keep a visible corner (2-3px) instead of going square. */
  --radius-sm: max(calc(var(--radius) - 4px), min(var(--radius), 2px));
  --radius-md: max(calc(var(--radius) - 2px), min(var(--radius), 3px));
  --radius-lg: var(--radius);
  --radius-xl: max(var(--radius), calc(var(--radius) * 1.4 - 1px));

  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  /* A step darker than shadcn's 0.922 so 1px lines read on white. */
  --border: oklch(0.87 0 0);
  --input: oklch(0.85 0 0);
  --ring: oklch(0.708 0 0);

  /* Sidebar keeps the theme's original dark rail (#1c1f23) in both modes.
   * For a light shadcn-style rail use:
   *   --sidebar: oklch(0.985 0 0); --sidebar-foreground: oklch(0.145 0 0);
   *   --sidebar-primary: oklch(0.205 0 0); --sidebar-primary-foreground: oklch(0.985 0 0);
   *   --sidebar-accent: oklch(0.955 0 0); --sidebar-accent-foreground: oklch(0.205 0 0);
   *   --sidebar-border: oklch(0.922 0 0); */
  --sidebar: rgb(28 31 35);
  --sidebar-foreground: oklch(0.92 0.004 258);
  --sidebar-primary: oklch(0.985 0 0);
  --sidebar-primary-foreground: oklch(0.205 0 0);
  --sidebar-accent: rgb(255 255 255 / 0.1);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: rgb(255 255 255 / 0.08);

  /* Admin needs status colors shadcn leaves out. */
  --success: oklch(0.596 0.145 163.225);
  --warning: oklch(0.666 0.179 58.318);
  --info: oklch(0.588 0.158 241.966);
  --link: oklch(0.488 0.217 264.376);

  --shadow-xs: none;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

html.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 16%);
  --input: oklch(1 0 0 / 20%);
  --ring: oklch(0.556 0 0);

  --sidebar: rgb(24 27 31);
  --sidebar-border: oklch(1 0 0 / 10%);

  --success: oklch(0.696 0.17 162.48);
  --warning: oklch(0.769 0.188 70.08);
  --info: oklch(0.685 0.169 237.323);
  --link: oklch(0.707 0.165 254.624);

  --shadow-xs: none;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

/* Accent presets. Only primary, ring, link and the sidebar's active mark change. */
html[data-color='gray'] { --primary: oklch(0.446 0.043 257.281); --primary-foreground: oklch(0.984 0.003 247.858); --ring: oklch(0.704 0.04 256.788); --link: var(--primary); --sidebar-primary: var(--primary); --sidebar-primary-foreground: var(--primary-foreground); }
html[data-color='green'] { --primary: oklch(0.527 0.154 150.069); --primary-foreground: oklch(0.982 0.018 155.826); --ring: oklch(0.792 0.209 151.711); --link: var(--primary); --sidebar-primary: var(--primary); --sidebar-primary-foreground: var(--primary-foreground); }
html[data-color='blue'] { --primary: oklch(0.546 0.245 262.881); --primary-foreground: oklch(0.97 0.014 254.604); --ring: oklch(0.707 0.165 254.624); --link: var(--primary); --sidebar-primary: var(--primary); --sidebar-primary-foreground: var(--primary-foreground); }
html[data-color='red'] { --primary: oklch(0.577 0.245 27.325); --primary-foreground: oklch(0.971 0.013 17.38); --ring: oklch(0.704 0.191 22.216); --link: var(--primary); --sidebar-primary: var(--primary); --sidebar-primary-foreground: var(--primary-foreground); }
html[data-color='orange'] { --primary: oklch(0.646 0.222 41.116); --primary-foreground: oklch(0.98 0.016 73.684); --ring: oklch(0.75 0.183 55.934); --link: oklch(0.553 0.195 38.402); --sidebar-primary: var(--primary); --sidebar-primary-foreground: var(--primary-foreground); }
html[data-color='purple'] { --primary: oklch(0.541 0.281 293.009); --primary-foreground: oklch(0.969 0.016 293.756); --ring: oklch(0.702 0.183 293.541); --link: var(--primary); --sidebar-primary: var(--primary); --sidebar-primary-foreground: var(--primary-foreground); }
html[data-color='pink'] { --primary: oklch(0.592 0.249 0.584); --primary-foreground: oklch(0.971 0.014 343.198); --ring: oklch(0.718 0.202 349.761); --link: var(--primary); --sidebar-primary: var(--primary); --sidebar-primary-foreground: var(--primary-foreground); }

html.dark[data-color='gray'] { --primary: oklch(0.704 0.04 256.788); --primary-foreground: oklch(0.208 0.042 265.755); --ring: oklch(0.446 0.043 257.281); }
html.dark[data-color='green'] { --primary: oklch(0.723 0.219 149.579); --primary-foreground: oklch(0.266 0.065 152.934); --ring: oklch(0.527 0.154 150.069); }
html.dark[data-color='blue'] { --primary: oklch(0.623 0.214 259.815); --primary-foreground: oklch(0.97 0.014 254.604); --ring: oklch(0.488 0.243 264.376); }
html.dark[data-color='red'] { --primary: oklch(0.637 0.237 25.331); --primary-foreground: oklch(0.971 0.013 17.38); --ring: oklch(0.505 0.213 27.518); }
html.dark[data-color='orange'] { --primary: oklch(0.705 0.213 47.604); --primary-foreground: oklch(0.266 0.079 36.259); --ring: oklch(0.553 0.195 38.402); --link: var(--primary); }
html.dark[data-color='purple'] { --primary: oklch(0.606 0.25 292.717); --primary-foreground: oklch(0.969 0.016 293.756); --ring: oklch(0.491 0.27 292.581); }
html.dark[data-color='pink'] { --primary: oklch(0.656 0.241 354.308); --primary-foreground: oklch(0.971 0.014 343.198); --ring: oklch(0.525 0.223 3.958); }
