/*
 * Sleed Web App UI (KAi UI System) — light theme
 * Source: Sleed_WebApp_Design_Guidelines.md
 *
 * - Tokens + typography apply to every theme.
 * - All colour rules are scoped to :root:not(.dark-style), so the Dracula
 *   dark theme in sleed-dark.css is untouched.
 * - !important / doubled specificity is needed because the template customizer
 *   relocates the core/theme <link> tags after this stylesheet at runtime.
 */

/* ==========================================================================
   1. Tokens (§2)
   ========================================================================== */
:root {
  /* shadcn-style HSL tokens — use as hsl(var(--token)) or hsl(var(--token) / .1) */
  --background: 220 30% 98%;
  --foreground: 222 47% 10%;
  --card: 0 0% 100%;
  --primary: 222 47% 11%;
  --primary-foreground: 210 40% 98%;
  --secondary: 220 20% 95%;
  --muted: 220 20% 95%;
  --muted-foreground: 222 15% 42%;
  --accent: 162 72% 58%;
  --accent-foreground: 222 47% 10%;
  --accent-text: 162 72% 30%;
  --destructive: 0 72% 51%;
  --success: 152 60% 42%;
  --success-text: 152 60% 30%;
  --warning: 38 92% 50%;
  --warning-text: 32 90% 32%;
  --border: 220 18% 90%;
  --ring: 162 72% 58%;
  --radius: 0.625rem;

  --sidebar-background: 222 47% 8%;
  --sidebar-foreground: 215 20% 70%;
  --sidebar-border: 222 35% 16%;
  --sidebar-muted: 220 10% 55%;

  --font-heading: "Geist", "Inter", system-ui, sans-serif;
  --font-body: "Geist", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);

  /* Bootstrap fonts + radii (theme independent) */
  --bs-font-sans-serif: var(--font-body);
  --bs-font-monospace: var(--font-mono);
  --bs-body-font-family: var(--font-body);
  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.375rem;
  --bs-border-radius-lg: 0.625rem;
  --bs-border-radius-xl: 0.75rem;
}

/* Bootstrap theme variables — light only (sleed-dark.css sets its own) */
:root:not(.dark-style) {
  --bs-primary: #0F1729;
  --bs-primary-rgb: 15, 23, 41;
  --bs-secondary: #5B657B;
  --bs-secondary-rgb: 91, 101, 123;
  --bs-success: #2BAB6F;
  --bs-success-rgb: 43, 171, 111;
  --bs-info: #47E1B3;
  --bs-info-rgb: 71, 225, 179;
  --bs-warning: #F59F0A;
  --bs-warning-rgb: 245, 159, 10;
  --bs-danger: #DC2828;
  --bs-danger-rgb: 220, 40, 40;
  --bs-light: #F0F1F5;
  --bs-light-rgb: 240, 241, 245;
  --bs-dark: #0E1525;
  --bs-dark-rgb: 14, 21, 37;

  --bs-body-bg: #F8F9FB;
  --bs-body-bg-rgb: 248, 249, 251;
  --bs-body-color: #0E1525;
  --bs-body-color-rgb: 14, 21, 37;
  --bs-heading-color: #0E1525;
  --bs-secondary-color: #5B657B;
  --bs-border-color: #E1E4EA;
  --bs-border-color-translucent: rgba(15, 23, 41, 0.08);
  --bs-link-color: #158463;
  --bs-link-color-rgb: 21, 132, 99;
  --bs-link-hover-color: #0F1729;
  --bs-link-hover-color-rgb: 15, 23, 41;
  --bs-highlight-bg: rgba(71, 225, 179, 0.25);
  --bs-card-bg: #FFFFFF;
}

/* ==========================================================================
   2. Typography (§3) — all themes
   ========================================================================== */
