/* Lowveld Hunters design system (PLAN M0.2). Custom CSS, no framework.

   Brand (Docs/Styles.md): maroon #53090A / #3A1416, gunmetal #2A3439 /
   #2F353B, golden yellow #FEC615. Arial throughout. Admin-template layout:
   dark gunmetal sidebar, light top bar, cards on a warm off-white page.

   Colour tokens are defined once per theme and nowhere else — components
   only ever use var(--…). The dark palette is recomputed, not inverted: gold
   (not maroon) carries links, active states and focus on dark surfaces.

   The logo is the black-and-white crest in a white circle in BOTH themes
   (--logo-badge-bg), until the recoloured SVG arrives.

   Theme resolution: data-theme on <html> wins; with no attribute the
   prefers-color-scheme block applies. The two dark blocks must stay
   identical. */

/* ------------------------------------------------------------------ tokens */

:root {
  --bg: #f7f5f4;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.85);
  --surface-alt: #f1edeb;
  --surface-sunken: #e9e4e1;
  --text: #1c2225;
  --text-muted: #545c61;
  --border: #ddd6d2;
  --border-input: #858c91;
  --primary: #53090a;
  --primary-end: #3a1416;
  --primary-hover: #440708;
  --primary-hover-end: #2c0f10;
  --on-primary: #ffffff;
  --on-primary-muted: #f3d9d9;
  --primary-soft: #f7e6e6;
  --on-primary-soft: #53090a;
  --link: #53090a;
  --accent: #fec615;
  --on-accent: #2a3439;
  --secondary: #2a3439;
  --secondary-dark: #2f353b;
  --on-secondary: #ffffff;
  --on-secondary-muted: #d3d9dc;
  --whatsapp: #25d366;
  --on-whatsapp: #062814;
  --success: #1d6b38;
  --success-soft: #dcefe1;
  --warning: #7a4f00;
  --warning-soft: #fff3c4;
  --danger: #c0262d;
  --danger-soft: #fde7e7;
  --info: #1d5b86;
  --info-soft: #e0eef8;
  --topbar-start: #2a3439;
  --topbar-end: #2f353b;
  --on-topbar: #f2f4f5;
  --on-topbar-muted: #b8c1c6;
  --logo-badge-bg: #ffffff;
  --focus-ring: 0 0 0 3px rgba(83, 9, 10, 0.30);
  --shadow-sm: 0 1px 2px rgba(40, 10, 10, 0.06);
  --shadow: 0 1px 2px rgba(40, 10, 10, 0.05), 0 8px 24px -12px rgba(40, 10, 10, 0.18);
  --shadow-lg: 0 24px 48px -16px rgba(40, 10, 10, 0.28);
  --page-glow: radial-gradient(1200px 520px at 8% -10%, rgba(83, 9, 10, 0.07), transparent 60%),
               radial-gradient(900px 420px at 100% 0%, rgba(254, 198, 21, 0.10), transparent 55%);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231c2225' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  --chart-1: #5e0009;
  --chart-2: #590054;
  --chart-3: #720137;
  --chart-4: #46000d;
  --chart-5: #42002e;
  --chart-highlight: #fec615;
  --chart-neutral: #3c3c50;
  --chart-grid: #e4dfdc;
  --chart-text: #545c61;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #141414;
  --surface: #1d2225;
  --surface-glass: rgba(29, 34, 37, 0.86);
  --surface-alt: #2a3439;
  --surface-sunken: #171a1c;
  --text: #e9ebec;
  --text-muted: #a7afb4;
  --border: #343e43;
  --border-input: #6f7a80;
  --primary: #8a1f20;
  --primary-end: #53090a;
  --primary-hover: #9c2a2b;
  --primary-hover-end: #6a1012;
  --on-primary: #ffffff;
  --on-primary-muted: #f7dede;
  --primary-soft: #3a1416;
  --on-primary-soft: #f7c0c0;
  --link: #fec615;
  --accent: #fec615;
  --on-accent: #2a3439;
  --secondary: #2a3439;
  --secondary-dark: #2f353b;
  --on-secondary: #ffffff;
  --on-secondary-muted: #d3d9dc;
  --whatsapp: #25d366;
  --on-whatsapp: #062814;
  --success: #74d394;
  --success-soft: #173022;
  --warning: #ffd75e;
  --warning-soft: #3a2f08;
  --danger: #ff8a8a;
  --danger-soft: #3d1618;
  --info: #8ac6f0;
  --info-soft: #142a3a;
  --topbar-start: #141414;
  --topbar-end: #2a3439;
  --on-topbar: #f2f4f5;
  --on-topbar-muted: #aab4b9;
  --logo-badge-bg: #ffffff;
  --focus-ring: 0 0 0 3px rgba(254, 198, 21, 0.40);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
  --page-glow: radial-gradient(1200px 520px at 8% -10%, rgba(83, 9, 10, 0.18), transparent 60%),
               radial-gradient(900px 420px at 100% 0%, rgba(254, 198, 21, 0.05), transparent 55%);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23e9ebec' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  --chart-1: #e75563;
  --chart-2: #eb70e4;
  --chart-3: #f19dc5;
  --chart-4: #ed8296;
  --chart-5: #f5b8e2;
  --chart-highlight: #fec615;
  --chart-neutral: #a7afb4;
  --chart-grid: #3c3c3c;
  --chart-text: #a7afb4;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #141414;
    --surface: #1d2225;
    --surface-glass: rgba(29, 34, 37, 0.86);
    --surface-alt: #2a3439;
    --surface-sunken: #171a1c;
    --text: #e9ebec;
    --text-muted: #a7afb4;
    --border: #343e43;
    --border-input: #6f7a80;
    --primary: #8a1f20;
    --primary-end: #53090a;
    --primary-hover: #9c2a2b;
    --primary-hover-end: #6a1012;
    --on-primary: #ffffff;
    --on-primary-muted: #f7dede;
    --primary-soft: #3a1416;
    --on-primary-soft: #f7c0c0;
    --link: #fec615;
    --accent: #fec615;
    --on-accent: #2a3439;
    --secondary: #2a3439;
    --secondary-dark: #2f353b;
    --on-secondary: #ffffff;
    --on-secondary-muted: #d3d9dc;
    --whatsapp: #25d366;
    --on-whatsapp: #062814;
    --success: #74d394;
    --success-soft: #173022;
    --warning: #ffd75e;
    --warning-soft: #3a2f08;
    --danger: #ff8a8a;
    --danger-soft: #3d1618;
    --info: #8ac6f0;
    --info-soft: #142a3a;
    --topbar-start: #141414;
    --topbar-end: #2a3439;
    --on-topbar: #f2f4f5;
    --on-topbar-muted: #aab4b9;
    --logo-badge-bg: #ffffff;
    --focus-ring: 0 0 0 3px rgba(254, 198, 21, 0.40);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
    --page-glow: radial-gradient(1200px 520px at 8% -10%, rgba(83, 9, 10, 0.18), transparent 60%),
                 radial-gradient(900px 420px at 100% 0%, rgba(254, 198, 21, 0.05), transparent 55%);
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23e9ebec' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    --chart-1: #e75563;
    --chart-2: #eb70e4;
    --chart-3: #f19dc5;
    --chart-4: #ed8296;
    --chart-5: #f5b8e2;
    --chart-highlight: #fec615;
    --chart-neutral: #a7afb4;
    --chart-grid: #3c3c3c;
    --chart-text: #a7afb4;
    color-scheme: dark;
  }
}

