/* MammothShift — Combined Theme
   Light mode is default. Dark mode activates when body has .mammoth-dark class.
   Toggle via the dark mode button in the top bar.
   Design language from PitchDeck: DM Sans + Fraunces, cyan accent, 12px radius. */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:wght@300;400;500;700&display=swap');

/* ======================================================
   SHARED — applies in both modes
   ====================================================== */

:root {
    --mammoth-font-family: 'DM Sans', 'Inter', 'Roboto', sans-serif;
    --mammoth-card-radius: 12px;
    /* Primary & Accent */
    --mammoth-primary: #18B9D9;
    --mammoth-primary-dark: #1396B0;
    --mammoth-primary-light: #4DD0E1;
    --mammoth-secondary: #12263f;
    --mammoth-cta: #F97316;
    --mammoth-cta-muted: rgba(249, 115, 22,.2);
    /* N3 Palette — Navy Warm Accent Pop
       Six-color palette used for charts, entity cards, and UI chrome.
       Matches ChartOptions.ColorPalette order. */
    --mammoth-n3-cyan: #18B9D9;
    --mammoth-n3-navy: #12263F;
    --mammoth-n3-steel: #5D82A8;
    --mammoth-n3-amber: #F59E0B;
    --mammoth-n3-light: #A3BAD0;
    --mammoth-n3-gray: #94A3B8;
    /* Backgrounds */
    --mammoth-bg-page: #EDEFF2; /* #F5F7FA;*/
    --mammoth-bg-surface: #FFFFFF;
    --mammoth-bg-elevated: #FAFBFC;
    --mammoth-bg-inset: #F0F4F8;
    /* Text */
    --mammoth-text-primary: #12263f;
    --mammoth-text-secondary: #4a5568;
    --mammoth-text-tertiary: #64748B;
    --mammoth-text-muted: #94A3B8;
    /* Borders */
    --mammoth-border: #E3EBF6;
    --mammoth-border-light: #F0F4F8;
    /* Status — mapped to N3 palette.
       Success = cyan (on/active/yes), warning/pending = amber,
       danger = semantic red (outside N3, kept for error states),
       muted = gray (off/inactive/no for booleans). */
    --mammoth-status-success: #4ade80; /* var(--mammoth-n3-cyan);*/
    --mammoth-status-warning: var(--mammoth-n3-amber);
    --mammoth-status-pending: var(--mammoth-n3-amber);
    --mammoth-status-danger: #DC2626;
    --mammoth-status-info: var(--mammoth-n3-steel);
    --mammoth-status-muted: var(--mammoth-n3-gray);
    --mammoth-status-unset: var(--mammoth-n3-gray);
    /* Primary Opacity Scale */
    --mammoth-primary-3: rgba(24, 185, 217, 0.03);
    --mammoth-primary-5: rgba(24, 185, 217, 0.05);
    --mammoth-primary-6: rgba(24, 185, 217, 0.06);
    --mammoth-primary-8: rgba(24, 185, 217, 0.08);
    --mammoth-primary-10: rgba(24, 185, 217, 0.1);
    --mammoth-primary-15: rgba(24, 185, 217, 0.15);
    --mammoth-primary-20: rgba(24, 185, 217, 0.2);
    --mammoth-primary-30: rgba(24, 185, 217, 0.3);
    --mammoth-primary-40: rgba(24, 185, 217, 0.4);
    --mammoth-selected-row-bg: var(--mammoth-primary-8);
    --mammoth-selected-row-border: 2px dashed var(--mammoth-primary);
    /* Forgotten Mud Colors */
    --mud-palette-primary: #18B9D9;
    --mud-palette-primary-darken: #1B3A4B;
    /*  Misc */
    --site-white:#fff;
}

body {
    font-family: 'DM Sans', 'Inter', 'Roboto', sans-serif !important;
}

.gradient-text {
    background: linear-gradient( 45deg, #18B9D9, #8B5CF6, #D946EF );
    background-size: 100%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Optional for Firefox */
    background-clip: text;
    color: transparent;
}

.mud-breadcrumbs{
    margin: 0 0 10px;
}

/* Remove striped row coloring — both modes */
.mud-table-body .mud-table-row:nth-child(odd),
.mud-table-body .mud-table-row:nth-child(even) {
    background-color: transparent !important;
}

/* Cyan header border — both modes */
.mud-table-head .mud-table-cell {
    border-bottom: 1px solid var(--mammoth-primary-40) !important;
}

.mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: none !important;
}

/* ======================================================
   MAMMOTH UTILITY CLASSES — framework-free replacements
   for zero-behavior MudBlazor components (MudText,
   MudDivider, MudSpacer, MudGrid, MudStack, MudPaper,
   MudCard). Dark mode works automatically via
   body.mammoth-dark variable overrides.
   ====================================================== */

/* -- Typography ---------------------------------------- */
.mammoth-h1        { font-size: 2.5rem;   font-weight: 700; line-height: 1.2;  color: var(--mammoth-text-primary); margin: 0; }
.mammoth-h2        { font-size: 2rem;     font-weight: 700; line-height: 1.25; color: var(--mammoth-text-primary); margin: 0; }
.mammoth-h3        { font-size: 1.5rem;   font-weight: 600; line-height: 1.3;  color: var(--mammoth-text-primary); margin: 0; }
.mammoth-h4        { font-size: 1.25rem;  font-weight: 600; line-height: 1.35; color: var(--mammoth-text-primary); margin: 0; }
.mammoth-h5        { font-size: 1.125rem; font-weight: 600; line-height: 1.4;  color: var(--mammoth-text-primary); margin: 0; }
.mammoth-h6        { font-size: 1rem;     font-weight: 600; line-height: 1.5;  color: var(--mammoth-text-primary); margin: 0; }
.mammoth-subtitle1 { font-size: 1rem;     font-weight: 500; line-height: 1.75; color: var(--mammoth-text-secondary); margin: 0; }
.mammoth-subtitle2 { font-size: 0.875rem; font-weight: 500; line-height: 1.57; color: var(--mammoth-text-secondary); margin: 0; }
.mammoth-body1     { font-size: 1rem;     font-weight: 400; line-height: 1.5;  color: var(--mammoth-text-primary); margin: 0; }
.mammoth-body2     { font-size: 0.875rem; font-weight: 400; line-height: 1.43; color: var(--mammoth-text-secondary); margin: 0; }
.mammoth-caption   { font-size: 0.75rem;  font-weight: 400; line-height: 1.66; color: var(--mammoth-text-tertiary); margin: 0; }
.mammoth-eyebrow   { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mammoth-text-tertiary); margin: 0; }