body {
  font-family: var(--font-body) !important;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
  font-family: var(--font-heading) !important;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h1, .h1 { font-size: 1.875rem; font-weight: 700; }
h2, .h2 { font-size: 1.5rem;   font-weight: 700; }
h3, .h3 { font-size: 1.25rem;  font-weight: 700; }
h4, .h4 { font-size: 1rem;     font-weight: 600; letter-spacing: -0.01em; }
h5, .h5 { font-size: 0.875rem; font-weight: 600; letter-spacing: 0; }
h6, .h6 { font-size: 0.75rem;  font-weight: 600; letter-spacing: 0; }

code, kbd, pre, samp { font-family: var(--font-mono) !important; }

.table, .form-control, .form-select, .input-group-text, .dropdown-menu { font-size: 0.875rem; }

.tabular-nums, .table td, .kpi-value { font-variant-numeric: tabular-nums; }

.text-fine { font-size: 0.6875rem; }

/* Section label — card titles, eyebrows ("QUICK ACCESS") */
.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.kpi-value { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; line-height: 1; }

/* ==========================================================================
   3. Canvas, text, links
   ========================================================================== */
:root:not(.dark-style) body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

:root:not(.dark-style) h1, :root:not(.dark-style) .h1,
:root:not(.dark-style) h2, :root:not(.dark-style) .h2,
:root:not(.dark-style) h3, :root:not(.dark-style) .h3,
:root:not(.dark-style) h4, :root:not(.dark-style) .h4,
:root:not(.dark-style) h5, :root:not(.dark-style) .h5,
:root:not(.dark-style) h6, :root:not(.dark-style) .h6,
:root:not(.dark-style) .text-heading {
  color: hsl(var(--foreground));
}

:root:not(.dark-style) .text-muted,
:root:not(.dark-style) .text-body-secondary { color: hsl(var(--muted-foreground)) !important; }

/* Mint fails contrast as text on light (§9) — use --accent-text */
:root:not(.dark-style) .text-primary { color: hsl(var(--foreground)) !important; }
:root:not(.dark-style) .text-info,
:root:not(.dark-style) .text-accent { color: hsl(var(--accent-text)) !important; }
:root:not(.dark-style) .text-success { color: hsl(var(--success-text)) !important; }
:root:not(.dark-style) .text-warning { color: hsl(var(--warning-text)) !important; }
:root:not(.dark-style) .text-danger  { color: hsl(var(--destructive)) !important; }

:root:not(.dark-style) .bg-primary { background-color: hsl(var(--primary)) !important; color: hsl(var(--primary-foreground)); }
:root:not(.dark-style) .bg-accent  { background-color: hsl(var(--accent)) !important; color: hsl(var(--accent-foreground)); }

:root:not(.dark-style) a:not(.btn):not(.menu-link):not(.dropdown-item):not(.nav-link):not(.page-link) {
  color: hsl(var(--accent-text));
  transition: color 150ms ease;
}
:root:not(.dark-style) a:not(.btn):not(.menu-link):not(.dropdown-item):not(.nav-link):not(.page-link):hover {
  color: hsl(var(--foreground));
}

:root:not(.dark-style) hr,
:root:not(.dark-style) .divider { border-color: hsl(var(--border)); opacity: 1; }

:root:not(.dark-style) ::selection { background: hsl(var(--accent) / .3); color: hsl(var(--foreground)); }

:root:not(.dark-style) code { color: hsl(var(--foreground)); background: hsl(var(--muted)); padding: .1em .35em; border-radius: .375rem; }

/* ==========================================================================
   4. App shell — dark sidebar (§4.1)
   ========================================================================== */

/* Full-width work area for apps (§4.1): lift the template's 1440px container cap
   for content, hero, navbar and footer. Theme independent. */
.layout-page .container-xxl,
.layout-page .layout-navbar.navbar-detached.container-xxl {
  max-width: none;
}
:root:not(.dark-style) .bg-menu-theme {
  background-color: hsl(var(--sidebar-background)) !important;
  color: hsl(var(--sidebar-foreground));
  border-right: 1px solid hsl(var(--sidebar-border));
  box-shadow: none !important;
}

/* Logo artwork has navy lettering — render it white on the navy rail */
:root:not(.dark-style) .bg-menu-theme .app-brand-logo img { filter: brightness(0) invert(1); opacity: .95; }
:root:not(.dark-style) .bg-menu-theme .app-brand .layout-menu-toggle { color: hsl(var(--sidebar-foreground)); }

:root:not(.dark-style) .bg-menu-theme .menu-inner-shadow {
  background: linear-gradient(hsl(var(--sidebar-background)) 5%, hsl(var(--sidebar-background) / .75) 45%, hsl(var(--sidebar-background) / .2) 80%, transparent);
}

:root:not(.dark-style) .bg-menu-theme .menu-header,
:root:not(.dark-style) .bg-menu-theme .menu-header-text {
  color: hsl(var(--sidebar-muted));
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

:root:not(.dark-style) .bg-menu-theme .menu-link,
:root:not(.dark-style) .bg-menu-theme .menu-text {
  color: hsl(var(--sidebar-foreground));
}

:root:not(.dark-style) .bg-menu-theme.menu-vertical .menu-item .menu-link {
  font-size: 0.8125rem;
  letter-spacing: 0;
  border-radius: 0.5rem;
  border-left: 2px solid transparent;
  transition: background-color 150ms ease, color 150ms ease;
}

:root:not(.dark-style) .bg-menu-theme .menu-link .menu-icon {
  color: hsl(var(--sidebar-muted));
  font-size: 1.125rem;
}

:root:not(.dark-style) .bg-menu-theme.menu-vertical .menu-item .menu-link:hover,
:root:not(.dark-style) .bg-menu-theme.menu-vertical .menu-item .menu-link:focus {
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: #F1F5F9;
}

:root:not(.dark-style) .bg-menu-theme.menu-vertical .menu-item.open > .menu-toggle,
:root:not(.dark-style) .bg-menu-theme.menu-vertical .menu-item.active > .menu-toggle {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: #F1F5F9;
}

/* Active item: subtle fill + 2px mint left border (§4.1) */
:root:not(.dark-style) .bg-menu-theme.menu-vertical .menu-item.active > .menu-link:not(.menu-toggle),
:root:not(.dark-style) .bg-menu-theme .menu-item.active > .menu-link:not(.menu-toggle) {
  background: rgba(255, 255, 255, 0.04) !important;
  border-left-color: hsl(var(--accent)) !important;
  border-radius: 0 0.5rem 0.5rem 0 !important;
  box-shadow: none !important;
  color: #F8FAFC !important;
  font-weight: 600;
}
:root:not(.dark-style) .bg-menu-theme .menu-item.active > .menu-link .menu-icon { color: hsl(var(--accent)) !important; }
:root:not(.dark-style) .bg-menu-theme .menu-item.active:not(.open) > .menu-link:not(.menu-toggle)::before { color: hsl(var(--accent)) !important; }

:root:not(.dark-style) .bg-menu-theme .menu-sub .menu-link { color: hsl(var(--sidebar-foreground) / .85); }

/* Sub menu items show only their icon, without the template's bullet dot (both themes) */
.layout-wrapper:not(.layout-horizontal) .menu-vertical .menu-inner > .menu-item > .menu-sub > .menu-item > .menu-link::before { display: none; }
/* Same icon-text gap as top-level menu items (the template sets it to 0 inside sub menus) */
.layout-wrapper:not(.layout-horizontal) .menu-vertical .menu-sub .menu-icon { margin-right: 0.5rem; }
[dir=rtl] .layout-wrapper:not(.layout-horizontal) .menu-vertical .menu-sub .menu-icon { margin-right: 0; margin-left: 0.5rem; }

:root:not(.dark-style) .bg-menu-theme .ps__thumb-y,
:root:not(.dark-style) .bg-menu-theme .ps__rail-y.ps--clicking > .ps__thumb-y { background: rgba(255, 255, 255, 0.15) !important; }

/* Top navbar — white hairline bar */
:root:not(.dark-style) .layout-navbar.bg-navbar-theme {
  background-color: hsl(var(--card) / .92) !important;
  backdrop-filter: blur(8px);
  border: 1px solid hsl(var(--border));
  border-top: 0;
  box-shadow: var(--shadow-sm) !important;
  color: hsl(var(--muted-foreground));
}
:root:not(.dark-style) .layout-navbar .nav-link { color: hsl(var(--muted-foreground)); }
:root:not(.dark-style) .layout-navbar .nav-link:hover { color: hsl(var(--foreground)); }

:root:not(.dark-style) .bg-footer-theme,
:root:not(.dark-style) .bg-footer-theme .footer-container { color: hsl(var(--muted-foreground)); font-size: 0.8125rem; }

/* ==========================================================================
   5. Page Hero — signature element (§5.1), rendered by element/subheader.php
   ========================================================================== */
#kt_subheader { padding-top: 1.5rem; }

.page-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  color: hsl(var(--primary-foreground));
  animation: sleed-fade-in-up .5s var(--ease-out) both;
}

:root:not(.dark-style) .page-hero {
  background:
    radial-gradient(120% 140% at 0% 0%,   hsl(var(--accent) / .28) 0%, transparent 55%),
    radial-gradient(100% 120% at 100% 0%, hsl(var(--primary) / .35) 0%, transparent 55%),
    linear-gradient(135deg, hsl(var(--primary) / .92), hsl(var(--primary) / .65));
  background-color: hsl(var(--primary));
}

.page-hero-grain {
  position: absolute;
  inset: 0;
  opacity: .6;
  pointer-events: none;
  background-image: radial-gradient(hsl(var(--primary-foreground) / .06) 1px, transparent 1px);
  background-size: 18px 18px;
}

.page-hero-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(64px);
  pointer-events: none;
}
.page-hero-orb--tr { right: -5rem;  top: -6rem;    width: 18rem; height: 18rem; background: hsl(var(--accent) / .30); }
.page-hero-orb--bl { left: -2.5rem; bottom: -6rem; width: 16rem; height: 16rem; background: hsl(var(--accent) / .20); }