/* Theme-independent scales. */
:root {
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --radius: 1rem;
  --radius-sm: 0.6rem;
  --radius-pill: 999px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --sidebar-w: 16.5rem;
  --sidebar-mini-w: 4.75rem;
  --topbar-h: 3.75rem;
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-end));
  --gradient-primary-hover: linear-gradient(135deg, var(--primary-hover), var(--primary-hover-end));
  --gradient-secondary: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* -------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--page-glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }
p { margin: 0 0 0.75em; }
a { color: var(--link); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
img { max-width: 100%; }
code { font-size: 0.9em; background: var(--surface-alt); padding: 0.1em 0.35em; border-radius: 4px; }

.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 0.5rem 1rem; border-radius: var(--radius-pill); }
.skip-link:focus { top: 1rem; }

/* ------------------------------------------------------------------- logo */

/* The crest always sits in a white circle, whatever the theme. */
.logo-badge {
  display: inline-grid; place-items: center; flex: none;
  width: var(--logo-size, 2.5rem); aspect-ratio: 1;
  background: var(--logo-badge-bg); border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(254, 198, 21, 0.55), var(--shadow-sm);
  overflow: hidden;
}
.logo-badge img { width: 74%; height: auto; display: block; }

/* --------------------------------------------------------------- app shell */

