/* =============================================================================
   Shopigrator - dark theme
   Loaded after app.css by App.razor, with a media query chosen from the "ts-theme" cookie:
   "dark" → screen, "system" → screen and (prefers-color-scheme: dark), "light" → never.
   Print never uses it, and the print views (…/print) never load it.

   How it works: the light theme already styles everything through the --rz-base-* scale (50 = card
   surface, 100 = page, 200 = borders, 600 = secondary text, 900 = titles). Dark mode keeps those roles and
   swaps the values, so 50 is a raised charcoal surface and 900 is near-white text. Radzen's standard-base.css
   stays loaded; only the few Radzen tokens that hard-code white or light grey are restated here.
   Brand: charcoal stays the identity colour (sidebar, auth panel). On dark surfaces primary fills use a
   lifted Polaris green, and primary text (--ts-blue) is a light mint so it keeps contrast.
   ============================================================================= */

:root {
    color-scheme: dark;

    /* Chart series, the same hues stepped for the dark card surface #1f1f1f (validated). */
    --ts-series-1: #338ced;
    --ts-series-2: #e76624;

    /* Brand */
    --ts-blue: #6fd4a8;          /* primary as text/icon on dark surfaces */
    --ts-blue-600: #00916b;
    --ts-blue-700: #b5ebd2;      /* strong primary text (info pills, summary titles) */
    --ts-blue-400: #3fbf92;
    --ts-blue-50: #12352a;       /* primary tint: hover rows, icon chips */
    --ts-navy: #0b0b0b;
    --ts-navy-2: #151515;

    /* Status */
    --ts-ok: #4cc06d;
    --ts-alert: #f06262;
    --ts-offline: #8a8a8a;

    --ts-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --ts-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.35);

    /* ---- Radzen token overrides ---- */
    --rz-base-50: #1f1f1f;       /* cards, dialogs, inputs */
    --rz-base-100: #141414;      /* page */
    --rz-base-200: #2e2e2e;      /* borders, subtle fills */
    --rz-base-300: #383838;
    --rz-base-400: #4f4f4f;
    --rz-base-500: #7a7a7a;
    --rz-base-600: #a6a6a6;      /* secondary text */
    --rz-base-700: #c4c4c4;
    --rz-base-800: #dcdcdc;      /* body text */
    --rz-base-900: #f2f2f2;      /* titles */
    --rz-white: #ffffff;
    --rz-base-background-color: var(--rz-base-50);

    --rz-primary: #00916b;
    --rz-primary-light: #2fb38a;
    --rz-primary-lighter: rgba(47, 179, 138, 0.2);
    --rz-primary-dark: #007e5d;
    --rz-primary-darker: #006b4f;
    --rz-on-primary-lighter: #b5ebd2;

    --rz-secondary: #8a8a8a;
    --rz-secondary-light: #a6a6a6;
    --rz-secondary-lighter: rgba(166, 166, 166, 0.2);
    --rz-secondary-dark: #6e6e6e;
    --rz-secondary-darker: #5c5c5c;
    --rz-on-secondary-lighter: #e0e0e0;

    --rz-info: #3d9be0;
    --rz-info-lighter: rgba(61, 155, 224, 0.18);
    --rz-on-info-lighter: #a9d4f5;

    --rz-success-lighter: rgba(79, 167, 123, 0.2);
    --rz-success-darker: #6fd08d;
    --rz-on-success-lighter: #8fe0a8;

    --rz-warning-lighter: rgba(255, 175, 3, 0.18);
    --rz-warning-darker: #ffc94d;
    --rz-on-warning-lighter: #ffd27a;

    --rz-danger: #e04848;
    --rz-danger-light: #ef6b6b;
    --rz-danger-lighter: rgba(240, 98, 98, 0.18);
    --rz-danger-dark: #c62828;
    --rz-danger-darker: #ff9d9d;
    --rz-on-danger-lighter: #ff9d9d;

    --rz-link-color: var(--ts-blue);
    --rz-link-hover-color: var(--rz-base-900);

    --rz-header-background-color: rgba(20, 20, 20, 0.92);
    --rz-header-border: 1px solid var(--rz-base-200);
    --rz-card-background-color: var(--rz-base-50);
    --rz-grid-background-color: var(--rz-base-50);
    --rz-grid-stripe-background-color: var(--rz-base-50);
    --rz-grid-header-background-color: #191919;

    --rz-button-base-background-color: var(--rz-base-200);
    --rz-button-base-color: var(--rz-base-800);
    --rz-input-focus-shadow: 0 0 0 1px var(--rz-base-50), 0 0 0 3px rgba(47, 179, 138, 0.45);
    --rz-checkbox-checked-color: var(--rz-on-primary);
    --rz-switch-background-color: var(--rz-base-400);
    --rz-tooltip-background-color: #000000;
    --rz-dialog-mask-background-color: #000000;
    --rz-scrollbar-color: rgba(166, 166, 166, 0.45);
    --rz-skeleton-background-color: var(--rz-base-200);
    --rz-skeleton-animation-color: var(--rz-base-300);
    --rz-progressbar-background-color: var(--rz-base-200);
    --rz-chart-axis-color: var(--rz-base-400);
    --rz-shadow-1: 0 0 2px 0 rgba(0, 0, 0, 0.3), 0 2px 2px rgba(0, 0, 0, 0.3);
    --rz-shadow-2: 0 0 2px 0 rgba(0, 0, 0, 0.3), 0 2px 2px rgba(0, 0, 0, 0.3), 0 4px 12px 0 rgba(0, 0, 0, 0.25);
    --rz-shadow-3: 0 0 4px 0 rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
    --rz-overlay-shadow: var(--rz-shadow-3);
    --rz-card-shadow: var(--ts-shadow-sm);
}

