/* SummitFS Application Styles */

/* ─────────────────────────────────────────────────────────────────────────
   Brand color palette — overrides Radzen's Material defaults.
   Material's default pink (rgb(227, 28, 101)) and bright red
   (rgb(244, 67, 54)) are explicitly not part of the brand. The palette
   is blues / blacks / silvers / greys for surfaces and primaries; green
   and yellow stay available for status-icon semantics; a muted, deep
   red is reserved for true error/danger states only.
   ───────────────────────────────────────────────────────────────────── */
:root {
    /* Primary — professional blue. */
    --rz-primary: #2563eb;
    --rz-primary-light: #3b82f6;
    --rz-primary-lighter: #93c5fd;
    --rz-primary-dark: #1d4ed8;
    --rz-primary-darker: #1e3a8a;
    --rz-primary-contrast: #ffffff;

    /* Secondary — slate / silver. */
    --rz-secondary: #64748b;
    --rz-secondary-light: #94a3b8;
    --rz-secondary-lighter: #cbd5e1;
    --rz-secondary-dark: #475569;
    --rz-secondary-darker: #334155;
    --rz-secondary-contrast: #ffffff;

    /* Info — lighter blue for non-warning callouts (uses the same family
       as primary so the whole palette reads as one). */
    --rz-info: #0284c7;
    --rz-info-light: #38bdf8;
    --rz-info-dark: #0369a1;
    --rz-info-contrast: #ffffff;

    /* Success — green for positive status icons. */
    --rz-success: #16a34a;
    --rz-success-light: #4ade80;
    --rz-success-dark: #15803d;
    --rz-success-contrast: #ffffff;

    /* Warning — amber/yellow for "due soon", "needs attention". */
    --rz-warning: #ca8a04;
    --rz-warning-light: #eab308;
    --rz-warning-lighter: #fffaeb;
    --rz-warning-dark: #a16207;
    --rz-warning-contrast: #ffffff;

    /* Danger — muted deep red, not Material's bright red. Reserved for
       true error states (overdue, failed, deleted). */
    --rz-danger: #b91c1c;
    --rz-danger-light: #dc2626;
    --rz-danger-dark: #991b1b;
    --rz-danger-contrast: #ffffff;

    /* Series colors (charts/badges) — keep blue-grey family with green
       and yellow available; drop Material's pink-heavy default series. */
    --rz-series-1: #2563eb;
    --rz-series-2: #64748b;
    --rz-series-3: #16a34a;
    --rz-series-4: #ca8a04;
    --rz-series-5: #0284c7;
    --rz-series-6: #475569;
    --rz-series-7: #b91c1c;
    --rz-series-8: #1e3a8a;

    /* Bootstrap primary follows the same blue so .text-primary,
       .btn-primary, sidebar active-state etc. all read consistently. */
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;

    /* ─────────────────────────────────────────────────────────────────
       Readable muted text. Radzen's Material theme uses a very light grey
       (#9e9e9e = rgb(158,158,158)) for its lower "base" greys and for
       secondary/tertiary/disabled text — too faint to read comfortably on
       white (see captions, subtitles, table sub-rows, the vendor portal
       footer). Darken the whole muted scale to a near-black slate so all
       that text becomes clearly legible without losing every bit of
       hierarchy. Bumping these variables fixes the rz-color-base-500/600
       utility classes and the rz-text-*-color tokens app-wide at once.
       ───────────────────────────────────────────────────────────────── */
    --rz-base-500: #1f2937;
    --rz-base-600: #1f2937;
    --rz-base-700: #111827;
    --rz-base-800: #0f172a;
    --rz-text-color: #111827;
    --rz-text-secondary-color: #1f2937;
    --rz-text-tertiary-color: #374151;
    --rz-text-disabled-color: #4b5563;
}

/* Belt-and-suspenders: pin the muted-text utility classes directly, in
   case a component sets the color inline rather than via the variable. */