.app-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--topbar-start), var(--topbar-end));
  color: var(--on-topbar);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: width 0.2s var(--ease), transform 0.25s var(--ease);
}

.app-brand {
  display: flex; align-items: center; gap: 0.75rem;
  height: var(--topbar-h); padding: 0 1rem;
  color: var(--on-topbar); border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: none;
}
.app-brand:hover { text-decoration: none; }
.app-brand .logo-badge { --logo-size: 2.4rem; }
.app-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.app-brand-text strong { font-size: 1rem; white-space: nowrap; }
.app-brand-text span { font-size: 0.72rem; color: var(--on-topbar-muted); font-weight: 400; white-space: nowrap; }

.sidebar-user {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--on-topbar);
}
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sidebar-user-text strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-text span { font-size: 0.75rem; color: var(--on-topbar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 2.35rem; height: 2.35rem; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 0.85rem;
}

.side-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0.6rem 1.5rem; scrollbar-width: thin; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-header {
  margin: 1rem 0.65rem 0.4rem; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-topbar-muted);
  white-space: nowrap;
}
.nav-link, .nav-group > summary {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.7rem; margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--on-topbar-muted); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; white-space: nowrap; list-style: none;
  transition: background 0.15s, color 0.15s;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-link i, .nav-group > summary > i:first-child { width: 1.25rem; text-align: center; font-size: 1rem; flex: none; }
.nav-link:hover, .nav-group > summary:hover { background: rgba(255, 255, 255, 0.07); color: var(--on-topbar); text-decoration: none; }
.nav-link.active {
  background: rgba(254, 198, 21, 0.13); color: var(--on-topbar);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-link.active i { color: var(--accent); }
.nav-group > summary .nav-chevron { margin-left: auto; font-size: 0.7rem; transition: transform 0.2s; }
.nav-group[open] > summary { color: var(--on-topbar); }
.nav-group[open] > summary .nav-chevron { transform: rotate(90deg); }
.nav-group ul { padding-left: 0.6rem; }
.nav-group ul .nav-link { font-weight: 500; font-size: 0.86rem; }
.nav-group ul .nav-link i { font-size: 0.6rem; }
.nav-badge {
  margin-left: auto; min-width: 1.5rem; padding: 0.05rem 0.45rem; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--on-accent); font-size: 0.72rem; font-weight: 700; text-align: center;
}

.sidebar-footer { padding: 0.75rem 1rem; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 0.75rem; color: var(--on-topbar-muted); white-space: nowrap; overflow: hidden; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.2s var(--ease); }

.app-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.75rem;
  height: var(--topbar-h); padding: 0 1.25rem;
  background: var(--surface-glass); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 0.4rem; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 1.05rem;
}
.icon-btn:hover { background: var(--surface-alt); }
.icon-badge {
  position: absolute; top: 0.2rem; right: 0.1rem; min-width: 1.1rem; height: 1.1rem; padding: 0 0.25rem;
  border-radius: var(--radius-pill); background: var(--danger); color: var(--surface);
  font-size: 0.65rem; font-weight: 700; display: grid; place-items: center;
}

