@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap");

/**
 * TechoraDesk theme — default forest green #004233 + brand accent #FCAA00.
 * Primary can switch via html[data-primary="…"] (Appearance settings).
 * HSL channels without `hsl()` wrapper, same as shadcn.
 */

:root {
  --background: 160 20% 96%;
  --foreground: 166 40% 10%;
  --card: 0 0% 100%;
  --card-foreground: 166 40% 10%;
  --popover: 0 0% 100%;
  --popover-foreground: 166 40% 10%;
  /* Forest green #004233 */
  --primary: 166 100% 13%;
  --primary-foreground: 0 0% 98%;
  --secondary: 166 28% 94%;
  --secondary-foreground: 166 100% 13%;
  --muted: 160 16% 93%;
  --muted-foreground: 166 12% 34%;
  --font-size-min: 13px;
  --font-size-body: 14px;
  --font-size-table: 16px;
  --font-size-kpi: 1.25rem;
  --accent: 166 40% 93%;
  --accent-foreground: 166 100% 13%;
  /* Logo orange/gold #FCAA00 */
  --brand-accent: 40 100% 49%;
  --brand-accent-foreground: 166 40% 10%;
  --destructive: 0 72% 46%;
  --destructive-foreground: 0 0% 98%;
  --border: 166 16% 86%;
  --input: 166 14% 80%;
  --ring: 166 100% 13%;
  --info: 198 82% 36%;
  --info-soft: 198 70% 94%;
  --success: 152 55% 28%;
  --success-soft: 152 55% 94%;
  --warning: 28 78% 32%;
  --warning-soft: 38 90% 94%;
  --purple: 271 70% 42%;
  --purple-soft: 270 80% 95%;
  --shadow-sm: 0 1px 2px hsl(166 40% 12% / 0.04);
  --shadow: 0 1px 2px hsl(166 40% 12% / 0.04), 0 12px 32px hsl(166 40% 12% / 0.08);
  --shadow-lg: 0 8px 16px hsl(166 40% 12% / 0.06), 0 24px 48px hsl(166 40% 12% / 0.12);
  --chart-1: 40 100% 49%;
  --chart-2: 166 70% 28%;
  --chart-3: 198 70% 36%;
  --chart-4: 43 74% 66%;
  --chart-5: 274 60% 42%;
  --radius: 0.875rem;
  --card-gap: 0.5rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --sidebar-background: 0 0% 100%;
  --sidebar-foreground: 166 30% 18%;
  --sidebar-primary: 166 100% 13%;
  --sidebar-primary-foreground: 0 0% 98%;
  --sidebar-accent: 166 40% 93%;
  --sidebar-accent-foreground: 166 100% 13%;
  --sidebar-border: 166 16% 86%;
  --sidebar-ring: 166 100% 13%;
  --scrollbar-thumb: #00423366;
  --scrollbar-background: hsl(var(--muted) / 50%);
  --font-sans: "Source Sans 3", Arial, Helvetica, sans-serif;
}

/* Primary theme packs (Appearance → Primary colour) */
html[data-primary="forest"] {
  --primary: 166 100% 13%;
  --secondary: 166 28% 94%;
  --secondary-foreground: 166 100% 13%;
  --accent: 166 40% 93%;
  --accent-foreground: 166 100% 13%;
  --ring: 166 100% 13%;
  --border: 166 16% 86%;
  --input: 166 14% 80%;
  --sidebar-primary: 166 100% 13%;
  --sidebar-accent: 166 40% 93%;
  --sidebar-accent-foreground: 166 100% 13%;
  --sidebar-border: 166 16% 86%;
  --sidebar-ring: 166 100% 13%;
  --scrollbar-thumb: #00423366;
}

html[data-primary="navy"] {
  --primary: 214 65% 26%;
  --secondary: 214 32% 95%;
  --secondary-foreground: 214 65% 26%;
  --accent: 214 55% 94%;
  --accent-foreground: 214 65% 26%;
  --ring: 214 65% 26%;
  --border: 214 24% 88%;
  --input: 214 20% 82%;
  --sidebar-primary: 214 65% 26%;
  --sidebar-accent: 214 55% 94%;
  --sidebar-accent-foreground: 214 65% 26%;
  --sidebar-border: 214 24% 88%;
  --sidebar-ring: 214 65% 26%;
  --scrollbar-thumb: #173d6e5d;
}