/* -- Divider ------------------------------------------- */
.mammoth-divider        { border: 0; border-top: 1px solid var(--mammoth-border); margin: 16px 0; }
.mammoth-divider--soft  { border-top-color: var(--mammoth-border-light); }
.mammoth-divider--flush { margin: 0; }

/* -- Spacer -------------------------------------------- */
.mammoth-spacer { flex-grow: 1; }

/* -- Grid ---------------------------------------------- */
.mammoth-grid     { display: grid; gap: 24px; }
.mammoth-grid--2  { grid-template-columns: repeat(2, 1fr); }
.mammoth-grid--3  { grid-template-columns: repeat(3, 1fr); }
.mammoth-grid--4  { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
    .mammoth-grid--3,
    .mammoth-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .mammoth-grid--2,
    .mammoth-grid--3,
    .mammoth-grid--4 { grid-template-columns: 1fr; }
}

/* -- Stack --------------------------------------------- */
.mammoth-stack          { display: flex; flex-direction: column; gap: 16px; }
.mammoth-stack--row     { flex-direction: row; align-items: center; }
.mammoth-stack--wrap    { flex-wrap: wrap; }
.mammoth-stack--gap-xs  { gap: 4px; }
.mammoth-stack--gap-sm  { gap: 8px; }
.mammoth-stack--gap-lg  { gap: 24px; }
.mammoth-stack--gap-xl  { gap: 32px; }

/* -- Surface (replaces MudPaper as section container) -- */
.mammoth-surface {
    background-color: var(--mammoth-bg-surface);
    border: 1px solid var(--mammoth-border);
    border-radius: var(--mammoth-card-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: var(--mammoth-spacing-card);
}

/* -- Card (replaces non-interactive MudCard) ----------- */
.mammoth-card {
    background-color: var(--mammoth-bg-surface);
    border: 1px solid var(--mammoth-border);
    border-radius: var(--mammoth-card-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mammoth-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px var(--mammoth-spacing-card);
    border-bottom: 1px solid var(--mammoth-border);
}

.mammoth-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--mammoth-text-primary);
    margin: 0;
}

.mammoth-card__content {
    padding: var(--mammoth-spacing-card);
}

.mammoth-card__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px var(--mammoth-spacing-card);
    border-top: 1px solid var(--mammoth-border);
}

/* -- Alert (replaces non-dismissible MudAlert) --------- */
.mammoth-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--mammoth-border);
    background-color: var(--mammoth-bg-elevated);
    color: var(--mammoth-text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.mammoth-alert--info {
    background-color: rgba(57, 175, 209, 0.08);
    border-color: rgba(57, 175, 209, 0.3);
    color: var(--mammoth-status-info);
}

.mammoth-alert--success {
    background-color: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--mammoth-status-success);
}

.mammoth-alert--warning {
    background-color: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--mammoth-status-warning);
}

.mammoth-alert--error {
    background-color: rgba(229, 62, 62, 0.08);
    border-color: rgba(229, 62, 62, 0.3);
    color: var(--mammoth-status-danger);
}

.mammoth-alert--dense {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

/* -- Breadcrumbs (replaces MudBreadcrumbs) ------------- */
.mammoth-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    font-size: var(--mammoth-breadcrumb-font-size, 11px);
    text-transform: uppercase;
    letter-spacing: var(--mammoth-breadcrumb-letter-spacing, 0.05em);
    font-weight: 600;
}

.mammoth-breadcrumbs__item {
    color: var(--mammoth-primary);
}

.mammoth-breadcrumbs__item a {
    color: inherit;
    text-decoration: none;
}

.mammoth-breadcrumbs__item a:hover {
    text-decoration: underline;
}

.mammoth-breadcrumbs__item--current {
    color: var(--mammoth-text-tertiary);
}

.mammoth-breadcrumbs__separator {
    color: var(--mammoth-text-muted);
    user-select: none;
}

/* -- Spinner (inline loading indicator) ---------------- */
.mammoth-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--mammoth-primary-15);
    border-top-color: var(--mammoth-primary);
    border-radius: 50%;
    animation: mammoth-spin 0.8s linear infinite;
    vertical-align: middle;
}

.mammoth-spinner--sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.mammoth-spinner--lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

/* For spinners placed on colored backgrounds (e.g. inside a filled button)
   where the spinner should pick up the parent's text color. */
.mammoth-spinner--inherit {
    border-color: rgba(255, 255, 255, 0.3); /* intentional contrast track — not a theme color */
    border-top-color: currentColor;
}

@keyframes mammoth-spin {
    to { transform: rotate(360deg); }
}