.page-hero-body {
  position: relative;
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem;
}
@media (min-width: 768px)  { .page-hero-body { padding: 1.5rem; } }
@media (min-width: 1200px) { .page-hero-body { grid-template-columns: 1fr auto; align-items: center; } }

.page-hero-text > * + * { margin-top: 0.5rem; }

.page-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  margin: 0;
  padding: .125rem .5rem;
  border-radius: 9999px;
  background: hsl(var(--primary-foreground) / .10);
  backdrop-filter: blur(8px);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--primary-foreground) / .80);
}

.page-hero .page-hero-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: hsl(var(--primary-foreground)) !important;
}
@media (min-width: 768px) { .page-hero .page-hero-title { font-size: 1.875rem; } }

.page-hero .page-hero-description {
  margin: 0;
  font-size: 0.875rem;
  color: hsl(var(--primary-foreground) / .75);
}

.page-hero .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .375rem;
  margin: 0;
  padding: 0 !important;
  font-size: 0.8125rem;
  color: hsl(var(--primary-foreground) / .50);
}
.page-hero .breadcrumb .breadcrumb-back { font-size: 1rem; opacity: .75; }
/* !important: the global light-theme link colour rule (a:not(.btn):not(...)) is more specific
   and would otherwise paint the crumbs dark on the dark hero. */