.rz-color-base-500,
.rz-color-base-600,
.rz-text-secondary-color,
.rz-text-tertiary-color {
    color: #1f2937 !important;
}

[data-bs-theme="dark"] {
    /* Slightly brighter blues so the primary still reads on a dark
       background. Greys shift cooler so they don't go muddy. */
    --rz-primary: #3b82f6;
    --rz-primary-light: #60a5fa;
    --rz-primary-lighter: #93c5fd;
    --rz-primary-dark: #2563eb;
    --rz-primary-darker: #1d4ed8;

    --rz-secondary: #94a3b8;
    --rz-secondary-light: #cbd5e1;
    --rz-secondary-dark: #64748b;

    --bs-primary: #3b82f6;
    --bs-primary-rgb: 59, 130, 246;

    /* Dark mode counterpart to the light-mode muted-text fix above: keep
       muted/secondary text LIGHT here so it stays readable on dark
       surfaces (the light-mode near-black would be invisible). */
    --rz-base-500: #cbd5e1;
    --rz-base-600: #cbd5e1;
    --rz-base-700: #e2e8f0;
    --rz-base-800: #f1f5f9;
    --rz-text-color: #f1f5f9;
    --rz-text-secondary-color: #cbd5e1;
    --rz-text-tertiary-color: #94a3b8;
    --rz-text-disabled-color: #64748b;
}

[data-bs-theme="dark"] .rz-color-base-500,
[data-bs-theme="dark"] .rz-color-base-600,
[data-bs-theme="dark"] .rz-text-secondary-color,
[data-bs-theme="dark"] .rz-text-tertiary-color {
    color: #cbd5e1 !important;
}

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ─────────────────────────────────────────────────────────────────────────
   Depth & elevation.
   Pure-white pages feel flat. Tint the main content area to a very pale
   cool grey so outlined white cards "pop" against it (Stripe/Linear/
   Notion pattern). Sidebar and top navbar stay white so they read as
   separate surfaces, with the existing border-right + border-bottom
   providing the divider.
   ───────────────────────────────────────────────────────────────────── */

main.main-content {
    background-color: #e2e8f0;  /* slate-200 — clearly distinct from white cards */
}

/* Force outlined Radzen cards to pure white + a crisper border, so they
   actually pop on the slate body. Radzen's Material theme tints card
   backgrounds slightly which made them blend into a darker body color. */
.rz-card.rz-variant-outlined,
.rz-card[variant="outlined"] {
    background-color: #ffffff !important;
    border-color: #d9e0ea !important;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.06),
        0 4px 8px rgba(15, 23, 42, 0.05);
}

/* Slightly stronger shadow on hover for clickable card surfaces. */
.rz-card.rz-variant-outlined:hover,
.rz-card[variant="outlined"]:hover {
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.08),
        0 8px 16px rgba(15, 23, 42, 0.08);
    transition: box-shadow 0.15s ease;
}

/* Dark mode: deep slate body with lighter slate cards, so cards lift
   above the surrounding area the same way they do in light mode. */
[data-bs-theme="dark"] main.main-content {
    background-color: #0f172a;  /* slate-900 */
}

[data-bs-theme="dark"] .rz-card.rz-variant-outlined,
[data-bs-theme="dark"] .rz-card[variant="outlined"] {
    background-color: #1e293b !important;  /* slate-800 — one level above body */
    border-color: #334155 !important;       /* slate-700 — visible edge */
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.35),
        0 4px 8px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .rz-card.rz-variant-outlined:hover,
[data-bs-theme="dark"] .rz-card[variant="outlined"]:hover {
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.40),
        0 8px 16px rgba(0, 0, 0, 0.30);
}

/* ─────────────────────────────────────────────────────────────────────────
   Rounded corners — kill the sharp 90° corners across the app.
   Override Radzen and Bootstrap border-radius variables, plus explicit
   rules for components that hardcode their own radius.
   ───────────────────────────────────────────────────────────────────── */