/* -- Button (replaces MudButton) ----------------------- */
.mammoth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 22px;
    border-radius: var(--mammoth-card-radius, 8px);
    border: 1px solid transparent;
    background: transparent;
    color: var(--mammoth-text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    cursor: pointer;
    text-decoration: none;
    transition: background 100ms ease, border-color 100ms ease, color 100ms ease, filter 100ms ease, box-shadow 100ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mammoth-btn:focus-visible {
    outline: 2px solid var(--mammoth-primary);
    outline-offset: 2px;
}

.mammoth-btn:disabled,
.mammoth-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Filled defaults (no color modifier) */
.mammoth-btn--filled {
    background: var(--mammoth-bg-elevated);
    color: var(--mammoth-text-primary);
    border-color: var(--mammoth-border);
}

/* Filled + color */
.mammoth-btn--filled.mammoth-btn--primary   { background: var(--mammoth-primary);         color: #fff; border-color: transparent; }
.mammoth-btn--filled.mammoth-btn--secondary { background: var(--mammoth-secondary);       color: #fff; border-color: transparent; }
.mammoth-btn--filled.mammoth-btn--success   { background: var(--mammoth-status-success);  color: #fff; border-color: transparent; }
.mammoth-btn--filled.mammoth-btn--error     { background: var(--mammoth-status-danger);   color: #fff; border-color: transparent; }
.mammoth-btn--filled.mammoth-btn--warning   { background: var(--mammoth-status-warning);  color: #fff; border-color: transparent; }
.mammoth-btn--filled.mammoth-btn--info      { background: var(--mammoth-status-info);     color: #fff; border-color: transparent; }

/* Outlined defaults */
.mammoth-btn--outlined {
    background: transparent;
    border-color: var(--mammoth-border);
    color: var(--mammoth-text-primary);
}

/* Outlined + color */
.mammoth-btn--outlined.mammoth-btn--primary   { color: var(--mammoth-primary);        border-color: var(--mammoth-primary); }
.mammoth-btn--outlined.mammoth-btn--secondary { color: var(--mammoth-secondary);      border-color: var(--mammoth-secondary); }
.mammoth-btn--outlined.mammoth-btn--success   { color: var(--mammoth-status-success); border-color: var(--mammoth-status-success); }
.mammoth-btn--outlined.mammoth-btn--error     { color: var(--mammoth-status-danger);  border-color: var(--mammoth-status-danger); }
.mammoth-btn--outlined.mammoth-btn--warning   { color: var(--mammoth-status-warning); border-color: var(--mammoth-status-warning); }
.mammoth-btn--outlined.mammoth-btn--info      { color: var(--mammoth-status-info);    border-color: var(--mammoth-status-info); }

/* Text variant defaults */
.mammoth-btn--text {
    background: transparent;
    border-color: transparent;
    color: var(--mammoth-text-primary);
}

/* Text + color */
.mammoth-btn--text.mammoth-btn--primary   { color: var(--mammoth-primary); }
.mammoth-btn--text.mammoth-btn--secondary { color: var(--mammoth-secondary); }
.mammoth-btn--text.mammoth-btn--success   { color: var(--mammoth-status-success); }
.mammoth-btn--text.mammoth-btn--error     { color: var(--mammoth-status-danger); }
.mammoth-btn--text.mammoth-btn--warning   { color: var(--mammoth-status-warning); }
.mammoth-btn--text.mammoth-btn--info      { color: var(--mammoth-status-info); }

/* Hover states — filled darkens; outlined/text show a tint of current color */
.mammoth-btn--filled:hover {
    filter: brightness(0.92);
}

.mammoth-btn--outlined:hover,
.mammoth-btn--text:hover {
    background: color-mix(in srgb, currentColor 10%, transparent);
}

/* Sizes */
.mammoth-btn--sm {
    padding: 4px 14px;
    font-size: 0.8125rem;
}

.mammoth-btn--lg {
    padding: 10px 28px;
    font-size: 0.9375rem;
}

/* -- Icon Button (replaces MudIconButton) -------------- */
.mammoth-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--mammoth-text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: background 100ms ease, color 100ms ease;
    -webkit-tap-highlight-color: transparent;
}

.mammoth-icon-btn:hover {
    background: color-mix(in srgb, currentColor 12%, transparent);
}

.mammoth-icon-btn:focus-visible {
    outline: 2px solid var(--mammoth-primary);
    outline-offset: 2px;
}

.mammoth-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.mammoth-icon-btn--sm { width: 32px; height: 32px; padding: 6px; }
.mammoth-icon-btn--lg { width: 48px; height: 48px; padding: 10px; }

.mammoth-icon-btn--primary   { color: var(--mammoth-primary); }
.mammoth-icon-btn--secondary { color: var(--mammoth-secondary); }
.mammoth-icon-btn--success   { color: var(--mammoth-status-success); }
.mammoth-icon-btn--error     { color: var(--mammoth-status-danger); }
.mammoth-icon-btn--warning   { color: var(--mammoth-status-warning); }
.mammoth-icon-btn--info      { color: var(--mammoth-status-info); }

/* -- FAB / Floating Action Button (replaces MudFab) ---- */
.mammoth-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 56px;
    height: 40px;
    padding: 0;
    border: 2px solid var(--mammoth-primary);
    background: var(--mammoth-secondary);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15); /* intentional shadow alpha — not a theme color */
    transition: background 100ms ease, box-shadow 100ms ease, filter 100ms ease;
    -webkit-tap-highlight-color: transparent;
}

    .mammoth-fab:hover {
        filter: brightness(0.92);
        box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22); /* intentional shadow alpha — not a theme color */
        background: var(--mammoth-primary);
    }

.mammoth-fab:focus-visible {
    outline: 2px solid var(--mammoth-primary);
    outline-offset: 3px;
}

.mammoth-fab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* Sizes */
.mammoth-fab--sm { width: 40px; height: 40px; }
.mammoth-fab--lg { width: 64px; height: 64px; }
.mammoth-fab--xl { width: 80px; height: 80px; }

/* Square shape — used for entity header card edit buttons */
.mammoth-fab--square { border-radius: 4px; }

/* Color variants */
.mammoth-fab--secondary { background: var(--mammoth-secondary); }
.mammoth-fab--success   { background: var(--mammoth-status-success); }
.mammoth-fab--error     { background: var(--mammoth-status-danger); }
.mammoth-fab--warning   { background: var(--mammoth-status-warning); }
.mammoth-fab--info      { background: var(--mammoth-status-info); }

/* Extended FAB — pill-shaped FAB with text + icon */
.mammoth-fab--extended {
    width: auto;
    padding: 0 12px;
    border-radius: 28px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* -- Page TOC layout (sticky sidebar + content) -------- */
.mammoth-page-toc-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

.mammoth-page-toc {
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.mammoth-page-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px;
    background: var(--mammoth-bg-surface);
    border: 1px solid var(--mammoth-border);
    border-radius: var(--mammoth-card-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mammoth-page-toc-nav a {
    display: block;
    padding: 6px 12px;
    color: var(--mammoth-text-secondary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    border-left: 2px solid transparent;
    transition: color 100ms ease, background 100ms ease, border-color 100ms ease;
}

.mammoth-page-toc-nav a:hover {
    color: var(--mammoth-primary);
    background: var(--mammoth-primary-6);
    border-left-color: var(--mammoth-primary);
}

.mammoth-page-toc-content {
    min-width: 0;
}

.mammoth-page-toc-content section {
    scroll-margin-top: 16px;
}

@media (max-width: 960px) {
    .mammoth-page-toc-layout {
        grid-template-columns: 1fr;
    }
    .mammoth-page-toc {
        position: static;
        max-height: none;
    }
}

/* ======================================================
   LIGHT MODE (default — no body class needed)
   ====================================================== */

body {
    background-color: var(--mammoth-bg-page) !important;
    color: var(--mammoth-text-primary) !important;
}

.mud-layout,
.mud-main-content {
    background-color: none !important;  /*var(--mammoth-bg-page)*/
}

/* -- Cards & Paper -- */
.mud-paper {
    background-color: var(--mammoth-bg-surface) !important;
    border: 1px solid var(--mammoth-border) !important;
    color: var(--mammoth-text-primary) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important; /* intentional shadow alpha — not a theme color */
}

.mud-paper .mud-card,
.mud-paper .mud-paper {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important; /* intentional shadow alpha — not a theme color */
}

.mud-card {
    background-color: var(--mammoth-bg-surface) !important;
    border: 1px solid var(--mammoth-border) !important;
}

.mud-card-header {
    border-bottom-color: var(--mammoth-border) !important;
}

/* -- App Bar -- */
.mud-appbar {
    background-color: #12263f !important;
    color: #FFFFFF !important;
    border-bottom: 1px solid var(--mammoth-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important; /* intentional shadow alpha — not a theme color */
}

.mud-appbar .mud-icon-button {
    color: var(--mammoth-text-secondary) !important;
}

.mud-appbar .mud-typography {
    color: var(--mammoth-text-primary) !important;
}

/* -- Sidebar / Drawer -- */
.mud-drawer {
    background-color: #12263f !important;
    border-right: none !important;
}

/* -- No Top Bar layout -- */
.mammoth-no-topbar {
    --mud-appbar-height: 0px !important;
}

.mammoth-sidebar .mud-nav-link {
    color: var(--mammoth-text-muted) !important;
}

.mammoth-sidebar .mud-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06) !important; /* intentional dark-sidebar hover overlay — not a theme color */
    color: var(--mammoth-text-muted) !important; /* approximates #E2E8F0; sidebar uses dark bg in both modes — see decisions.md */
}

.mammoth-sidebar .mud-nav-link {
    border-left: 3px solid transparent;
    border-radius: 0 !important;
}

.mammoth-sidebar .mud-nav-link.active {
    background-color: var(--mammoth-primary-20) !important;
    color: var(--mammoth-primary) !important;
    border-left-color: var(--mammoth-primary);
}

.mammoth-sidebar .mud-nav-link.active .mud-icon-root {
    color: var(--mammoth-primary) !important;
}

.mammoth-sidebar .mud-nav-link .mud-icon-root {
    color: var(--mammoth-text-tertiary) !important;
}

.mammoth-sidebar .mud-nav-link:hover .mud-icon-root {
    color: var(--mammoth-text-muted) !important;
}

.mammoth-sidebar .mud-nav-group .mud-collapse-icon {
    color: var(--mammoth-text-tertiary) !important;
}

/* -- Sub-navigation -- */
.mammoth-subnav {
    background-color: var(--mammoth-bg-surface) !important;
   /* border-top: 2px solid var(--mammoth-primary) !important;
    border-bottom: 2px solid var(--mammoth-primary) !important;*/
    border-left-color: var(--mammoth-border) !important;
    border-right-color: var(--mammoth-border) !important;
}

.mammoth-subnav .mud-nav-link {
    font-size: 15px !important;
    color: var(--mammoth-text-secondary) !important;
    background-color: transparent !important;
}

.mammoth-wizard__step-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.mammoth-wizard__step-icon {
    flex-shrink: 0;
/*    margin-right: 12px;*/
}

.mammoth-wizard__step-label {
    margin-left: 20px;
}

.mammoth-wizard__step-label--sub {
    margin-left: 40px;
}

.mammoth-subnav .mud-nav-link:hover {
    background-color: var(--mammoth-primary-6) !important;
    color: var(--mammoth-text-primary) !important;
}

.mammoth-subnav .mud-nav-link.mammoth-subnav-active,
.mammoth-subnav .mud-nav-link.mammoth-subnav-active:hover {
    background-color: var(--mammoth-text-primary) !important;
    color: var(--mammoth-bg-surface) !important;
}

/* -- Dialog -- */
.mud-dialog {
    background-color: var(--mammoth-bg-surface) !important;
    border: 1px solid var(--mammoth-secondary) !important;
    border-radius: 14px !important;
}

.mud-dialog .mud-dialog-title {
    background-color: var(--mammoth-text-primary) !important;
}

.mud-dialog .mud-dialog-content {
    color: var(--mammoth-text-primary) !important;
}

.mud-dialog-actions {
    border-top: 1px solid var(--mammoth-border) !important;
}

/* -- Tables / DataGrid -- */
.mud-table {
    background-color: var(--mammoth-bg-surface) !important;
}

.mud-table-head {
    background-color: rgba(24, 185, 217, 0.06) !important;
}

.mud-table-head .mud-table-cell {
    color: var(--mammoth-text-tertiary) !important;
}

.mud-table-body .mud-table-cell {
    color: var(--mammoth-text-primary) !important;
    border-bottom-color: var(--mammoth-bg-inset) !important;
}

.mud-table-body .mud-table-row:hover {
    background-color: rgba(24, 185, 217, 0.2) !important;
}

.mud-table-body .mud-table-row.mud-selected-item {
    background-color: var(--mammoth-primary-8) !important;
}

.mud-table-pagination {
    color: var(--mammoth-text-secondary) !important;
    border-top-color: var(--mammoth-border) !important;
}

/* -- Buttons -- */
.mud-button-root.mud-button-filled {
    box-shadow: 0 1px 4px var(--mammoth-primary-20) !important;
}

.mud-button-root.mud-button-outlined {
    border-color: var(--mammoth-primary) !important;
    color: var(--mammoth-primary) !important;
}

.mud-button-root.mud-button-outlined:hover {
    background-color: var(--mammoth-primary-6) !important;
}

.mud-button-filled-tertiary {
    background-color: var(--mammoth-cta) !important;
    border: var(--mammoth-cta) !important;
    color:#fff !important;
}
.mud-button-filled-tertiary:hover {
    background-color: var(--site-navy) !important;
    border: var(--mammoth-cta) !important;
    color: #fff !important;
}

.mud-icon-button {
    color: var(--mammoth-text-secondary) !important;
}

.mud-icon-button:hover {
    background-color: var(--mammoth-primary-6) !important;
    color: var(--mammoth-text-primary) !important;
}

/* -- Form Inputs -- */
.mud-input.mud-input-outlined .mud-input-outlined-border {
    border-color: #CBD5E1 !important; /* no design token for this light-mode input border shade — see decisions.md */
}

.mud-input.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--mammoth-text-muted) !important;
}

.mud-input.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--mammoth-primary) !important;
}

.mud-input {
    color: var(--mammoth-text-primary) !important;
}

.mud-input-label {
    font-size: 15px !important;
    color: var(--mud-palette-text-primary) !important;
}

.mud-input-slot,
.mud-input > input,
.mud-input textarea {
    color: var(--mammoth-text-primary) !important;
}

.mud-input-root-multiline textarea {
    resize: vertical !important;
}

.mud-select .mud-input-adornment .mud-icon-root {
    color: var(--mammoth-text-muted) !important;
}

.mud-divider {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

.mammoth-form-divider {
    border-top: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.12));
    margin-top: 10px;
    margin-bottom: 12px;
}


/* -- Select / Menu / Popover -- */
.mud-popover {
    background-color: var(--mammoth-bg-surface) !important;
    border: 1px solid var(--mammoth-border) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important; /* intentional shadow alpha — not a theme color */
}

.mud-list-item {
    color: var(--mammoth-text-primary) !important;
}

.mud-list-item:hover {
    background-color: var(--mammoth-primary-6) !important;
}

.mud-menu-item:hover {
    background-color: var(--mammoth-primary-20) !important;
}

.mud-list-item.mud-selected-item {
    background-color: var(--mammoth-primary-10) !important;
    color: var(--mammoth-primary-dark) !important;
}

/* -- Tabs -- */
.mud-tabs .mud-tab {
    color: var(--mammoth-text-secondary) !important;
}

.mud-tabs .mud-tab.mud-tab-active {
    color: var(--mammoth-primary) !important;
}

.mud-tabs-toolbar {
    border-bottom-color: var(--mammoth-border) !important;
}

/* -- Breadcrumbs -- */
.mud-breadcrumbs li .mud-breadcrumb-item { color: var(--mammoth-primary); }
.mud-breadcrumbs li .mud-breadcrumb-separator { color: var(--mammoth-text-muted); }

/* -- Chips -- */
.mud-chip {
/*    background-color: var(--mammoth-primary-40);
    color: var(--site-white) !important;
    border: 1px solid var(--mammoth-primary-40);*/
}

/* Neutral/gray badge variant — opt-in via AutoCompleteItem.BadgeColor="gray"; out-specifies the teal default above */
.mud-chip.mammoth-autocomplete__badge--gray {
    background-color: rgba(100, 116, 139, 0.40) !important; /* slate-500 @ 0.40 — neutral counterpart to --mammoth-primary-40; no gray design token (see decisions.md) */
    color: var(--site-white) !important;
    border-color: rgba(100, 116, 139, 0.40) !important;
}

/* -- Blade -- */
.mammoth-blade {
    background: var(--mammoth-bg-surface) !important;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12) !important; /* intentional shadow alpha — not a theme color */
  /*  border-left: 1px solid var(--mammoth-text-muted);*/
}