.page-hero .breadcrumb .breadcrumb-item,
:root:not(.dark-style) .page-hero .breadcrumb a.breadcrumb-item { color: hsl(var(--primary-foreground) / .75) !important; padding: 0; }
.page-hero .breadcrumb .breadcrumb-item::before { display: none; }
:root:not(.dark-style) .page-hero .breadcrumb a.breadcrumb-item:hover { color: hsl(var(--accent)) !important; }

/* Glass KPI tiles (§5.2) — optional: <div class="page-hero-stats"><a class="hero-stat">…</a></div> */
.page-hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 768px) { .page-hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.hero-stat {
  position: relative;
  display: block;
  min-height: 58px;
  min-width: 120px;
  padding: .75rem;
  border-radius: 1rem;
  border: 1px solid hsl(var(--primary-foreground) / .15);
  background: hsl(var(--primary-foreground) / .05);
  backdrop-filter: blur(12px);
  color: hsl(var(--primary-foreground)) !important;
  text-align: left;
  transition: all 150ms ease;
}
.hero-stat:hover { transform: translateY(-2px); border-color: hsl(var(--primary-foreground) / .30); background: hsl(var(--primary-foreground) / .10); }
.hero-stat-label { font-size: 9px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: hsl(var(--primary-foreground) / .65); }
.hero-stat-value { margin: .25rem 0 0; font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   6. Cards (§5.3)
   ========================================================================== */
:root:not(.dark-style) .card {
  --bs-card-bg: hsl(var(--card));
  --bs-card-border-width: 1px;
  --bs-card-border-color: hsl(var(--border));
  --bs-card-border-radius: 0.75rem;
  --bs-card-inner-border-radius: calc(0.75rem - 1px);
  --bs-card-box-shadow: var(--shadow-sm);
  --bs-card-cap-color: hsl(var(--foreground));
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm) !important;
  animation: sleed-fade-in .3s var(--ease-out) both;
}

:root:not(.dark-style) .card .card-header { border-bottom-color: hsl(var(--border)); }
:root:not(.dark-style) .card .card-footer { border-top-color: hsl(var(--border)); background: transparent; }
:root:not(.dark-style) .card-title { color: hsl(var(--foreground)); }

/* Mint icon chip — standard card header icon */
.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 0.625rem;
  background: hsl(var(--accent) / .10);
  box-shadow: inset 0 0 0 1px hsl(var(--accent) / .20);
  color: hsl(var(--accent-text));
  font-size: 14px;
}