.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; padding: 0; font-size: 0.88rem; }
.breadcrumbs li + li::before { content: "/"; color: var(--text-muted); margin-right: 0.4rem; }
.breadcrumbs a { color: var(--text-muted); font-weight: 500; }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

.topbar-user { display: flex; align-items: center; gap: 0.6rem; padding-left: 0.5rem; margin-left: 0.25rem; border-left: 1px solid var(--border); }
.topbar-user .avatar { width: 2.1rem; height: 2.1rem; font-size: 0.78rem; }
.topbar-user-text { display: flex; flex-direction: column; line-height: 1.2; font-size: 0.82rem; }
.topbar-user-text span { color: var(--text-muted); font-size: 0.74rem; }

.app-container { width: 100%; max-width: 92rem; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; flex: 1; }
.app-footer { padding: 1rem 1.25rem; font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Mini sidebar (desktop toggle): icons only. */
body.sidebar-mini { --sidebar-w: var(--sidebar-mini-w); }
body.sidebar-mini .app-sidebar .app-brand-text,
body.sidebar-mini .app-sidebar .sidebar-user-text,
body.sidebar-mini .app-sidebar .nav-link span,
body.sidebar-mini .app-sidebar .nav-group > summary span,
body.sidebar-mini .app-sidebar .nav-chevron,
body.sidebar-mini .app-sidebar .nav-badge,
body.sidebar-mini .app-sidebar .nav-header,
body.sidebar-mini .app-sidebar .sidebar-footer,
body.sidebar-mini .app-sidebar .nav-group ul { display: none; }
body.sidebar-mini .app-brand, body.sidebar-mini .sidebar-user { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-mini .nav-link, body.sidebar-mini .nav-group > summary { justify-content: center; padding: 0.65rem 0; }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(10, 10, 10, 0.5); }

@media (max-width: 960px) {
  .app-sidebar { transform: translateX(-100%); width: var(--sidebar-w); box-shadow: var(--shadow-lg); }
  body.sidebar-mini { --sidebar-w: 16.5rem; }
  body.sidebar-open .app-sidebar { transform: none; }
  .app-main { margin-left: 0; }
  .topbar-user-text, .breadcrumbs li:not(:last-child), .breadcrumbs li + li::before { display: none; }
}

/* ------------------------------------------------------------ page layout */

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; }
.page-header .subtitle { margin: 0.25rem 0 0; color: var(--text-muted); }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.grid { display: grid; gap: 1.25rem; }
.grid + .grid, .grid + .card, .card + .grid { margin-top: 1.25rem; }
.grid-tiles { grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-main-side { grid-template-columns: minmax(0, 1fr); } }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .span-2 { grid-column: auto; } }