/*.mammoth-blade-header {
    background-color: var(--mammoth-text-muted) !important;
}*/

.mammoth-blade-body {
    background: var(--mammoth-bg-page) !important;
    color: var(--mammoth-text-primary) !important;
}

.mammoth-blade-backdrop--open {
    background: rgba(0, 0, 0, 0.3) !important; /* intentional backdrop overlay — not a theme color */
}

/* -- Column Filter -- */
.mammoth-column-filter__list {
    border-color: var(--mammoth-border) !important;
    background: var(--mammoth-bg-elevated);
}

/* -- Typography -- */
.mud-typography { color: var(--mammoth-text-primary); }
.mud-typography.mud-typography-h1,
.mud-typography.mud-typography-h2,
.mud-typography.mud-typography-h3 { color: var(--mammoth-text-primary); }
.mud-typography.mud-typography-subtitle1,
.mud-typography.mud-typography-subtitle2 { color: var(--mammoth-text-secondary); }
.mud-typography.mud-typography-caption { color: var(--mammoth-text-muted); }

/* -- Checkbox & Radio -- */
.mud-checkbox .mud-icon-root,
.mud-radio .mud-icon-root { color: var(--mammoth-text-muted) !important; }
.mud-checkbox.mud-checked .mud-icon-root,
.mud-radio.mud-checked .mud-icon-root { color: var(--mammoth-primary) !important; }