/* ==========================================================================
   7. Buttons (§5.5)
   ========================================================================== */
:root:not(.dark-style) .btn {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 0.5rem;
  box-shadow: none !important;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
:root:not(.dark-style) .btn-sm,
:root:not(.dark-style) .btn-group-sm > .btn { font-size: 0.75rem; padding: .3rem .625rem; border-radius: 0.5rem; }

:root:not(.dark-style) .btn:focus-visible,
:root:not(.dark-style) button:focus-visible,
:root:not(.dark-style) a:focus-visible { outline: none; box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)) !important; }

/* Primary — navy on light. Bare <button type="submit"> (Form->button without class) counts as primary. */
:root:not(.dark-style) .btn-primary,
:root:not(.dark-style) button[type="submit"]:not(.btn-danger):not(.btn-secondary):not(.btn-outline-primary):not(.btn-outline-secondary):not(.btn-label-secondary):not(.btn-warning):not(.btn-info):not(.btn-success):not(.btn-text-primary),
:root:not(.dark-style) .actions a.button {
  background-color: hsl(var(--primary)) !important;
  border-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
:root:not(.dark-style) .btn-primary:hover,
:root:not(.dark-style) .btn-primary:focus,
:root:not(.dark-style) .btn-primary:active,
:root:not(.dark-style) button[type="submit"]:not(.btn-danger):not(.btn-secondary):not(.btn-outline-primary):not(.btn-outline-secondary):not(.btn-label-secondary):not(.btn-warning):not(.btn-info):not(.btn-success):not(.btn-text-primary):hover,
:root:not(.dark-style) .actions a.button:hover {
  background-color: hsl(var(--primary) / .9) !important;
  border-color: hsl(var(--primary) / .9) !important;
  color: hsl(var(--primary-foreground)) !important;
}

/* Outline (secondary actions). btn-success is used app-wide for View/Edit row actions,
   so it renders as an outline button — success green is reserved for status (§2.2). */
:root:not(.dark-style) .btn-success,
:root:not(.dark-style) .btn-outline-primary,
:root:not(.dark-style) .btn-outline-secondary,
:root:not(.dark-style) .btn-default,
:root:not(.dark-style) .btn-label-secondary {
  background-color: hsl(var(--background)) !important;
  border: 1px solid hsl(var(--border)) !important;
  color: hsl(var(--foreground)) !important;
}
:root:not(.dark-style) .btn-success:hover,
:root:not(.dark-style) .btn-success:focus,
:root:not(.dark-style) .btn-success:active,
:root:not(.dark-style) .btn-outline-primary:hover,
:root:not(.dark-style) .btn-outline-primary.active,
:root:not(.dark-style) .btn-outline-secondary:hover,
:root:not(.dark-style) .btn-default:hover,
:root:not(.dark-style) .btn-label-secondary:hover {
  background-color: hsl(var(--muted)) !important;
  border-color: hsl(var(--border)) !important;
  color: hsl(var(--foreground)) !important;
}

/* Secondary — soft neutral fill */
:root:not(.dark-style) .btn-secondary {
  background-color: hsl(var(--secondary)) !important;
  border-color: hsl(var(--secondary)) !important;
  color: hsl(var(--foreground)) !important;
}
:root:not(.dark-style) .btn-secondary:hover { background-color: hsl(220 18% 90%) !important; border-color: hsl(220 18% 90%) !important; }

/* Ghost / text */
:root:not(.dark-style) .btn-text-primary,
:root:not(.dark-style) .btn-text-secondary,
:root:not(.dark-style) .btn-clean,
:root:not(.dark-style) .btn-flat { background: transparent !important; border-color: transparent !important; color: hsl(var(--foreground)) !important; }
:root:not(.dark-style) .btn-text-primary:hover,
:root:not(.dark-style) .btn-text-secondary:hover,
:root:not(.dark-style) .btn-clean:hover,
:root:not(.dark-style) .btn-flat:hover { background: hsl(var(--muted)) !important; }

/* Destructive */
:root:not(.dark-style) .btn-danger {
  background-color: hsl(var(--destructive)) !important;
  border-color: hsl(var(--destructive)) !important;
  color: #fff !important;
}
:root:not(.dark-style) .btn-danger:hover { background-color: hsl(var(--destructive) / .9) !important; border-color: hsl(var(--destructive) / .9) !important; }

/* Warning / info — navy text for contrast (§9) */
:root:not(.dark-style) .btn-warning { background-color: hsl(var(--warning)) !important; border-color: hsl(var(--warning)) !important; color: hsl(var(--foreground)) !important; }
:root:not(.dark-style) .btn-info    { background-color: hsl(var(--accent)) !important;  border-color: hsl(var(--accent)) !important;  color: hsl(var(--accent-foreground)) !important; }
:root:not(.dark-style) .btn-warning:hover,
:root:not(.dark-style) .btn-info:hover { filter: brightness(.95); }

/* Count pill */
.count-pill { display: inline-flex; align-items: center; padding: .125rem .5rem; border-radius: 9999px; border: 1px solid hsl(var(--border)); font-size: .75rem; color: hsl(var(--muted-foreground)); }

/* ==========================================================================
   8. Inputs & selects (§5.6)
   ========================================================================== */
:root:not(.dark-style) .form-control,
:root:not(.dark-style) .form-select,
:root:not(.dark-style) .input-group-text,
:root:not(.dark-style) .dataTables_wrapper .dataTables_filter input,
:root:not(.dark-style) .dataTables_wrapper .dataTables_length select {
  background-color: hsl(var(--background));
  border-color: hsl(var(--border)) !important;
  border-radius: 0.625rem;
  color: hsl(var(--foreground));
}
:root:not(.dark-style) .form-control::placeholder { color: hsl(var(--muted-foreground)); }
/* Floating labels: hide the placeholder while the label sits inside the field,
   show it as a hint only once the label has floated up (on focus). */
:root .form-floating > .form-control::placeholder { color: transparent !important; }
:root .form-floating > .form-control:focus::placeholder { color: hsl(var(--muted-foreground)) !important; }

:root:not(.dark-style) .form-control:focus,
:root:not(.dark-style) .form-select:focus,
:root:not(.dark-style) .form-floating-outline .form-control:focus,
:root:not(.dark-style) .form-floating-outline .form-select:focus,
:root:not(.dark-style) .dataTables_wrapper .dataTables_filter input:focus {
  border-color: hsl(var(--ring)) !important;
  box-shadow: 0 0 0 3px hsl(var(--ring) / .25) !important;
  outline: none;
}

:root:not(.dark-style) .form-floating > label,
:root:not(.dark-style) .form-label { color: hsl(var(--muted-foreground)); }

:root:not(.dark-style) .form-floating > .form-control:focus ~ label,
:root:not(.dark-style) .form-floating > .form-select:focus ~ label,
:root:not(.dark-style) .form-floating-outline :not(select):focus + label,
:root:not(.dark-style) .form-floating-outline :not(select):focus + span,
:root:not(.dark-style) .form-control:focus ~ .form-label { color: hsl(var(--accent-text)) !important; }

:root:not(.dark-style) .form-floating > .form-control ~ label::after,
:root:not(.dark-style) .form-floating-outline label::after { background-color: hsl(var(--background)) !important; }

:root:not(.dark-style) .form-check-input:checked,
:root:not(.dark-style) .form-check-input[type="checkbox"]:indeterminate {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
:root:not(.dark-style) .form-check-input:focus { box-shadow: 0 0 0 3px hsl(var(--ring) / .3); border-color: hsl(var(--ring)); }

/* ==========================================================================
   9. Data tables (§5.7)
   ========================================================================== */
:root:not(.dark-style) .table {
  --bs-table-color: hsl(var(--foreground));
  --bs-table-bg: transparent;
  --bs-table-border-color: hsl(var(--border));
  --bs-table-striped-bg: hsl(var(--muted) / .5);
  --bs-table-hover-bg: hsl(var(--muted) / .45);
  --bs-table-hover-color: hsl(var(--foreground));
  border-color: hsl(var(--border)) !important;
  color: hsl(var(--foreground));
}
:root:not(.dark-style) .table > :not(caption) > * > * { border-color: hsl(var(--border)) !important; }

:root:not(.dark-style) .table thead th,
:root:not(.dark-style) .table thead td {
  height: 2.5rem;
  font-size: 0.6875rem !important;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground)) !important;
  background: transparent;
  vertical-align: middle;
}