html[data-primary="teal"] {
  --primary: 198 82% 23%;
  --secondary: 198 36% 94%;
  --secondary-foreground: 198 82% 23%;
  --accent: 198 50% 93%;
  --accent-foreground: 198 82% 23%;
  --ring: 198 82% 23%;
  --border: 198 20% 86%;
  --input: 198 16% 80%;
  --sidebar-primary: 198 82% 23%;
  --sidebar-accent: 198 50% 93%;
  --sidebar-accent-foreground: 198 82% 23%;
  --sidebar-border: 198 20% 86%;
  --sidebar-ring: 198 82% 23%;
  --scrollbar-thumb: #0b4f6c66;
}

html[data-primary="charcoal"] {
  --primary: 217 33% 17%;
  --secondary: 220 18% 94%;
  --secondary-foreground: 217 33% 17%;
  --accent: 220 16% 93%;
  --accent-foreground: 217 33% 17%;
  --ring: 217 33% 17%;
  --border: 220 14% 86%;
  --input: 220 12% 80%;
  --sidebar-primary: 217 33% 17%;
  --sidebar-accent: 220 16% 93%;
  --sidebar-accent-foreground: 217 33% 17%;
  --sidebar-border: 220 14% 86%;
  --sidebar-ring: 217 33% 17%;
  --scrollbar-thumb: #1e293b66;
}

html[data-primary="indigo"] {
  --primary: 274 87% 21%;
  --secondary: 274 40% 95%;
  --secondary-foreground: 274 87% 21%;
  --accent: 274 55% 94%;
  --accent-foreground: 274 87% 21%;
  --ring: 274 87% 21%;
  --border: 274 18% 88%;
  --input: 274 14% 82%;
  --sidebar-primary: 274 87% 21%;
  --sidebar-accent: 274 55% 94%;
  --sidebar-accent-foreground: 274 87% 21%;
  --sidebar-border: 274 18% 88%;
  --sidebar-ring: 274 87% 21%;
  --scrollbar-thumb: #3b076466;
}

.dark,
[data-theme="dark"] {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 166 55% 42%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 6% 78%;
  --accent: 166 30% 16%;
  --accent-foreground: 0 0% 98%;
  --brand-accent: 40 100% 55%;
  --brand-accent-foreground: 166 40% 10%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5% 22%;
  --input: 240 5% 28%;
  --ring: 166 50% 48%;
  --info: 198 80% 62%;
  --info-soft: 198 35% 16%;
  --success: 152 45% 62%;
  --success-soft: 152 30% 16%;
  --warning: 38 80% 68%;
  --warning-soft: 32 30% 16%;
  --purple: 270 70% 72%;
  --purple-soft: 270 35% 18%;
  --shadow-sm: 0 1px 2px hsl(0 0% 0% / 0.3);
  --shadow: 0 1px 2px hsl(0 0% 0% / 0.3), 0 12px 32px hsl(0 0% 0% / 0.35);
  --shadow-lg: 0 8px 24px hsl(0 0% 0% / 0.4);
  --chart-1: 40 100% 55%;
  --chart-2: 166 55% 42%;
  --chart-3: 198 70% 50%;
  --chart-4: 280 65% 60%;
  --chart-5: 340 75% 55%;
  --sidebar-background: 166 30% 10%;
  --sidebar-foreground: 160 20% 92%;
  --sidebar-primary: 166 55% 42%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 166 28% 16%;
  --sidebar-accent-foreground: 160 20% 92%;
  --sidebar-border: 166 22% 16%;
  --sidebar-ring: 166 50% 48%;
  --scrollbar-thumb: #ededed20;
  --scrollbar-background: hsl(var(--muted) / 50%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  font-weight: 400;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
}

body:not(.print-doc-body) h1,
body:not(.print-doc-body) h2,
body:not(.print-doc-body) h3,
body:not(.print-doc-body) h4 {
  font-weight: 600;
}

/* Secondary copy stays medium weight — pale/light type is hard to read */
body:not(.print-doc-body) .muted,
body:not(.print-doc-body) .text-muted-foreground {
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Utility aliases used across pages */
.bg-background { background-color: hsl(var(--background)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-muted-50 { background-color: hsl(var(--muted) / 0.5); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-accent { background-color: hsl(var(--accent)); }
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.border { border: 1px solid hsl(var(--border)); }
.rounded-md { border-radius: calc(var(--radius) - 4px); }
.rounded-lg { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }
.shadow-none { box-shadow: none; }
.muted { color: hsl(var(--muted-foreground)); }