/* -- Misc -- */
.mammoth-toggle-buttons-label { font-size: 15px !important; color: var(--mud-palette-text-primary) !important; }
.mammoth-html-editor-label { font-size: 15px !important; color: var(--mud-palette-text-primary) !important; }
.mammoth-toggle-buttons-group .mammoth-btn--outlined { background: rgb(237, 242, 249) !important; }
.mud-snackbar { background-color: var(--mammoth-bg-surface) !important; border: 1px solid var(--mammoth-border) !important; color: var(--mammoth-text-primary) !important; }
.mud-tooltip { background-color: var(--mammoth-text-primary) !important; color: var(--mammoth-bg-surface) !important; }
.mud-progress-linear { background-color: var(--mammoth-primary-10) !important; }
.mud-skeleton { background-color: #EDF0F4 !important; } /* no design token for skeleton neutral — see decisions.md */

/* -- Scrollbar -- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(26, 35, 50, 0.15); border-radius: 4px; } /* derives from --mammoth-secondary at opacity; intentional — see decisions.md */
::-webkit-scrollbar-thumb:hover { background: rgba(26, 35, 50, 0.25); } /* derives from --mammoth-secondary at opacity; intentional — see decisions.md */

/* -- KB light -- */
.mammoth-kb-layout { border-color: var(--mammoth-border) !important; background: var(--mammoth-bg-surface); }
.mammoth-kb-panel { border-right-color: var(--mammoth-border) !important; }
.mammoth-kb-panel-header { border-bottom-color: var(--mammoth-border) !important; background: var(--mammoth-bg-elevated) !important; color: var(--mammoth-text-secondary); }
.mammoth-kb-panel--content { background: var(--mammoth-bg-surface) !important; }
.mammoth-kb-article-item { border-bottom-color: var(--mammoth-bg-inset) !important; color: var(--mammoth-text-primary); }
.mammoth-kb-viewer-body code { background: var(--mammoth-primary-6) !important; color: var(--mammoth-primary-dark); }
.mammoth-kb-inline-form { background: var(--mammoth-bg-elevated) !important; border-bottom-color: var(--mammoth-border) !important; }
.mammoth-kb-search-results { border-color: var(--mammoth-border) !important; }
.mammoth-kb-empty { color: var(--mammoth-text-muted) !important; }

/* -- DMS light -- */
.mammoth-dms-layout { border-color: var(--mammoth-border) !important; background: var(--mammoth-bg-surface) !important; }
.mammoth-dms-panel--folders { border-right-color: var(--mammoth-border) !important; background: var(--mammoth-bg-elevated) !important; }
.mammoth-dms-panel--files { background: var(--mammoth-bg-surface) !important; }
.mammoth-dms-panel-header { border-bottom-color: var(--mammoth-border) !important; background: var(--mammoth-bg-page) !important; color: var(--mammoth-text-secondary); }
.mammoth-dms-file-card { background: var(--mammoth-bg-surface) !important; border-color: var(--mammoth-border) !important; }
.mammoth-dms-file-card:hover { border-color: var(--mammoth-primary) !important; box-shadow: 0 2px 8px var(--mammoth-primary-15) !important; }
.mammoth-dms-file-name { color: var(--mammoth-text-primary) !important; }
.mammoth-dms-file-thumb { background: var(--mammoth-bg-page) !important; }
.mammoth-dms-viewer-text { background: var(--mammoth-bg-page) !important; color: var(--mammoth-text-primary) !important; }
.mammoth-dms-viewer-meta { border-top-color: var(--mammoth-border) !important; }
.mammoth-dms-move-dialog { background: var(--mammoth-bg-surface) !important; }
.mammoth-dms-move-dialog-header { background: var(--mammoth-text-primary) !important; }
.mammoth-dms-move-dialog-footer { border-top-color: var(--mammoth-border) !important; }

/* -- RTE light -- */
.mammoth-rte { border-color: #CBD5E1 !important; background: var(--mammoth-bg-surface); } /* #CBD5E1 has no design token — see decisions.md */
.mammoth-rte--editable .ql-toolbar { border-bottom-color: var(--mammoth-border) !important; background: var(--mammoth-bg-elevated) !important; }
.mammoth-rte .ql-editor { color: var(--mammoth-text-primary); }


/* ======================================================
   DARK MODE — body.mammoth-dark overrides
   ====================================================== */

/* Dark mode design token overrides */
body.mammoth-dark {
    /* Backgrounds */
    --mammoth-bg-page: #0A0F1E;
    --mammoth-bg-surface: rgba(24, 185, 217, 0.03);
    --mammoth-bg-elevated: #0F1629;
    --mammoth-bg-inset: #111827;

    /* Text */
    --mammoth-text-primary: #E2E8F0;
    --mammoth-text-bright: #F8FAFC;
    --mammoth-text-secondary: #CBD5E1;
    --mammoth-text-tertiary: #94A3B8;
    --mammoth-text-muted: #64748B;

    /* Borders */
    --mammoth-border: rgba(24, 185, 217, 0.08);
    --mammoth-border-light: rgba(24, 185, 217, 0.05);
}

body.mammoth-dark {
    background-color: var(--mammoth-bg-page) !important;
    color: var(--mammoth-text-primary) !important;
}

body.mammoth-dark .mud-layout,
body.mammoth-dark .mud-main-content {
    background-color: var(--mammoth-bg-page) !important;
}

/* Grid texture — matches login page */
body.mammoth-dark .mud-main-content {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px), /* intentional decorative overlay — not a theme color */
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px), /* intentional decorative overlay — not a theme color */
        radial-gradient(ellipse 700px 500px at 50% 0%, var(--mammoth-primary-5), transparent) !important;
    background-size: 60px 60px, 60px 60px, 100% 100% !important;
}