:root:not(.dark-style) .table tbody td { padding-top: .75rem; padding-bottom: .75rem; vertical-align: middle; }
:root:not(.dark-style) .table tbody tr { transition: background-color 150ms ease; }
:root:not(.dark-style) .table tbody tr:hover > * { background-color: hsl(var(--muted) / .45); }

/* Bordered tables read as hairline rows: drop the vertical grid lines */
:root:not(.dark-style) .table-bordered > :not(caption) > * > * { border-left-width: 0 !important; border-right-width: 0 !important; }
:root:not(.dark-style) .table-bordered > :not(caption) > * { border-width: 0 !important; }
:root:not(.dark-style) .table-bordered { border-top: 0 !important; }

/* Pagination */
:root:not(.dark-style) .page-link { color: hsl(var(--foreground)); border-color: hsl(var(--border)); border-radius: 0.5rem !important; background: hsl(var(--card)); }
:root:not(.dark-style) .page-link:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
:root:not(.dark-style) .page-item.active .page-link,
:root:not(.dark-style) .page-item.active .page-link:hover {
  background-color: hsl(var(--primary)) !important;
  border-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  box-shadow: none !important;
}
:root:not(.dark-style) .dataTables_wrapper .dataTables_info { color: hsl(var(--muted-foreground)); font-size: .8125rem; }