.stack > * + * { margin-top: 0.75rem; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem; min-width: 0;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: -0.25rem 0 1rem; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.02rem; }
.card-header .muted { font-size: 0.82rem; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-header { margin: 0; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 1.15rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border-input); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 700; font-size: 0.9rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--surface-alt); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gradient-primary); border-color: transparent; color: var(--on-primary); box-shadow: 0 6px 16px -8px rgba(83, 9, 10, 0.6); }
.btn-primary:hover { background: var(--gradient-primary-hover); }
.btn-secondary { background: var(--gradient-secondary); border-color: transparent; color: var(--on-secondary); }
.btn-secondary:hover { background: var(--secondary-dark); }
.btn-accent { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn-accent:hover { background: #f0b800; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--primary-soft); color: var(--on-primary-soft); }
.btn-sm { padding: 0.38rem 0.8rem; font-size: 0.82rem; }
.btn-block { display: flex; width: 100%; }

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.6rem; border-radius: var(--radius-pill);
  font-size: 0.76rem; font-weight: 700; line-height: 1.4; white-space: nowrap;
  background: var(--surface-alt); color: var(--text-muted);
}
.badge-primary { background: var(--primary-soft); color: var(--on-primary-soft); }
.badge-accent { background: var(--accent); color: var(--on-accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }

/* ---------------------------------------------------------------- alerts */

.alert { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.8rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; }
.alert > i { margin-top: 0.2rem; }
.alert p { margin: 0; }
.alert strong { display: block; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-list { display: grid; gap: 0.6rem; }

/* ----------------------------------------------------------------- forms */

label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 0.35rem; }
input, select, textarea {
  width: 100%; padding: 0.65rem 0.95rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-input); border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
input[type="checkbox"] { width: auto; accent-color: var(--primary); }
.form-row { margin-bottom: 1rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.form-check label { margin: 0; font-weight: 500; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon input { padding-left: 2.6rem; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data-table th {
  text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); background: var(--surface-alt);
  padding: 0.6rem 1rem; white-space: nowrap;
}
table.data-table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tbody tr:last-child td { border-bottom: 0; }
table.data-table tbody tr:hover { background: var(--surface-alt); }

/* ------------------------------------------------- stat tiles (members) */

/* Admin-template "small box": a coloured tile with a big number, a label,
   a watermark icon and a footer link. Colours fixed per variant so the text
   contrast holds in both themes. */
.stat-tile {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column;
  border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--gradient-primary); color: var(--on-primary);
  min-height: 9.5rem;
}
.stat-tile .stat-body { padding: 1.1rem 1.25rem 0.75rem; flex: 1; }
.stat-tile .stat-value { font-size: 2.2rem; font-weight: 700; line-height: 1.05; }
.stat-tile .stat-value small { font-size: 1rem; font-weight: 700; }
.stat-tile .stat-label { margin: 0.35rem 0 0; font-weight: 700; }
.stat-tile .stat-meta { margin: 0.3rem 0 0; font-size: 0.82rem; color: var(--on-primary-muted); }
.stat-tile .stat-icon { position: absolute; right: 0.9rem; top: 0.8rem; font-size: 3.6rem; opacity: 0.16; z-index: -1; transition: transform 0.3s var(--ease); }
.stat-tile:hover .stat-icon { transform: scale(1.08) rotate(-4deg); }
.stat-tile .stat-footer {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.45rem; font-size: 0.82rem; font-weight: 700;
  background: rgba(0, 0, 0, 0.18); color: inherit;
}
.stat-tile .stat-footer:hover { background: rgba(0, 0, 0, 0.28); text-decoration: none; }
.stat-tile-secondary { background: var(--gradient-secondary); color: var(--on-secondary); }
.stat-tile-secondary .stat-meta { color: var(--on-secondary-muted); }
.stat-tile-accent { background: linear-gradient(135deg, #fec615, #f3b300); color: var(--on-accent); }
.stat-tile-accent .stat-meta { color: var(--on-accent); }
.stat-tile-accent .stat-footer { background: rgba(42, 52, 57, 0.12); }
.stat-tile-light { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.stat-tile-light .stat-meta { color: var(--text-muted); }
.stat-tile-light .stat-footer { background: var(--surface-alt); color: var(--link); }

/* Breakdown chips inside a tile ("4 active · 1 attention"). */
.stat-split { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.stat-split span { padding: 0.1rem 0.5rem; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.16); font-size: 0.75rem; font-weight: 700; }
.stat-tile-accent .stat-split span { background: rgba(42, 52, 57, 0.12); }
.stat-tile-light .stat-split span { background: var(--surface-alt); }

/* ---------------------------------------------------- KPI cards (admin) */

.kpi { display: flex; gap: 0.9rem; align-items: flex-start; }
.kpi-icon {
  display: grid; place-items: center; flex: none;
  width: 3rem; height: 3rem; border-radius: 0.9rem;
  background: var(--primary-soft); color: var(--on-primary-soft); font-size: 1.2rem;
}
.kpi-icon.is-secondary { background: var(--surface-alt); color: var(--text); }
.kpi-icon.is-accent { background: var(--accent); color: var(--on-accent); }
.kpi-icon.is-success { background: var(--success-soft); color: var(--success); }
.kpi-icon.is-warning { background: var(--warning-soft); color: var(--warning); }
.kpi-icon.is-danger { background: var(--danger-soft); color: var(--danger); }
.kpi-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.kpi-label { margin: 0.15rem 0 0.35rem; color: var(--text-muted); font-size: 0.86rem; font-weight: 600; }
.trend { font-size: 0.76rem; font-weight: 700; }
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

.progress { height: 0.5rem; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--gradient-primary); }
.progress.is-accent > span { background: var(--accent); }
.progress.is-success > span { background: var(--success); }

/* ----------------------------------------------------------------- charts */

.chart-box { position: relative; height: 18rem; }
.chart-box.is-short { height: 14rem; }
.chart-box canvas { max-width: 100%; }

/* --------------------------------------------------- ring (points meter) */

.ring { position: relative; width: 7.5rem; height: 7.5rem; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-track { stroke: var(--surface-sunken); }
.ring .ring-value { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label strong { font-size: 1.6rem; }
.ring-label span { font-size: 0.75rem; color: var(--text-muted); }

/* ----------------------------------------------------- hero / carousel */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-height: 23rem; background: var(--secondary); color: #ffffff;
}
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, center); display: block; transform: scale(1.04); }
.hero-slide.is-active img { animation: kenburns 9s ease-out both; }
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1.02); } }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 6, 6, 0.86) 0%, rgba(12, 6, 6, 0.55) 45%, rgba(12, 6, 6, 0.05) 80%),
              linear-gradient(0deg, rgba(12, 6, 6, 0.6), transparent 45%);
}
.hero-content { position: relative; z-index: 2; padding: 2rem 2rem 4.25rem; max-width: 40rem; }
.hero-content .eyebrow { color: var(--accent); }
.hero-content .hero-title { font-size: 2rem; margin: 0.25rem 0 0.4rem; color: #ffffff; }
.hero-content p { color: #ebe6e4; font-size: 1.02rem; }
.hero-caption { min-height: 3.2rem; }
.hero-caption p { margin: 0; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.9rem 0 1.1rem; }
.hero-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22); font-size: 0.8rem; font-weight: 700; color: #ffffff; backdrop-filter: blur(4px); }
.hero-chip.is-gold { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hero-controls { position: absolute; z-index: 3; left: 2rem; right: 1.25rem; bottom: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.hero-dots { display: flex; gap: 0.4rem; margin-right: auto; }
.hero-dot { width: 0.65rem; height: 0.65rem; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.45); cursor: pointer; transition: width 0.25s, background 0.25s; }
.hero-dot[aria-current="true"] { width: 1.8rem; border-radius: var(--radius-pill); background: var(--accent); }
.hero-btn { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.35); color: #ffffff; cursor: pointer; }
.hero-btn:hover { background: rgba(0, 0, 0, 0.55); }
.hero-credit { position: absolute; z-index: 3; right: 1rem; top: 0.8rem; font-size: 0.7rem; color: rgba(255, 255, 255, 0.85); background: rgba(0, 0, 0, 0.35); padding: 0.15rem 0.5rem; border-radius: var(--radius-pill); }
@media (max-width: 640px) {
  .hero { min-height: 25rem; }
  .hero-content { padding: 2.6rem 1.25rem 4.25rem; }
  .hero-content .hero-title { font-size: 1.55rem; }
  .hero-controls { left: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-slide.is-active img, .stat-tile .stat-icon { transition: none; animation: none; }
}

.eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.74rem; font-weight: 700; margin: 0; color: var(--text-muted); }

/* ---------------------------------------------------- status strip / list */

.status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: 0; }
.status-strip > div { padding: 1rem 1.25rem; border-right: 1px solid var(--border); }
.status-strip > div:last-child { border-right: 0; }
.status-strip dt { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; }
.status-strip dd { margin: 0.25rem 0 0; font-weight: 700; font-size: 1.02rem; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
@media (max-width: 700px) { .status-strip > div { border-right: 0; border-bottom: 1px solid var(--border); } }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 0.85rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list > li:first-child { padding-top: 0; }
.list-icon { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: 0.75rem; background: var(--primary-soft); color: var(--on-primary-soft); }
.list-body { flex: 1; min-width: 0; }
.list-body strong { display: block; font-size: 0.92rem; }
.list-body span { font-size: 0.8rem; color: var(--text-muted); }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(7.25rem, 100%), 1fr)); gap: 0.75rem; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center;
  padding: 1rem 0.5rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 0.85rem; font-weight: 700;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.quick-action i { font-size: 1.3rem; color: var(--link); }