/* -- Cards & Paper -- */
body.mammoth-dark .mud-paper {
    background-color: var(--mammoth-primary-3) !important;
    border: 1px solid var(--mammoth-primary-8) !important;
    color: var(--mammoth-text-primary) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important; /* intentional shadow alpha — not a theme color */
}

body.mammoth-dark .mud-paper .mud-card,
body.mammoth-dark .mud-paper .mud-paper {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important; /* intentional shadow alpha — not a theme color */
}

body.mammoth-dark .mud-card {
    background-color: var(--mammoth-primary-3) !important;
    border: 1px solid var(--mammoth-primary-8) !important;
}

body.mammoth-dark .mud-card-header {
    border-bottom-color: var(--mammoth-primary-10) !important;
}

/* -- Mammoth utility classes — dark shadow overrides --- */
body.mammoth-dark .mammoth-surface,
body.mammoth-dark .mammoth-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); /* intentional shadow alpha — not a theme color */
}

/* -- App Bar -- */
body.mammoth-dark .mud-appbar {
    background-color: var(--mammoth-bg-surface) !important;
    color: var(--mammoth-text-bright) !important;
    border-bottom: 1px solid var(--mammoth-primary-8);
    box-shadow: none !important;
}

body.mammoth-dark .mud-appbar .mud-icon-button {
    color: var(--mammoth-text-tertiary) !important;
}

body.mammoth-dark .mud-appbar .mud-typography {
    color: var(--mammoth-text-bright) !important;
}

/* -- Sidebar / Drawer -- */
body.mammoth-dark .mud-drawer {
    background-color: var(--mammoth-bg-surface) !important;
    border-right: 1px solid var(--mammoth-primary-8) !important;
}

/* -- Sub-navigation -- */
body.mammoth-dark .mammoth-subnav {
    background-color: var(--mammoth-bg-inset) !important;
    border-top-color: var(--mammoth-primary-30) !important;
    border-bottom-color: var(--mammoth-primary-30) !important;
    border-left-color: var(--mammoth-primary-8) !important;
    border-right-color: var(--mammoth-primary-8) !important;
}

body.mammoth-dark .mammoth-subnav .mud-nav-link {
    color: var(--mammoth-text-tertiary) !important;
    background-color: transparent !important;
}

body.mammoth-dark .mammoth-subnav .mud-nav-link:hover {
    background-color: var(--mammoth-primary-6) !important;
    color: var(--mammoth-text-primary) !important;
}

body.mammoth-dark .mammoth-subnav .mud-nav-link.mammoth-subnav-active,
body.mammoth-dark .mammoth-subnav .mud-nav-link.mammoth-subnav-active:hover {
    background-color: var(--mammoth-primary-15) !important;
    color: var(--mammoth-primary) !important;
}

/* -- Dialog -- */
body.mammoth-dark .mud-dialog {
    background-color: var(--mammoth-bg-inset) !important;
    border: 1px solid var(--mammoth-primary-10) !important;
}

body.mammoth-dark .mud-dialog .mud-dialog-title {
    background-color: var(--mammoth-bg-surface) !important;
}

body.mammoth-dark .mud-dialog .mud-dialog-content {
    color: var(--mammoth-text-primary) !important;
}

body.mammoth-dark .mud-dialog-actions {
    border-top: 1px solid var(--mammoth-primary-8) !important;
}

/* -- Tables / DataGrid -- */
body.mammoth-dark .mud-table {
    background-color: transparent !important;
}