/* ==========================================================================
   10. Badges (§5.8)
   ========================================================================== */
:root:not(.dark-style) .badge { border-radius: 9999px; font-weight: 500; letter-spacing: 0; }

:root:not(.dark-style) .bg-label-secondary,
:root:not(.dark-style) .bg-label-dark { background-color: hsl(var(--muted)) !important; color: hsl(var(--muted-foreground)) !important; }
:root:not(.dark-style) .bg-label-primary,
:root:not(.dark-style) .bg-label-info { background-color: hsl(var(--accent) / .15) !important; color: hsl(var(--accent-text)) !important; }
:root:not(.dark-style) .bg-label-success { background-color: hsl(var(--success) / .12) !important; color: hsl(var(--success-text)) !important; }
:root:not(.dark-style) .bg-label-warning { background-color: hsl(var(--warning) / .14) !important; color: hsl(var(--warning-text)) !important; }
:root:not(.dark-style) .bg-label-danger  { background-color: hsl(var(--destructive) / .10) !important; color: hsl(var(--destructive)) !important; }

/* Solid text-bg-* — keep contrast-safe text colours (§9) */
:root:not(.dark-style) .text-bg-success { background-color: hsl(var(--success) / .12) !important; color: hsl(var(--success-text)) !important; }
:root:not(.dark-style) .text-bg-warning { background-color: hsl(var(--warning) / .14) !important; color: hsl(var(--warning-text)) !important; }
:root:not(.dark-style) .text-bg-info    { background-color: hsl(var(--accent) / .15) !important;  color: hsl(var(--accent-text)) !important; }
:root:not(.dark-style) .text-bg-danger  { background-color: hsl(var(--destructive) / .10) !important; color: hsl(var(--destructive)) !important; }
:root:not(.dark-style) .text-bg-secondary { background-color: hsl(var(--muted)) !important; color: hsl(var(--muted-foreground)) !important; }

/* ==========================================================================
   11. Navigation bits, dropdowns, alerts, misc
   ========================================================================== */
:root:not(.dark-style) .nav-tabs { border-bottom: 1px solid hsl(var(--border)); }
:root:not(.dark-style) .nav-tabs .nav-link { color: hsl(var(--muted-foreground)); font-size: .875rem; font-weight: 500; border: 0; background: transparent; }
:root:not(.dark-style) .nav-tabs .nav-link:hover { color: hsl(var(--foreground)); }
:root:not(.dark-style) .nav-tabs .nav-link.active,
:root:not(.dark-style) .nav-tabs .nav-item.show .nav-link {
  color: hsl(var(--foreground)) !important;
  background: transparent !important;
  box-shadow: inset 0 -2px 0 hsl(var(--accent)) !important;
}
:root:not(.dark-style) .nav-pills .nav-link { color: hsl(var(--muted-foreground)); border-radius: .5rem; }
:root:not(.dark-style) .nav-pills .nav-link.active { background-color: hsl(var(--primary)) !important; color: hsl(var(--primary-foreground)) !important; box-shadow: none !important; }