:root {
    --rz-border-radius: 10px;
    --rz-input-border-radius: 8px;
    --rz-button-border-radius: 8px;
    --rz-card-border-radius: 12px;

    --bs-border-radius: 0.5rem;
    --bs-border-radius-sm: 0.375rem;
    --bs-border-radius-lg: 0.75rem;
}

/* Cards: outlined + shadow + rounded corners. */
.rz-card { border-radius: 12px !important; }

/* Buttons (all variants). */
.rz-button,
.rz-button-text { border-radius: 8px !important; }

/* Form inputs: textbox, password, numeric, dropdown, datepicker. */
.rz-textbox,
.rz-dropdown,
.rz-datepicker,
.rz-numeric,
.rz-spinner { border-radius: 8px !important; }

/* The RadzenFormField wrapper outline (notch-style label). */
.rz-form-field-content { border-radius: 8px !important; }

/* DataGrid container + cells at the corners. */
.rz-datatable,
.rz-data-grid,
.rz-grid-table-wrapper { border-radius: 10px !important; overflow: hidden; }

/* Per-column filter row inputs inside the grid. */
.rz-cell-filter input,
.rz-cell-filter .rz-textbox,
.rz-cell-filter .rz-datepicker { border-radius: 6px !important; }

/* Tabs nav bar. */
.rz-tabview-nav,
.rz-tabview-panels { border-radius: 10px; }

/* Sidebar nav-item active state still uses a left-border accent, so
   skip rounding on the panel-menu items so the accent line stays flush. */
.sidebar .rz-navigation-item-link { border-radius: 0 !important; }

/* Plain Bootstrap controls (the few that aren't yet Radzen-converted)
   inherit from --bs-border-radius — explicit fallback for older Bootstrap
   classes that hardcode 0 or sharp corners. */
.btn,
.form-control,
.form-select,
.card,
.alert,
.input-group .form-control:first-child,
.input-group .form-control:last-child,
.input-group .input-group-text:first-child,
.input-group .input-group-text:last-child { border-radius: var(--bs-border-radius) !important; }

/* Top-nav search input keeps its plain look but with rounded corners. */
.navbar .form-control { border-radius: var(--bs-border-radius); }