.quick-action:hover { transform: translateY(-2px); border-color: var(--link); box-shadow: var(--shadow); text-decoration: none; }

.demo-flag { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ------------------------------------------------------------- auth pages */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: 2.5rem 3rem; color: #ffffff;
  background: radial-gradient(900px 600px at 20% 10%, rgba(254, 198, 21, 0.16), transparent 60%),
              linear-gradient(150deg, #53090a 0%, #3a1416 55%, #2a3439 100%);
}
.auth-art::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.12;
  background-image: repeating-radial-gradient(circle at 75% 85%, transparent 0 22px, rgba(255, 255, 255, 0.55) 23px 24px);
}
.auth-art .logo-badge { --logo-size: 8.5rem; box-shadow: 0 0 0 4px rgba(254, 198, 21, 0.75), 0 20px 50px -15px rgba(0, 0, 0, 0.6); }
.auth-art h2 { font-size: 2rem; margin: 1.5rem 0 0.4rem; color: #ffffff; max-width: 26rem; }
.auth-art .auth-af { color: #f0d9d9; font-style: italic; margin: 0; }
.auth-art .auth-tagline { margin-top: 1.25rem; font-size: 1.05rem; color: #f3e7e7; max-width: 30rem; }
.auth-facts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.auth-facts span { padding: 0.3rem 0.75rem; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.78rem; font-weight: 700; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem clamp(1.25rem, 5vw, 4.5rem); position: relative; }
.auth-panel .auth-top { position: absolute; top: 1.25rem; right: 1.25rem; }
.auth-form { width: 100%; max-width: 25rem; margin: 0 auto; }
.auth-form h1 { margin-bottom: 0.3rem; }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; font-size: 0.88rem; }
.divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0 1rem; color: var(--text-muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-logins { display: grid; gap: 0.6rem; }
.demo-login {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; text-align: left;
  padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.demo-login:hover { border-color: var(--link); box-shadow: var(--shadow); transform: translateY(-1px); }
.demo-login .list-icon { width: 2.6rem; height: 2.6rem; }
.demo-login strong { display: block; font-size: 0.92rem; }
.demo-login span { font-size: 0.8rem; color: var(--text-muted); }
.demo-login .fa-arrow-right { margin-left: auto; color: var(--text-muted); }
.auth-footer { margin-top: 1.75rem; font-size: 0.82rem; color: var(--text-muted); text-align: center; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 1.5rem 1.25rem; flex-direction: row; align-items: center; gap: 1rem; }
  .auth-art .logo-badge { --logo-size: 4.25rem; }
  .auth-art h2 { font-size: 1.15rem; margin: 0 0 0.15rem; }
  .auth-art .auth-af { font-size: 0.8rem; }
  .auth-art .auth-tagline, .auth-facts { display: none; }
  .auth-panel { padding-top: 2rem; }
  .auth-panel .auth-top { top: 0.75rem; right: 0.75rem; }
}
