/* Rukukwe portal design tokens.
   The Gentelella v4 design system (the "Rukukwe system redesign" Claude Design project, #276), copied from its
   tokens/colors.css, tokens/typography.css and tokens/spacing.css so the portal and the design stay in step. Light
   is the default; dark swaps the same roles via [data-theme="dark"] on <html>.

   The second half maps the portal's own token names (--surface-*, --ink-*, --primary-soft, the status pairs, the
   type scale, radii and shadows) onto the Gentelella values, so every component written against those names shifts
   with the shell without being rewritten. Change a value here only by changing it in the design system first. */

/* Inter Tight (#381), bundled with the portal so no page fetches from another host. Licence: /fonts/OFL.txt. */
@font-face { font-family: 'Inter Tight'; src: url('../../fonts/inter-tight-latin-wght.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ---- Gentelella: colours (tokens/colors.css) ----------------------------------------------- */
:root {
    --sidebar-bg: #1a2332; --sidebar-hover: rgba(255,255,255,0.04); --sidebar-active: rgba(26,187,156,0.08);
    --sidebar-text: #7b8fa3; --sidebar-text-hover: #c5d0dc; --sidebar-text-active: #ffffff; --sidebar-border: rgba(255,255,255,0.06);
    --primary: #1ABB9C; --primary-lt: rgba(26,187,156,0.06); --primary-dk: #169f85;
    --body-bg: #f5f7fb; --bg-surface: #ffffff; --bg-surface-secondary: #f9fafb;
    --border-color: #e6e7eb; --border-color-light: #eff0f3; --border-translucent: rgba(4,32,69,0.08);
    --text: #1e2633; --text-secondary: #626d7d; --text-muted: #7e8896; --text-disabled: #c0c7cf;
    --blue: #066fd1; --azure: #4299e1; --green: #2fb344; --lime: #74b816; --yellow: #f59f00; --orange: #f76707;
    --red: #d63939; --pink: #d6336c; --purple: #ae3ec9; --indigo: #4263eb; --cyan: #17a2b8;
    --green-lt: rgba(47,179,68,0.06); --red-lt: rgba(214,57,57,0.06); --yellow-lt: rgba(245,159,0,0.06); --blue-lt: rgba(6,111,209,0.06);
    --azure-lt: rgba(66,153,225,0.06); --purple-lt: rgba(174,62,201,0.06); --cyan-lt: rgba(23,162,184,0.06);
    /* hover/pressed shades used by solid buttons and avatar gradients */
    --green-dk: #1a8a32; --yellow-dk: #c97f00; --red-dk: #a82b2b; --blue-dk: #0550a0; --purple-dk: #8a2da0;
    /* semantic aliases */
    --accent: var(--primary); --surface-subtle: var(--bg-surface-secondary);
    --text-body: var(--text-secondary); --text-heading: var(--text);
    --status-success: var(--green); --status-warning: var(--yellow); --status-danger: var(--red); --status-info: var(--blue);
    --overlay: rgba(15,23,42,0.45);
}

[data-theme="dark"] {
    --body-bg: #0f1623; --bg-surface: #1a2332; --bg-surface-secondary: #141d2b;
    --border-color: rgba(255,255,255,0.08); --border-color-light: rgba(255,255,255,0.05); --border-translucent: rgba(255,255,255,0.08);
    --text: #e6ebf2; --text-secondary: #b3bccb; --text-muted: #8a93a3; --text-disabled: #5a6473;
    --primary-lt: rgba(26,187,156,0.14); --green-lt: rgba(47,179,68,0.16); --red-lt: rgba(214,57,57,0.16); --yellow-lt: rgba(245,159,0,0.16);
    --blue-lt: rgba(6,111,209,0.18); --azure-lt: rgba(66,153,225,0.16); --purple-lt: rgba(174,62,201,0.16); --cyan-lt: rgba(23,162,184,0.16);
    --shadow: rgba(0,0,0,0.4) 0 2px 4px 0; --shadow-card: 0 0 0 1px var(--border-translucent), rgba(0,0,0,0.3) 0 2px 4px 0;
}

/* ---- Gentelella: type (tokens/typography.css) ---------------------------------------------- */
:root {
    --font: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', monospace;
    --font-size: 1.05rem; --line-height: 1.4286;
    --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-bold: 600;
    --fs-micro: 12px; --fs-label: 13px; --fs-caption: 14px; --fs-small: 14.5px; --fs-ui: 15px; --fs-body: 15.5px; --fs-base: 17px;
    --fs-h4: 18px; --fs-title: 21.5px; --fs-auth: 24px; --fs-stat: 26.5px; --fs-chart: 29px; --fs-error: 115px;
}

/* ---- Gentelella: spacing, radius, elevation, layout, motion (tokens/spacing.css) ----------- */
/* The spacing steps keep the portal's own scale (4, 8, 12, 16, 20, 24, 32), which every component is written
   against; Gentelella's values are off that grid at the larger steps and would stretch every page. */
:root {
    --radius: 6px; --radius-sm: 4px; --radius-lg: 8px;
    --shadow: rgba(30,38,51,0.04) 0 2px 4px 0;
    --shadow-card: 0 0 0 1px var(--border-translucent), rgba(30,38,51,0.04) 0 2px 4px 0;
    --shadow-popover: 0 8px 24px rgba(15,23,42,0.12), 0 0 0 1px var(--border-translucent);
    --shadow-modal: 0 24px 48px rgba(15,23,42,0.18), 0 0 0 1px var(--border-translucent);
    --sidebar-w: 252px; --topbar-h: 56px;
    --ease: cubic-bezier(0.2, 0, 0, 1);
    --dur-fast: 120ms; --dur: 180ms; --dur-slow: 220ms;
}

/* ---- the portal's token names, on the Gentelella values ------------------------------------ */
/* Surfaces, borders and ink. Hover moves one surface step; borders come before shadows. */
:root {
    --surface-page: var(--body-bg);
    --surface-app: var(--body-bg);
    --surface-card: var(--bg-surface);
    --surface-sunken: var(--bg-surface-secondary);
    --surface-hover: var(--border-color-light);
    --surface-inverse: var(--sidebar-bg);

    --border: var(--border-color);
    --border-strong: #d1d5db;

    --ink: var(--text);
    --ink-secondary: var(--text-secondary);
    --ink-muted: var(--text-muted);
    --ink-disabled: var(--text-disabled);
    --ink-on-primary: #FFFFFF;
    --ink-inverse: #FFFFFF;

    /* Primary: one brand colour. A tenant's own accent overrides --primary (and its two shades) on the shell frame. */
    --primary-hover: var(--primary-dk);
    --primary-press: var(--primary-dk);
    --primary-soft: var(--primary-lt);
    --primary-soft-ink: var(--primary);

    /* Status: a 6% tint behind coloured text, never a solid fill. */
    --success: var(--green); --success-soft: var(--green-lt); --success-ink: var(--green);
    --danger: var(--red); --danger-hover: var(--red-dk); --danger-soft: var(--red-lt); --danger-ink: var(--red);
    --warning: var(--yellow); --warning-soft: var(--yellow-lt); --warning-ink: #b45309;
    --info: var(--blue); --info-soft: var(--blue-lt); --info-ink: var(--blue);
    --neutral-soft: var(--bg-surface-secondary); --neutral-ink: var(--text-secondary);

    /* Charts: use in order */
    --chart-1: var(--primary);
    --chart-2: var(--azure);
    --chart-3: var(--yellow);
    --chart-4: var(--purple);
    --chart-grid: var(--border-color-light);
}

[data-theme="dark"] {
    --surface-inverse: #e6ebf2;
    --border-strong: rgba(255,255,255,0.14);
    --warning-ink: #f8c48e;
    --ink-inverse: #16181D;
}

/* Type: Inter Tight (#381), 14px base, but the UI mostly runs at 11 to 13px; titles are small. */
:root {
    --font-sans: var(--font);
    --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700;

    --page-title-size: 21.5px; --page-title-lh: 29px; --page-title-weight: 600; --page-title-tracking: -0.2px;
    --stat-value-size: 26.5px; --stat-value-lh: 33.5px; --stat-value-weight: 600; --stat-value-tracking: -0.5px;
    --section-title-size: 15.5px; --section-title-lh: 24px; --section-title-weight: 600;
    --body-size: 17px; --body-lh: 24px;
    --small-size: 15.5px; --small-lh: 21.5px;
    --caption-size: 14.5px; --caption-lh: 19px;
    --overline-size: 13px; --overline-lh: 19px; --overline-tracking: 0.4px;

    --text-page-title: var(--page-title-weight) var(--page-title-size)/var(--page-title-lh) var(--font-sans);
    --text-stat-value: var(--stat-value-weight) var(--stat-value-size)/var(--stat-value-lh) var(--font-sans);
    --text-section-title: var(--section-title-weight) var(--section-title-size)/var(--section-title-lh) var(--font-sans);
    --text-body: 400 var(--body-size)/var(--body-lh) var(--font-sans);
    --text-body-medium: 500 var(--body-size)/var(--body-lh) var(--font-sans);
    --text-small: 400 var(--small-size)/var(--small-lh) var(--font-sans);
    --text-caption: 400 var(--caption-size)/var(--caption-lh) var(--font-sans);
    --text-caption-medium: 500 var(--caption-size)/var(--caption-lh) var(--font-sans);
    --text-overline: 600 var(--overline-size)/var(--overline-lh) var(--font-sans);
    --text-card-title: var(--text-section-title);
}

/* Spacing and layout. The 4px scale, with the half steps the components already use. */
:root {
    --space-0: 0; --space-0-5: 2px; --space-1: 4px; --space-1-5: 6px; --space-2: 8px; --space-2-5: 10px;
    --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
    --space-12: 48px; --space-16: 64px;

    --sidebar-width: var(--sidebar-w);
    --sidebar-rail-width: 64px;
    --topbar-height: var(--topbar-h);
    --nav-item-height: 32px;
    --table-row-height: 44px;
    --control-height-sm: 28px; --control-height-md: 36px; --control-height-lg: 38px;
    --button-height-sm: 28px; --button-height-md: 32px; --button-height-lg: 38px;
    --icon-nav: 18px; --icon-button: 14px; --icon-well: 40px;
    --main-padding: 20px 24px 40px;
    --grid-gap: var(--space-4);
    --card-padding: var(--space-4);
}

/* Corners: 4px on controls and nav rows, 6px on banners and icon tiles, 8px on cards. */
:root {
    --radius-md: var(--radius-sm);
    --radius-xl: var(--radius-lg);
    --radius-2xl: 10px;
    --radius-full: 9999px;
}

/* Elevation: cards are a border and an almost invisible shadow; floating layers get a real one. */
:root {
    --shadow-none: none;
    --shadow-xs: var(--shadow);
    --shadow-sm: var(--shadow-card);
    --shadow-md: var(--shadow-popover);
    --shadow-lg: var(--shadow-modal);
    --shadow-focus: 0 0 0 3px var(--primary-lt), 0 0 0 1px var(--primary);
    --overlay-scrim: var(--overlay);
}

/* Motion: quick and quiet, no bounces. */
:root {
    --ease-standard: var(--ease);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --duration-fast: var(--dur-fast);
    --duration-base: var(--dur);
    --duration-slow: var(--dur-slow);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