/* Blazor error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ni42MDYgNTIuMjY1OEwyODkuMzc4IDc0LjkwNzhDMjkwLjE3IDc1LjY5MDkgMjkwLjY1NCA3Ni43ODU3IDI5MC42NTQgNzcuOTk2OUwyOTAuNjU0IDc3Ljk5NjlMMjkwLjY1NCA3OC4xODY5QzI5MC42NTQgNzkuMzk4IDI5MC4xNyA4MC40OTI4IDI4OS4zNzggODEuMjc1OUwyODkuMzc4IDgxLjI3NTlMMjY2LjYwNiA5My45MTc5QzI2NS44MTMgOTQuNzAxIDI2NC43MTcgOTUuMTg0NyAyNjMuNTA2IDk1LjE4NDdMMjYzLjUwNiA5NS4xODQ3TDI2My4yNzYgOTUuMTg0N0MyNjIuMDY1IDk1LjE4NDcgMjYwLjk2OSA5NC43MDEgMjYwLjE3NyA5My45MTc5TDI2MC4xNzcgOTMuOTE3OUwyMzcuNDA0IDgxLjI3NTlDMjM2LjYxMiA4MC40OTI4IDIzNi4xMjggNzkuMzk4IDIzNi4xMjggNzguMTg2OUwyMzYuMTI4IDc4LjE4NjlMMjM2LjEyOCA3Ny45OTY5QzIzNi4xMjggNzYuNzg1NyAyMzYuNjEyIDc1LjY5MDkgMjM3LjQwNCA3NC45MDc4TDIzNy40MDQgNzQuOTA3OEwyNjAuMTc3IDUyLjI2NThDMjYwLjk2OSA1MS40ODM3IDI2Mi4wNjUgNTEgMjYzLjI3NiA1MUwyNjMuMjc2IDUxTDI2My41MDYgNTFaIiBmaWxsPSIjRkY1MjI4Ii8+PHBhdGggZD0iTTI2My43NDIgNTguNjM3MUMyNjQuNTgxIDU4LjYzNzEgMjY1LjI3IDU5LjMyNTggMjY1LjI3IDYwLjE2NDRMMjY1LjI3IDc3Ljk5NjlDMjY1LjI3IDc4LjgzNTYgMjY0LjU4MSA3OS41MjQyIDI2My43NDIgNzkuNTI0MkMyNjIuOTAzIDc5LjUyNDIgMjYyLjIxNCA3OC44MzU2IDI2Mi4yMTQgNzcuOTk2OUwyNjIuMjE0IDYwLjE2NDRDMjYyLjIxNCA1OS4zMjU4IDI2Mi45MDMgNTguNjM3MSAyNjMuNzQyIDU4LjYzNzFaTTI2My43NDIgODQuNTg3MUMyNjQuNTggODQuNTg3MSAyNjUuMjcgODUuMjc2OCAyNjUuMjcgODYuMTE1NkMyNjUuMjcgODYuOTU0MyAyNjQuNTggODcuNjQzIDI2My43NDIgODcuNjQzQzI2Mi45MDQgODcuNjQzIDI2Mi4yMTQgODYuOTU0MyAyNjIuMjE0IDg2LjExNTZDMjYyLjIxNCA4NS4yNzY4IDI2Mi45MDQgODQuNTg3MSAyNjMuNzQyIDg0LjU4NzFaIiBmaWxsPSIjRkZGRkZGIi8+PC9nPjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Loading indicator */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #1976d2;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #e0e0e0;
    stroke-dasharray: calc(3.14159 * 8rem);
    stroke-dashoffset: calc(3.14159 * 8rem);
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    padding-top: 3rem;
    font-weight: bold;
    color: #1976d2;
}

.loading-progress-text:after {
    content: attr(data-percent) '%';
}

/* ============================================
   Sidebar Styles (Bootstrap 5 layout)
   ============================================ */

.sidebar {
    width: 260px;
    /* Light theme: light sidebar with subtle border. Switches to dark via the
       [data-bs-theme="dark"] override at the bottom of this file. */
    background: #ffffff;
    color: #495057;
    flex-shrink: 0;
    border-right: 1px solid #e9ecef;
    overflow: hidden;
}

.sidebar.sidebar-collapsed {
    width: 68px;
}

/* Expand sidebar on hover when collapsed */
.sidebar.sidebar-collapsed:hover {
    width: 260px;
}

.sidebar.sidebar-collapsed .nav-label,
.sidebar.sidebar-collapsed .nav-group-header,
.sidebar.sidebar-collapsed .sidebar-title {
    display: none !important;
}

/* Show labels again on hover */
.sidebar.sidebar-collapsed:hover .nav-label,
.sidebar.sidebar-collapsed:hover .sidebar-title {
    display: inline !important;
}

.sidebar.sidebar-collapsed:hover .nav-group-header {
    display: flex !important;
}