:root:not(.dark-style) .dropdown-menu {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: .75rem;
  box-shadow: var(--shadow-md);
  padding: .25rem;
}
:root:not(.dark-style) .dropdown-item { color: hsl(var(--foreground)); border-radius: .5rem; }
:root:not(.dark-style) .dropdown-item:hover,
:root:not(.dark-style) .dropdown-item:focus { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
:root:not(.dark-style) .dropdown-item:not(.disabled).active,
:root:not(.dark-style) .dropdown-item:not(.disabled):active { background: hsl(var(--accent) / .15) !important; color: hsl(var(--foreground)) !important; }

:root:not(.dark-style) .modal-content { border: 1px solid hsl(var(--border)); border-radius: .75rem; box-shadow: var(--shadow-md); }

:root:not(.dark-style) .alert { border-radius: .75rem; border: 1px solid transparent; }
:root:not(.dark-style) .alert-danger  { background: hsl(var(--destructive) / .08); border-color: hsl(var(--destructive) / .25); color: hsl(0 72% 38%); }
:root:not(.dark-style) .alert-success { background: hsl(var(--success) / .10); border-color: hsl(var(--success) / .25); color: hsl(var(--success-text)); }
:root:not(.dark-style) .alert-warning { background: hsl(var(--warning) / .12); border-color: hsl(var(--warning) / .30); color: hsl(var(--warning-text)); }
:root:not(.dark-style) .alert-info,
:root:not(.dark-style) .alert-primary { background: hsl(var(--accent) / .10); border-color: hsl(var(--accent) / .30); color: hsl(var(--foreground)); }

:root:not(.dark-style) .avatar-initial { background-color: hsl(var(--primary)) !important; color: hsl(var(--primary-foreground)) !important; font-weight: 600; }

/* Flatpickr selection */
:root:not(.dark-style) .flatpickr-day.selected,
:root:not(.dark-style) .flatpickr-day.startRange,
:root:not(.dark-style) .flatpickr-day.endRange { background: hsl(var(--primary)) !important; border-color: hsl(var(--primary)) !important; color: #fff !important; }
:root:not(.dark-style) .flatpickr-day.inRange { background: hsl(var(--accent) / .15) !important; border-color: transparent !important; box-shadow: none !important; }
:root:not(.dark-style) .flatpickr-day.today { border-color: hsl(var(--accent)) !important; }

/* Skeleton loader (§5.9) */
.skeleton { border-radius: .625rem; background: hsl(var(--muted)); animation: sleed-pulse 1.5s ease-in-out infinite; }

/* ==========================================================================
   12. Legacy gradient utilities — remapped to navy + mint
   ========================================================================== */
:root:not(.dark-style) .bg-gradient-sleed-space { background: hsl(var(--card)); }
:root:not(.dark-style) .bg-gradient-sleed-space-basic,
:root:not(.dark-style) .bg-gradient-noon {
  background: radial-gradient(120% 140% at 0% 0%, hsl(var(--accent) / .28) 0%, transparent 55%), linear-gradient(135deg, hsl(var(--primary) / .92), hsl(var(--primary) / .65));
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
:root:not(.dark-style) .bg-gradient-vibrant,
:root:not(.dark-style) .bg-gradient-fresh { background: linear-gradient(135deg, hsl(var(--accent) / .18), hsl(var(--accent) / .05)); }

/* ==========================================================================
   13. Motion (§7)
   ========================================================================== */
@keyframes sleed-fade-in-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes sleed-fade-in    { from { opacity: 0; transform: translateY(4px); }  to { opacity: 1; transform: none; } }
@keyframes sleed-pulse      { 50% { opacity: .5; } }

@media (prefers-reduced-motion: reduce) {
  .page-hero, .card, .skeleton { animation: none !important; }
  .hero-stat:hover { transform: none; }
}

/* Google Material Symbols used for the menu item icons (https://fonts.google.com/icons) */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}
.material-symbols-outlined.menu-icon {
  font-size: 1.5rem;
  width: 1.5rem;
  overflow: hidden;
}
.icon-picker-item .material-symbols-outlined,
#icon-picker-preview { font-size: 24px; }