body.mammoth-dark .mud-table-head {
    background-color: rgba(24, 185, 217, 0.06) !important;
}

body.mammoth-dark .mud-table-head .mud-table-cell {
    color: var(--mammoth-text-muted) !important;
    border-bottom: 1px solid var(--mammoth-primary-30) !important;
    background-color:unset;
}

body.mammoth-dark .mud-table-body .mud-table-cell {
    color: var(--mammoth-text-secondary) !important;
    border-bottom-color: var(--mammoth-primary-6) !important;
}

body.mammoth-dark .mud-table-body .mud-table-row:hover {
    background-color: rgba(24, 185, 217, 0.04) !important;
}

body.mammoth-dark .mud-table-body .mud-table-row.mud-selected-item {
    background-color: var(--mammoth-primary-10) !important;
}

body.mammoth-dark .mud-table-pagination {
    color: var(--mammoth-text-tertiary) !important;
    border-top-color: var(--mammoth-primary-8) !important;
}

/* -- Buttons -- */
body.mammoth-dark .mud-button-root.mud-button-filled {
    box-shadow: 0 0 16px var(--mammoth-primary-15) !important;
}

body.mammoth-dark .mud-button-root.mud-button-outlined {
    border-color: var(--mammoth-primary-30) !important;
    color: var(--mammoth-primary) !important;
}

body.mammoth-dark .mud-button-root.mud-button-outlined:hover {
    background-color: var(--mammoth-primary-8) !important;
    border-color: rgba(24, 185, 217, 0.5) !important; /* no design token for 50% opacity — see decisions.md */
}

body.mammoth-dark .mud-icon-button {
    color: var(--mammoth-text-tertiary) !important;
}

body.mammoth-dark .mud-icon-button:hover {
    background-color: var(--mammoth-primary-8) !important;
    color: var(--mammoth-text-primary) !important;
}

/* -- Form Inputs -- */
body.mammoth-dark .mud-input.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--mammoth-primary-15) !important;
}

body.mammoth-dark .mud-input.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--mammoth-primary-30) !important;
}

body.mammoth-dark .mud-input {
    color: var(--mammoth-text-primary) !important;
}

body.mammoth-dark .mud-input-label {
    color: var(--mud-palette-text-primary) !important;
}

body.mammoth-dark .mud-input-slot,
body.mammoth-dark .mud-input > input,
body.mammoth-dark .mud-input textarea {
    color: var(--mammoth-text-primary) !important;
}

body.mammoth-dark .mud-select .mud-input-adornment .mud-icon-root {
    color: var(--mammoth-text-muted) !important;
}

/* -- Select / Menu / Popover -- */
body.mammoth-dark .mud-popover {
    background-color: var(--mammoth-secondary) !important;
    border: 1px solid rgba(24, 185, 217, 0.12) !important; /* no design token for 12% opacity — see decisions.md */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important; /* intentional shadow alpha — not a theme color */
}

body.mammoth-dark .mud-list-item {
    color: var(--mammoth-text-secondary) !important;
}

body.mammoth-dark .mud-list-item:hover {
    background-color: var(--mammoth-primary-8) !important;
}

body.mammoth-dark .mud-menu-item:hover {
    background-color: var(--mammoth-primary-10) !important;
}

body.mammoth-dark .mud-list-item.mud-selected-item {
    background-color: rgba(24, 185, 217, 0.12) !important; /* no design token for 12% opacity — see decisions.md */
    color: var(--mammoth-primary) !important;
}

/* -- Tabs -- */
body.mammoth-dark .mud-tabs .mud-tab {
    color: var(--mammoth-text-tertiary) !important;
}

body.mammoth-dark .mud-tabs .mud-tab.mud-tab-active {
    color: var(--mammoth-primary) !important;
}

body.mammoth-dark .mud-tabs-toolbar {
    border-bottom-color: var(--mammoth-primary-8) !important;
}

/* -- Breadcrumbs -- */
body.mammoth-dark .mud-breadcrumbs li .mud-breadcrumb-separator { color: #475569; } /* no design token for this slate shade — see decisions.md */

/* -- Chips -- */
body.mammoth-dark .mud-chip {
    background-color: var(--mammoth-primary-10) !important;
    color: var(--mammoth-primary) !important;
    border: 1px solid var(--mammoth-primary-20) !important;
}

/* Neutral/gray badge variant (dark) — mirrors the dark teal chip weight with slate */
body.mammoth-dark .mud-chip.mammoth-autocomplete__badge--gray {
    background-color: rgba(148, 163, 184, 0.10) !important; /* slate @ 0.10 — neutral counterpart to --mammoth-primary-10 (see decisions.md) */
    color: var(--mammoth-text-tertiary) !important; /* #94A3B8 slate in dark mode */
    border-color: rgba(148, 163, 184, 0.20) !important;
}

/* -- Blade -- */
body.mammoth-dark .mammoth-blade {
    background: var(--mammoth-bg-inset) !important;
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.5) !important; /* intentional shadow alpha — not a theme color */
    border-left: 1px solid var(--mammoth-primary-10);
}

body.mammoth-dark .mammoth-blade-header {
    background-color: var(--mammoth-bg-surface) !important;
    border-bottom: 1px solid var(--mammoth-primary-10);
}

body.mammoth-dark .mammoth-blade-body {
    background: var(--mammoth-bg-inset) !important;
    color: var(--mammoth-text-primary) !important;
}

body.mammoth-dark .mammoth-blade-backdrop--open {
    background: rgba(10, 15, 30, 0.6) !important; /* intentional dark-mode backdrop overlay — not a theme color */
}

/* -- Column Filter -- */
body.mammoth-dark .mammoth-column-filter__list {
    border-color: var(--mammoth-primary-10) !important;
    background: var(--mammoth-bg-elevated);
}

/* -- Typography -- */
body.mammoth-dark .mud-typography { color: var(--mammoth-text-primary); }
body.mammoth-dark .mud-typography.mud-typography-h1,
body.mammoth-dark .mud-typography.mud-typography-h2,
body.mammoth-dark .mud-typography.mud-typography-h3 { color: var(--mammoth-text-bright); }
body.mammoth-dark .mud-typography.mud-typography-subtitle1,
body.mammoth-dark .mud-typography.mud-typography-subtitle2 { color: var(--mammoth-text-secondary); }
body.mammoth-dark .mud-typography.mud-typography-caption { color: var(--mammoth-text-tertiary); }