.sidebar.sidebar-collapsed .nav-item {
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Restore normal nav-item layout on hover */
.sidebar.sidebar-collapsed:hover .nav-item {
    justify-content: flex-start;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.sidebar.sidebar-collapsed .nav-icon {
    margin: 0;
}

.sidebar.sidebar-collapsed:hover .nav-icon {
    margin: 0;
}

/* Sidebar header */
.sidebar-header {
    min-height: 56px;
}

.sidebar-avatar {
    flex-shrink: 0;
}

/* Nav items */
.nav-item {
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    margin: 2px 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
    min-height: 40px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-item.active {
    background-color: rgba(25, 118, 210, 0.2);
    color: #64B5F6;
}

.nav-item .nav-icon {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    transition: color 0.2s;
}

.nav-item:hover .nav-icon {
    color: rgba(255, 255, 255, 0.9);
}

.nav-item.active .nav-icon {
    color: #64B5F6;
}

/* Nav group headers */
.nav-group-header {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.nav-group-toggle {
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    margin: 2px 8px;
    transition: background-color 0.15s;
}

.nav-group-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-group-chevron {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease;
}

.nav-group-chevron.collapsed {
    transform: rotate(-90deg);
}

.letter-spacing-1 {
    letter-spacing: 0.5px;
}

/* Sidebar scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Mobile offcanvas sidebar: match the desktop sidebar's theme-aware colors.
   Light mode → white background, dark text (same as .sidebar).
   Dark mode  → [data-bs-theme="dark"] .sidebar below overrides both. */
.offcanvas.sidebar {
    background: #ffffff;
    color: #495057;
    border-right: none;
}

/* Bottom nav active state */
.bottom-nav-item.text-primary .material-icons {
    color: #1976D2;
}

/* ============================================
   Mobile Responsive Utilities
   ============================================ */

/* Main content: add bottom padding on mobile for the bottom nav */
@media (max-width: 767.98px) {
    .main-content {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* Page header bars: allow wrapping on small screens */
@media (max-width: 575.98px) {
    /* Scale down headings slightly for mobile */
    h4, .h4, .mud-typography-h4 {
        font-size: 1.5rem !important;
    }

    h5, .h5, .mud-typography-h5 {
        font-size: 1.15rem !important;
    }

    h6, .h6, .mud-typography-h6 {
        font-size: 1.1rem !important;
    }

    /* Touch targets: minimum 44px on mobile (WCAG 2.5.5) */
    .btn {
        min-height: 44px;
    }

    /* Map container: ensure it fills width on mobile */
    #location-map {
        height: 250px !important;
    }
}

/* Valid/invalid form field styles */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e51c23;
}

.validation-message {
    color: #e51c23;
}

/* Mobile card list: tappable card styling */
.mobile-card-tap {
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}
.mobile-card-tap:active {
    box-shadow: 0 0 0 2px #1976D2 !important;
}

/* Small phones: even tighter */
@media (max-width: 359.95px) {
    h4, .h4 {
        font-size: 1.25rem !important;
    }
}

/* ============================================================
   Shared Data Table Styles
   Used across all list pages for consistent look & feel
   ============================================================ */

.data-table-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead th {
    background: #1a1a1a;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1rem 1.1rem;
    border: 1px solid #333;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.data-table tbody tr:nth-child(odd) {
    background-color: #fff;
}

.data-table tbody tr:nth-child(even) {
    background-color: #e8e8e8;
}

.data-table tbody tr:hover {
    background-color: #d1ecf1 !important;
}

.data-table tbody td {
    padding: 1rem 1.1rem;
    border: 1px solid #ddd;
    vertical-align: middle;
}

/* Sortable column headers */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2.2rem;
}

.data-table th.sortable:hover {
    background: #333;
}

.data-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 0.5rem;
    opacity: 0.4;
    font-size: 0.75rem;
}

.data-table th.sortable.sort-asc::after {
    content: '▲';
    opacity: 1;
}

.data-table th.sortable.sort-desc::after {
    content: '▼';
    opacity: 1;
}

.data-table .cell-primary {
    font-weight: 600;
    color: #1a1a2e;
}

.data-table .cell-secondary {
    color: #6c757d;
    font-size: 0.85rem;
}

.data-table .cell-icon {
    width: 40px;
    text-align: center;
}

.data-table .cell-icon .material-icons {
    font-size: 20px;
    color: #7f8c8d;
}

/* Icon color variants per entity type */
.data-table .cell-icon.icon-location .material-icons { color: #27ae60; }
.data-table .cell-icon.icon-workorder .material-icons { color: #2980b9; }
.data-table .cell-icon.icon-client .material-icons { color: #8e44ad; }
.data-table .cell-icon.icon-vendor .material-icons { color: #e67e22; }
.data-table .cell-icon.icon-project .material-icons { color: #16a085; }
.data-table .cell-icon.icon-invoice .material-icons { color: #7f8c8d; }
.data-table .cell-icon.icon-inspection .material-icons { color: #e74c3c; }
.data-table .cell-icon.icon-contact .material-icons { color: #2c3e50; }

.data-table .cell-actions {
    width: 40px;
    text-align: center;
}

.data-table .cell-badge {
    white-space: nowrap;
}

/* Status pill badges */
.badge-pill {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3em 0.75em;
    border-radius: 50rem;
}

.badge-active {
    background-color: #4CAF50;
    color: #000;
}

.badge-inactive {
    background-color: #9e9e9e;
    color: #fff;
}

.badge-pending {
    background-color: #FF9800;
    color: #fff;
}

.badge-completed {
    background-color: #2196F3;
    color: #fff;
}

.badge-cancelled {
    background-color: #f44336;
    color: #fff;
}

.badge-draft {
    background-color: #9e9e9e;
    color: #fff;
}

.badge-count {
    background-color: #e3f2fd;
    color: #1565c0;
    font-weight: 600;
    min-width: 28px;
    display: inline-block;
    text-align: center;
}

.badge-sent {
    background-color: #03a9f4;
    color: #fff;
}

.badge-paid {
    background-color: #4CAF50;
    color: #000;
}

.badge-overdue {
    background-color: #f44336;
    color: #fff;
}

.badge-viewed {
    background-color: #3f51b5;
    color: #fff;
}

.badge-void {
    background-color: #212121;
    color: #fff;
}

.badge-warning {
    background-color: #FF9800;
    color: #fff;
}

.badge-danger {
    background-color: #f44336;
    color: #fff;
}

.badge-success-light {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-posted {
    background-color: #4CAF50;
    color: #fff;
}

.badge-info {
    background-color: #03a9f4;
    color: #fff;
}

.badge-resent {
    background-color: #3f51b5;
    color: #fff;
}

.badge-imported {
    background-color: #4CAF50;
    color: #fff;
}

.badge-failed {
    background-color: #f44336;
    color: #fff;
}

.badge-skipped {
    background-color: #FF9800;
    color: #fff;
}

.badge-review {
    background-color: #2196F3;
    color: #fff;
}

.badge-due {
    background-color: #FF9800;
    color: #fff;
}

.badge-upcoming {
    background-color: #03a9f4;
    color: #fff;
}

.badge-taxable {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-not-taxable {
    background-color: #f5f5f5;
    color: #9e9e9e;
}

/* Empty state */
.data-table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #adb5bd;
}

.data-table-empty .material-icons {
    font-size: 48px;
    margin-bottom: 0.5rem;
    display: block;
}

/* Mobile responsive — horizontal scroll with sticky first column */
@media (max-width: 767.95px) {
    .data-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   Radzen PanelMenu integration inside the sidebar.
   The sidebar's background follows the active Bootstrap theme
   (light by default; dark when [data-bs-theme="dark"] is on <html>).
   These rules give RadzenPanelMenu transparent backgrounds and
   primary-tinted active state in both themes.
   ───────────────────────────────────────────────────────────────────── */

.sidebar .rz-panel-menu,
.sidebar .rz-navigation {
    background: transparent !important;
    border: none !important;
}

.sidebar .rz-navigation-item-link {
    color: inherit !important;
    background: transparent !important;
    border: none !important;
    padding: 0.55rem 1rem !important;
    border-radius: 0 !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar .rz-navigation-item-link:hover,
.sidebar .rz-navigation-item-link:focus {
    background: rgba(13, 110, 253, 0.08) !important;
}

.sidebar .rz-navigation-item-link.rz-navigation-item-link-active,
.sidebar .rz-navigation-item.rz-navigation-item-active > .rz-navigation-item-wrapper > .rz-navigation-item-link {
    color: var(--bs-primary, #0d6efd) !important;
    background: linear-gradient(90deg, rgba(13, 110, 253, 0.15) 0%, rgba(13, 110, 253, 0.03) 100%) !important;
    border-left: 3px solid var(--bs-primary, #0d6efd) !important;
    padding-left: calc(1rem - 3px) !important;
    font-weight: 600;
}

.sidebar .rz-navigation-item-icon,
.sidebar .rz-navigation-item-link .material-icons,
.sidebar .rz-navigation-item-link .notranslate {
    color: inherit !important;
    margin-right: 0.65rem !important;
}

.sidebar .rz-navigation-item-text {
    color: inherit !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
}

/* Top-level (section) items read like section headers. */
.sidebar .rz-panel-menu > .rz-navigation > .rz-navigation-item > .rz-navigation-item-wrapper > .rz-navigation-item-link .rz-navigation-item-text {
    font-weight: 600 !important;
    letter-spacing: 0.02em;
}

/* Submenu indentation. */
.sidebar .rz-navigation-item .rz-navigation-item .rz-navigation-item-link {
    padding-left: 2.5rem !important;
    font-size: 0.85rem !important;
}

/* Expand/collapse chevron color. */
.sidebar .rz-navigation-item-icon-children,
.sidebar .rz-panel-menu .rz-icon {
    color: inherit !important;
    opacity: 0.6;
}

/* When the sidebar is collapsed (icon-only), hide the menu text and chevrons. */
.sidebar.sidebar-collapsed .rz-navigation-item-text,
.sidebar.sidebar-collapsed .rz-navigation-item-icon-children {
    display: none !important;
}
.sidebar.sidebar-collapsed:hover .rz-navigation-item-text,
.sidebar.sidebar-collapsed:hover .rz-navigation-item-icon-children {
    display: inline-block !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   Dark theme overrides for the sidebar.
   When the user flips the theme toggle, <html> gets data-bs-theme="dark"
   and the sidebar swaps from light to a deep slate that matches the
   Material dark Radzen theme on the content.
   ───────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .sidebar {
    background: #1a1d24;
    color: rgba(255, 255, 255, 0.8);
    border-right-color: #2a2e36;
}

[data-bs-theme="dark"] .sidebar .rz-navigation-item-link:hover,
[data-bs-theme="dark"] .sidebar .rz-navigation-item-link:focus {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .sidebar .rz-navigation-item-link.rz-navigation-item-link-active,
[data-bs-theme="dark"] .sidebar .rz-navigation-item.rz-navigation-item-active > .rz-navigation-item-wrapper > .rz-navigation-item-link {
    color: #6ea8fe !important;
    background: linear-gradient(90deg, rgba(110, 168, 254, 0.18) 0%, rgba(110, 168, 254, 0.04) 100%) !important;
    border-left-color: #6ea8fe !important;
}


/* Projects detail — sticky left rail on desktop only */
@media (min-width: 768px) {
    .project-left-rail { position: sticky; top: 1rem; }
}

/* Projects kanban board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    align-items: start;
}
.kanban-column {
    background: var(--rz-base-50);
    border: 1px solid var(--rz-base-200);
    border-radius: 6px;
    padding: 0.75rem;
    min-height: 200px;
}
.kanban-column-body {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.kanban-card {
    background: white;
    border: 1px solid var(--rz-base-200);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s ease;
}
.kanban-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card-title {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    margin-bottom: 0.125rem;
}
.kanban-card-client {
    font-size: 0.75rem;
    color: var(--rz-base-600);
}
.kanban-card-progress {
    margin-top: 0.5rem;
}
.kanban-empty {
    text-align: center;
    color: var(--rz-base-500);
    font-size: 0.8125rem;
    padding: 1rem 0.25rem;
    font-style: italic;
}