/* ---- Rules whose light colours are literals in app.css ---- */
.ts-header.rz-header { background: rgba(20, 20, 20, 0.92); }
.ts-sidebar.rz-sidebar { border-inline-end: 1px solid rgba(255, 255, 255, 0.06); }
.ts-mask { background: rgba(0, 0, 0, 0.55); }
.ts-savebar { background: rgba(31, 31, 31, 0.95); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35); }
.ts-tabbar { box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35); }
.ts-settings-summary { border-color: rgba(111, 212, 168, 0.25); }
.ts-pill--offline { background: var(--rz-base-200); color: var(--rz-base-700); }
.rz-grid-table tbody tr.rz-data-row.ts-row-warn:hover > td { background: rgba(255, 175, 3, 0.28); }
.rz-grid-table tbody tr.rz-data-row.ts-row-danger:hover > td { background: rgba(240, 98, 98, 0.28); }
.ts-effort-grid .ts-effort-row-item > td { background: #141c30; }
.auth-panel { border-inline-end: 1px solid rgba(255, 255, 255, 0.06); }

/* Radzen's HTML editor and Azure DevOps HTML keep authored colours; give them a readable surface. */
.rz-html-editor-content { background: var(--rz-base-50); color: var(--rz-text-color); }

/* ---- Delivery plans (roadmap) ---- */
.ts-rm-sw i { border-color: rgba(255, 255, 255, 0.18); }
.ts-rm-tray { background: rgba(255, 175, 3, 0.08); border-top-color: rgba(255, 175, 3, 0.25); color: #f3cf7c; }
.ts-rm-tray b { color: #ffe1a1; }
.ts-rm-tray-item { border-color: rgba(217, 184, 102, 0.6); }
.ts-tl-hrow--year .ts-tl-cell { background: #2c4a78; border-left-color: rgba(255, 255, 255, 0.15); text-shadow: none; }
.ts-tl-hrow--quarter .ts-tl-cell { background: #070b14; border-left-color: #2e2e2e; }
.ts-tl-grid { background: #1c2540; }
.ts-tl-grid--q { background: #2b3757; }
.ts-tl-group, .ts-tl-group .ts-tl-lab { background: #12302f; }
.ts-tl-group { border-bottom-color: #1f4a47; }
.ts-tl-group .ts-tl-lab { color: #8fd6cb; }
.ts-tl-lane--track, .ts-tl-lane--track .ts-tl-lab { background: #1a1d24; }
.ts-tl-src, .ts-store--ours { color: #ffd27a; background: rgba(255, 175, 3, 0.16); }
.ts-tl-warn { color: #ffc94d; background: rgba(255, 175, 3, 0.16); }
/* Work item bars keep Azure DevOps' own (light) type colours with dark text, as in Azure DevOps. */
.ts-tl-bar { border-color: rgba(0, 0, 0, 0.35); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.ts-tl-bar:hover { box-shadow: 0 0 0 2px rgba(111, 212, 168, 0.55); }
.ts-tl-link { stroke: #8a8a8a; }
.ts-tl-rollup { background: rgba(0, 0, 0, 0.25); }
.ts-panel-note { background: rgba(47, 179, 138, 0.14); border-color: rgba(47, 179, 138, 0.3); color: #b5ebd2; }
.ts-panel-note--ours { background: rgba(255, 175, 3, 0.1); border-color: rgba(255, 175, 3, 0.3); color: #ffd27a; }
.ts-rm-span { background: var(--rz-base-200); }
/* Project KPI vs Budget tab: lifted navy / slate series so bars keep contrast on dark panels. */
.ts-kpi {
    --ts-kpi-c1: #2fb38a;
    --ts-kpi-c2: #555555;
    --ts-kpi-c3: #6fd4a8;
    --ts-kpi-c4: #b5ebd2;
    --ts-kpi-c5: #8d91b9;
    --ts-kpi-c6: #34405f;
    --ts-kpi-t1: #2fb38a;
    --ts-kpi-t2: #4fb3a6;
    --ts-kpi-t3: #e0b354;
    --ts-kpi-t4: #a6a6a6;
    --ts-kpi-t5: #8e9bb0;
    --ts-kpi-t6: #d98763;
    --ts-kpi-age5: #e06060;
}

/* Frontline: lifted series colours for dark panels. */
.ts-fl-main, .ts-fl-filters { --ts-fl-c1: #2fb38a; --ts-fl-c2: #555555; }
/* Customer logos are drawn for white backgrounds: keep a light plate behind them, so greyed ones stay readable. */
.ts-fl-strip .ts-fl-logo { background: #ebebeb; }

/* Customer logos are often dark on transparent: give them a light tile, as on Frontline. */
img.ts-customer-logo { background: #ebebeb; }