/* -- Checkbox & Radio -- */
body.mammoth-dark .mud-checkbox .mud-icon-root,
body.mammoth-dark .mud-radio .mud-icon-root { color: var(--mammoth-text-muted) !important; }

/* -- Misc -- */
body.mammoth-dark .mammoth-toggle-buttons-label { color: var(--mud-palette-text-primary) !important; }
body.mammoth-dark .mammoth-html-editor-label { color: var(--mud-palette-text-primary) !important; }
body.mammoth-dark .mud-snackbar { background-color: var(--mammoth-secondary) !important; border: 1px solid rgba(24, 185, 217, 0.12) !important; color: var(--mammoth-text-primary) !important; } /* rgba 12% has no token — see decisions.md */
body.mammoth-dark .mud-tooltip { background-color: var(--mammoth-secondary) !important; color: var(--mammoth-text-primary) !important; border: 1px solid var(--mammoth-primary-10) !important; }
body.mammoth-dark .mud-skeleton { background-color: var(--mammoth-primary-6) !important; }

/* -- Scrollbar dark -- */
body.mammoth-dark ::-webkit-scrollbar-thumb { background: var(--mammoth-primary-15); }
body.mammoth-dark ::-webkit-scrollbar-thumb:hover { background: var(--mammoth-primary-20); } /* approximates rgba(24,185,217,0.25); nearest token is primary-20 — see decisions.md */

/* -- KB dark -- */
body.mammoth-dark .mammoth-kb-layout { border-color: var(--mammoth-primary-10) !important; background: var(--mammoth-bg-inset); }
body.mammoth-dark .mammoth-kb-panel { border-right-color: var(--mammoth-primary-8) !important; }
body.mammoth-dark .mammoth-kb-panel-header { border-bottom-color: var(--mammoth-primary-8) !important; background: var(--mammoth-bg-elevated) !important; color: var(--mammoth-text-tertiary); }
body.mammoth-dark .mammoth-kb-panel--content { background: var(--mammoth-bg-inset) !important; }
body.mammoth-dark .mammoth-kb-article-item { border-bottom-color: var(--mammoth-primary-6) !important; color: var(--mammoth-text-secondary); }
body.mammoth-dark .mammoth-kb-viewer-body code { background: var(--mammoth-primary-8) !important; color: var(--mammoth-primary); }
body.mammoth-dark .mammoth-kb-inline-form { background: var(--mammoth-bg-elevated) !important; border-bottom-color: var(--mammoth-primary-8) !important; }
body.mammoth-dark .mammoth-kb-search-results { border-color: var(--mammoth-primary-10) !important; }
body.mammoth-dark .mammoth-kb-empty { color: var(--mammoth-text-muted) !important; }

/* -- DMS dark -- */
body.mammoth-dark .mammoth-dms-layout { border-color: var(--mammoth-primary-10) !important; background: var(--mammoth-bg-inset) !important; }
body.mammoth-dark .mammoth-dms-panel--folders { border-right-color: var(--mammoth-primary-8) !important; background: var(--mammoth-bg-elevated) !important; }
body.mammoth-dark .mammoth-dms-panel--files { background: var(--mammoth-bg-inset) !important; }
body.mammoth-dark .mammoth-dms-panel-header { border-bottom-color: var(--mammoth-primary-8) !important; background: var(--mammoth-bg-surface) !important; color: var(--mammoth-text-tertiary); }
body.mammoth-dark .mammoth-dms-file-card { background: var(--mammoth-primary-3) !important; border-color: var(--mammoth-primary-10) !important; }
body.mammoth-dark .mammoth-dms-file-card:hover { border-color: var(--mammoth-primary) !important; box-shadow: 0 2px 12px var(--mammoth-primary-20) !important; }
body.mammoth-dark .mammoth-dms-file-name { color: var(--mammoth-text-primary) !important; }
body.mammoth-dark .mammoth-dms-file-thumb { background: var(--mammoth-bg-elevated) !important; }
body.mammoth-dark .mammoth-dms-viewer-text { background: var(--mammoth-bg-elevated) !important; color: var(--mammoth-text-secondary) !important; }
body.mammoth-dark .mammoth-dms-viewer-meta { border-top-color: var(--mammoth-primary-8) !important; }
body.mammoth-dark .mammoth-dms-move-dialog { background: var(--mammoth-bg-inset) !important; border: 1px solid var(--mammoth-primary-10); }
body.mammoth-dark .mammoth-dms-move-dialog-header { background: var(--mammoth-bg-surface) !important; }
body.mammoth-dark .mammoth-dms-move-dialog-footer { border-top-color: var(--mammoth-primary-8) !important; }

/* -- RTE dark -- */
body.mammoth-dark .mammoth-rte { border-color: var(--mammoth-primary-15) !important; background: var(--mammoth-bg-inset); }
body.mammoth-dark .mammoth-rte--editable .ql-toolbar { border-bottom-color: var(--mammoth-primary-10) !important; background: var(--mammoth-bg-elevated) !important; }
body.mammoth-dark .mammoth-rte .ql-editor { color: var(--mammoth-text-primary); }


/* ── ApexCharts refinements ─────────────────────────────────────
   Override the library's inline styles where the JS options API
   doesn't reach (tooltip container, legend item hover). */

/* Tooltip: match card surface, tighter padding, themed border */
.apexcharts-tooltip {
    background: var(--mammoth-bg-surface) !important;
    border: 1px solid var(--mammoth-border) !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    font-family: 'DM Sans', Inter, sans-serif !important;
}

.apexcharts-tooltip-title {
    background: var(--mammoth-bg-inset) !important;
    border-bottom: 1px solid var(--mammoth-border-light) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
}

.apexcharts-tooltip-text-y-value {
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
}

.apexcharts-tooltip-series-group {
    padding: 4px 10px !important;
}

/* Legend: remove default hover background */
.apexcharts-legend-series:hover {
    background: transparent !important;
}

/* Gridlines: ensure theme-aware color in dark mode */
body.mammoth-dark .apexcharts-gridline {
    stroke: var(--mammoth-border) !important;
}

body.mammoth-dark .apexcharts-tooltip {
    background: var(--mammoth-bg-elevated) !important;
    border-color: var(--mammoth-border) !important;
}

body.mammoth-dark .apexcharts-tooltip-title {
    background: var(--mammoth-bg-inset) !important;
    border-bottom-color: var(--mammoth-border) !important;
}

/* Pie/donut: no drop shadow on slices */
.apexcharts-pie-area {
    filter: none !important;
}
