/* ════════════════════════════════════════════════════════════════════
   ECLIPSE.CSS — consolidated application stylesheet
   Location : EclipseRCLShared/wwwroot/css/eclipse.css
   Served as: _content/EclipseRCLShared/css/eclipse.css

   Contents (in order):
     1. Font import (DM Sans / DM Mono)
     2. Design tokens (:root variables)      — was MainLayout.razor <style>
     3. Reusable page/component helpers      — was MainLayout.razor <style>
     4. Navbar / sidebar / modal styles      — was MainLayout.razor <style>
     5. Page scaffold regions                — new (EclPageScaffold)

   LOAD ORDER RULE: this file must be the LAST stylesheet <link> in
   App.razor. It previously lived in an inline <style> block inside
   MainLayout (which cascades after all <head> links), so several rules
   rely on winning by source order. Keep it last.

   Copyright (c) 2026 Eclipse Technologies. All Rights Reserved
   ════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ════════════════════════════════════════════════════════════════════
   ECLIPSE DESIGN TOKENS
   Single source of truth for colours, spacing, radii, shadows.
   Additive only — defines variables, overrides nothing existing.
   Reference these in pages via the helper classes below, or directly
   with var(--ecl-…). Change a value here = whole app updates.
   ════════════════════════════════════════════════════════════════════ */
:root {
    /* Brand */
    --ecl-primary-dark: #1e3a5f;
    --ecl-primary: #2d5a8e;
    --ecl-primary-grad: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    --ecl-accent-soft: #e8eeff;
    --ecl-accent-hover: #f0f4ff;
    /* Surfaces & text */
    --ecl-bg: #f1f5f9;
    --ecl-surface: #ffffff;
    --ecl-border: #e2e8f0;
    --ecl-border-soft: #f1f5f9;
    --ecl-text: #334155;
    --ecl-text-muted: #64748b;
    --ecl-text-faint: #94a3b8;
    /* State */
    --ecl-danger: #b91c1c;
    --ecl-success: #15803d;
    /* Primitives */
    --ecl-radius: 10px;
    --ecl-radius-sm: 6px;
    --ecl-radius-pill: 20px;
    --ecl-shadow: 0 2px 16px rgba(0,0,0,0.06);
    --ecl-shadow-pop: 0 10px 28px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.06);
    --ecl-font: 'DM Sans', sans-serif;
    --ecl-btn-height: 40px;
}

/* ════════════════════════════════════════════════════════════════════
   REUSABLE PAGE / COMPONENT HELPERS
   Wrap page content in these for a consistent look. Opt-in: existing
   pages are unaffected until they adopt these classes.
   ════════════════════════════════════════════════════════════════════ */
.ecl-page {
    background: var(--ecl-bg);
    font-family: var(--ecl-font);
    min-height: 100%;
}

.ecl-card {
    background: var(--ecl-surface);
    border: 1px solid var(--ecl-border);
    border-radius: var(--ecl-radius);
    box-shadow: var(--ecl-shadow);
    padding: 20px;
}

    .ecl-card + .ecl-card {
        margin-top: 18px;
    }

.ecl-page-header {
    background: var(--ecl-primary-grad);
    color: #ffffff;
    border-radius: var(--ecl-radius);
    padding: 16px 20px;
    margin-bottom: 18px;
    box-shadow: var(--ecl-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .ecl-page-header h1,
    .ecl-page-header .ecl-page-title {
        font-size: 1.05rem;
        font-weight: 600;
        color: #ffffff;
        margin: 0;
        letter-spacing: 0.01em;
    }

    .ecl-page-header .ecl-page-subtitle {
        font-size: 0.8rem;
        color: rgba(255,255,255,0.75);
        margin: 2px 0 0;
    }

.ecl-section-title {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ecl-text-faint);
    margin: 0 0 8px;
}

.ecl-btn-primary {
    background: var(--ecl-primary);
    color: #ffffff;
    border: none;
    height: var(--ecl-btn-height);
    border-radius: var(--ecl-radius);
    padding: 0 18px;
    font-family: var(--ecl-font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

    .ecl-btn-primary:hover {
        background: var(--ecl-primary-dark);
        box-shadow: 0 2px 8px rgba(30,58,95,0.3);
    }

.ecl-btn-secondary {
    background: var(--ecl-surface);
    color: var(--ecl-text);
    border: 1px solid var(--ecl-border);
    height: var(--ecl-btn-height);
    border-radius: var(--ecl-radius);
    padding: 0 18px;
    font-family: var(--ecl-font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

    .ecl-btn-secondary:hover {
        background: var(--ecl-accent-hover);
        border-color: #c7d7f0;
        color: var(--ecl-primary-dark);
    }

.ecl-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

body, .page, .sidebar, article, button, input {
    font-family: 'DM Sans', sans-serif !important;
}

/* Restore FontAwesome glyphs — body !important would otherwise override them */
.fa, i[class*="fa-"] {
    font-family: FontAwesome !important;
    font-style: normal !important;
}

/* ════════════════════════════════════════
   TOP NAVBAR
   ════════════════════════════════════════ */
.sticky.top-0.z-50.flex.flex-row.flex-wrap {
    background: var(--ecl-primary-grad) !important;
    border-bottom: none !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2) !important;
    padding: 12px 24px !important;
}

.sticky.top-0.z-50 .flex-none.w-56 img {
/*    background: #ffffff;*/
    border-radius: 8px;
    padding: 4px 8px;
    filter: none;
}

.sticky.top-0.z-50 .text-gray-800,
.sticky.top-0.z-50 .text-gray-500,
.sticky.top-0.z-50 .text-gray-900,
.sticky.top-0.z-50 h1 {
    color: rgba(255,255,255,0.9) !important;
}

.sticky.top-0.z-50 .text-sm.font-semibold {
    color: #ffffff !important;
    font-weight: 500 !important;
}

/* Stacked user id + cost centre in the top nav (visible on every page) */
.ecl-user-id-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    text-transform: none;
}

.ecl-user-id {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

.ecl-user-cc {
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

    .ecl-user-cc i {
        font-size: 0.6rem;
        opacity: 0.8;
    }

.sticky.top-0.z-50 .fa.fa-chevron-down {
    color: rgba(255,255,255,0.6) !important;
}

.sticky.top-0.z-50 button:hover .fa,
.sticky.top-0.z-50 button:hover i {
    color: #ffffff !important;
}

.sticky.top-0.z-50 .w-8.h-8.rounded-full {
    border: 2px solid rgba(255,255,255,0.3) !important;
}

.sticky.top-0.z-50 .rounded-full.bg-red-700 {
    box-shadow: 0 0 0 2px var(--ecl-primary-dark) !important;
    font-size: 0.6rem !important;
}

/* ── User Dropdown ── */
.menu.rounded.bg-white.shadow-md {
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.06) !important;
    overflow: hidden;
    min-width: 200px !important;
}

    .menu.rounded.bg-white.shadow-md a {
        font-size: 0.82rem !important;
        padding: 10px 16px !important;
        color: #334155 !important;
        border-bottom: 1px solid #f8fafc !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        transition: background 0.12s, color 0.12s !important;
    }

        .menu.rounded.bg-white.shadow-md a:last-child {
            border-bottom: none !important;
        }

        .menu.rounded.bg-white.shadow-md a:hover {
            background: #f0f4ff !important;
            color: var(--ecl-primary-dark) !important;
        }

/* ── User menu (restyled) ── */
.ecl-usermenu {
    min-width: 220px;
    background: var(--ecl-surface);
    border: 1px solid var(--ecl-border);
    border-radius: var(--ecl-radius);
    box-shadow: var(--ecl-shadow-pop);
    overflow: hidden;
    padding: 6px;
}

.ecl-usermenu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--ecl-border-soft);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ecl-text-muted);
}

    .ecl-usermenu-head i {
        color: var(--ecl-text-faint);
        width: 16px;
        text-align: center;
    }

.ecl-usermenu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--ecl-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ecl-text);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

    /* Unified muted icon treatment — colour comes in on hover */
    .ecl-usermenu-item i {
        width: 16px;
        text-align: center;
        font-size: 0.9rem;
        color: var(--ecl-text-faint);
        transition: color 0.12s;
        flex-shrink: 0;
    }

    .ecl-usermenu-item span {
        flex: 1;
    }

    .ecl-usermenu-item:hover {
        background: var(--ecl-accent-soft);
        color: var(--ecl-primary-dark);
    }

        .ecl-usermenu-item:hover i {
            color: var(--ecl-primary);
        }

/* Cost-centre row reads as context/value, not a plain action */
.ecl-usermenu-context span {
    /* DM Sans + tabular figures for a plain zero (DM Mono's zero is always
       dotted/slashed); tabular keeps the code digits aligned. */
    font-family: 'DM Sans', sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    font-size: 0.8rem;
}

.ecl-usermenu-chev {
    font-size: 0.65rem !important;
    color: var(--ecl-text-faint);
}

/* Logout — distinct exit action, separated and red-tinted */
.ecl-usermenu-logout {
    margin-top: 4px;
    border-top: 1px solid var(--ecl-border-soft);
    border-radius: 0 0 var(--ecl-radius-sm) var(--ecl-radius-sm);
    color: var(--ecl-danger);
}

    .ecl-usermenu-logout i {
        color: var(--ecl-danger);
    }

    .ecl-usermenu-logout:hover {
        background: #fef2f2;
        color: var(--ecl-danger);
    }

        .ecl-usermenu-logout:hover i {
            color: var(--ecl-danger);
        }

/* ════════════════════════════════════════
   SIDEBAR  —  REDESIGNED (state-driven)
   ════════════════════════════════════════ */
.ecl-sidebar {
    width: 264px;
    background: #ffffff;
    border-right: 1px solid #e8edf3;
    box-shadow: 2px 0 16px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: none;
    transition: margin-left 0.22s ease, width 0.22s ease;
}

    /* Desktop collapsed state — slides off to the left, no JS needed */
    .ecl-sidebar.collapsed {
        margin-left: -264px;
    }

/* Sidebar header (logo row already in top navbar; this is the close/title strip) */
.ecl-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

    .ecl-sidebar-head .title {
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: #b0bac9;
    }

    .ecl-sidebar-head .collapse-btn {
        color: #94a3b8;
        font-size: 0.9rem;
        background: none;
        border: none;
        cursor: pointer;
        transition: color 0.15s;
        padding: 4px;
    }

        .ecl-sidebar-head .collapse-btn:hover {
            color: var(--ecl-primary-dark);
        }

/* ── Search ── */
.ecl-search-wrap {
    position: relative;
    margin: 10px 12px 6px;
    flex-shrink: 0;
}

.ecl-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 1;
}

.ecl-search-input {
    width: 100%;
    padding: 9px 12px 9px 32px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f4f7fb;
    font-size: 0.8rem;
    color: #334155;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
    box-sizing: border-box;
}

    .ecl-search-input::placeholder {
        color: #b0bac9;
    }

    .ecl-search-input:focus {
        border-color: #93c5fd;
        box-shadow: 0 0 0 3px rgba(147,197,253,0.2);
        background: #ffffff;
    }

/* ── Scroll region holding the tree ── */
.ecl-nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px 16px;
}

    .ecl-nav-scroll::-webkit-scrollbar {
        width: 3px;
    }

    .ecl-nav-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .ecl-nav-scroll::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }

        .ecl-nav-scroll::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

.ecl-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b0bac9;
    padding: 12px 10px 6px;
}

/* ── Category row (top level) ── */
.ecl-cat {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2px;
}

.ecl-cat-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease;
    user-select: none;
}

    .ecl-cat-header:hover {
        background: #f0f4ff;
    }

    .ecl-cat-header.active {
        background: var(--ecl-primary-grad);
    }

        .ecl-cat-header.active .ecl-cat-label {
            color: #ffffff;
            font-weight: 600;
        }

        .ecl-cat-header.active img.ecl-icon {
            /* Keep the logo in full colour; sit it on a white chip so it stays
       legible on the dark active bar, and bump the size a touch. */
            background: #ffffff;
            padding: 2px;
            width: 26px;
            height: 26px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.25);
        }

        .ecl-cat-header.active .ecl-chevron {
            color: rgba(255,255,255,0.7);
        }

    .ecl-cat-header img.ecl-icon {
        width: 22px;
        height: 22px;
        border-radius: 5px;
        object-fit: contain;
        flex-shrink: 0;
    }

    /* FontAwesome icon used by shortcuts (Home) — sized to match image icons */
    .ecl-cat-header .ecl-icon-fa {
        width: 22px;
        font-size: 1rem;
        text-align: center;
        color: #64748b;
        flex-shrink: 0;
    }

    .ecl-cat-header.active .ecl-icon-fa {
        color: #ffffff;
    }

.ecl-cat-label {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: #334155;
    text-transform: capitalize;
    line-height: 1.2;
}

.ecl-chevron {
    color: #94a3b8;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

    .ecl-chevron.open {
        transform: rotate(180deg);
    }

/* ── Expanded body of a category ── */
.ecl-cat-body {
    padding: 2px 0 6px 6px;
    margin-left: 12px;
    border-left: 1px solid #eef2f7;
}

/* ── Sub-category header ── */
.ecl-subcat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 4px 0 2px;
    cursor: pointer;
    border-radius: 7px;
    background: var(--ecl-primary-grad, linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%));
    transition: filter 0.12s, box-shadow 0.12s;
    user-select: none;
    box-shadow: 0 1px 3px rgba(30,58,95,0.18);
}

    .ecl-subcat-header:hover {
        filter: brightness(1.08);
        box-shadow: 0 2px 6px rgba(30,58,95,0.28);
    }

.ecl-subcat-label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
}

/* Chevron sits on the navy bar — make it white to match */
.ecl-subcat-header .ecl-chevron {
    color: rgba(255,255,255,0.8);
}

/* ── Form link (leaf) ── */
.ecl-form-list {
    position: relative;
    padding-left: 6px;
    margin: 2px 0 4px 4px;
    border-left: 1.5px solid #e8edf3;
}

.ecl-form-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 12px 6px 8px;
    margin: 0 4px;
    font-size: 0.8rem;
    font-weight: 400;
    color: #3d4f63;
    line-height: 1.3;
    text-decoration: none;
    border-radius: 6px;
    text-transform: capitalize;
    transition: background 0.12s, color 0.12s;
}

    /* Small connector dot anchoring each item to the guide line */
    .ecl-form-link::before {
        content: '';
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: #cbd5e1;
        flex-shrink: 0;
        transition: background 0.12s, transform 0.12s;
    }

    .ecl-form-link:hover {
        background: #f0f5ff;
        color: var(--ecl-primary-dark);
        font-weight: 500;
    }

        .ecl-form-link:hover::before {
            background: var(--ecl-primary);
            transform: scale(1.3);
        }

    .ecl-form-link.active {
        background: var(--ecl-accent-soft);
        color: var(--ecl-primary-dark);
        font-weight: 600;
    }

        .ecl-form-link.active::before {
            background: var(--ecl-primary);
            transform: scale(1.4);
        }

.ecl-empty-hint {
    padding: 10px 12px;
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

/* ── Open-sidebar tab (shows when collapsed on desktop) ── */
.ecl-open-tab {
    position: fixed;
    top: 80px;
    left: 0;
    z-index: 40;
    background: var(--ecl-primary-grad);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 10px 8px;
    cursor: pointer;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.15);
    transition: padding 0.15s;
}

    .ecl-open-tab:hover {
        padding-left: 12px;
    }

/* ════════════════════════════════════════
   MOBILE DRAWER
   ════════════════════════════════════════ */
.ecl-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    z-index: 45;
    animation: ecl-fade 0.2s ease;
}

@keyframes ecl-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .ecl-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 50;
        width: 280px;
        margin-left: 0;
        box-shadow: 4px 0 24px rgba(0,0,0,0.25);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

        .ecl-sidebar.drawer-open {
            transform: translateX(0);
        }
        /* On mobile the desktop "collapsed" class is irrelevant; drawer state rules */
        .ecl-sidebar.collapsed {
            margin-left: 0;
        }
}

/* ── Main content ── */
.bg-gray-100.flex-1.p-6 {
    background: #f1f5f9 !important;
}

/* ── Scrollbars — thin, rounded, subtle (matches sidebar treatment) ── */
/* Main content scroll area */
article.overflow-y-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

article.overflow-y-scroll::-webkit-scrollbar-track {
    background: transparent;
}

article.overflow-y-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

    article.overflow-y-scroll::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
        background-clip: content-box;
    }

/* Global fallback for any other scroll containers in the app */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

    *::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
        background-clip: content-box;
    }

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* ════════════════════════════════════════
   REUSABLE MODAL  (.ecl-modal-*)
   Compact, branded, scrolls. Reuse these classes on other modals
   (incl. EclModal.razor) for a consistent look.
   ════════════════════════════════════════ */
.ecl-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15,23,42,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: ecl-fade 0.15s ease;
}

.ecl-modal {
    background: var(--ecl-surface);
    border-radius: var(--ecl-radius);
    box-shadow: var(--ecl-shadow-pop);
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--ecl-font);
}

.ecl-modal-header {
    background: var(--ecl-primary-grad);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ecl-modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.ecl-modal-subtitle {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
    margin: 2px 0 0;
}

/* Close button — matches the Task Capture / search modal close (translucent
   white square, white X). The explicit white on the inner i stops a global
   .fa / red utility from tinting the glyph red. */
.ecl-modal-close {
    background: rgba(255,255,255,0.14) !important;
    border: none;
    color: #ffffff !important;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

    .ecl-modal-close i,
    .ecl-modal-close .fa {
        color: #ffffff !important;
    }

    .ecl-modal-close:hover {
        background: rgba(255,255,255,0.26) !important;
    }

.ecl-modal-search-wrap {
    position: relative;
    padding: 16px 20px 8px;
    flex-shrink: 0;
}

.ecl-modal-search-icon {
    position: absolute;
    left: 33px;
    top: 50%;
    transform: translateY(-30%);
    color: var(--ecl-text-faint);
    font-size: 0.8rem;
    pointer-events: none;
}

.ecl-modal-search {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid var(--ecl-border);
    border-radius: var(--ecl-radius-sm);
    background: #f8fafc;
    font-size: 0.88rem;
    color: var(--ecl-text);
    font-family: var(--ecl-font);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

    .ecl-modal-search:focus {
        border-color: #93c5fd;
        box-shadow: 0 0 0 3px rgba(147,197,253,0.2);
        background: #ffffff;
    }

    .ecl-modal-search::placeholder {
        color: var(--ecl-text-faint);
    }

.ecl-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}

.ecl-modal-loading,
.ecl-modal-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 120px;
    color: var(--ecl-text-muted);
    font-size: 0.85rem;
}

.ecl-modal-table {
    width: 100%;
    border-collapse: collapse;
}

    .ecl-modal-table thead th {
        position: sticky;
        top: 0;
        background: var(--ecl-surface);
        z-index: 1;
        text-align: left;
        padding: 10px 14px;
        font-size: 0.62rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--ecl-primary-dark);
        border-bottom: 2px solid var(--ecl-border);
    }

.ecl-modal-row {
    cursor: pointer;
    transition: background 0.1s;
}

    .ecl-modal-row td {
        padding: 11px 14px;
        font-size: 0.83rem;
        color: var(--ecl-text);
        border-bottom: 1px solid var(--ecl-border-soft);
    }

        .ecl-modal-row td.mono {
            /* DM Mono's zero always carries a dot or slash (the 'zero' feature only
       switches between the two), which reads as a struck-through zero. Use the
       body sans with tabular figures instead: plain oval zeros that still align
       in a column. */
            font-family: 'DM Sans', sans-serif;
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.02em;
            font-size: 0.8rem;
            color: var(--ecl-text-muted);
        }

    .ecl-modal-row:hover td {
        background: var(--ecl-accent-soft);
        color: var(--ecl-primary-dark);
    }

        .ecl-modal-row:hover td.mono {
            color: var(--ecl-primary);
        }

/* Company (COM) group header — non-clickable banner that groups its branches */
.ecl-modal-company td {
    padding: 10px 14px;
    background: var(--ecl-accent-soft);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ecl-primary-dark);
    border-bottom: 1px solid #d7e0f5;
    border-top: 1px solid #d7e0f5;
    cursor: default; /* not selectable */
    user-select: none;
}

    .ecl-modal-company td.mono {
        color: var(--ecl-primary);
    }

/* No hover affordance on company rows — signals "not clickable" */
.ecl-modal-company:hover td {
    background: var(--ecl-accent-soft);
}

/* Child branches sit visually under their company */
.ecl-modal-child td:first-child {
    padding-left: 28px;
    position: relative;
}

    .ecl-modal-child td:first-child::before {
        content: '';
        position: absolute;
        left: 14px;
        top: 50%;
        width: 6px;
        height: 1px;
        background: var(--ecl-text-faint);
        opacity: 0.5;
    }

.ecl-modal-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--ecl-border-soft);
    color: var(--ecl-text-muted);
}

    .ecl-modal-tag.com {
        background: var(--ecl-accent-soft);
        color: var(--ecl-primary);
    }

.ecl-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--ecl-border-soft);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* ════════════════════════════════════════
   NAVBAR POPOVERS  (notifications / approvals)
   ════════════════════════════════════════ */
.ecl-popover {
    width: 360px;
    max-width: calc(100vw - 24px);
    background: var(--ecl-surface);
    border: 1px solid var(--ecl-border);
    border-radius: var(--ecl-radius);
    box-shadow: var(--ecl-shadow-pop);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ecl-popover-wide {
    width: 420px;
}

.ecl-popover-header {
    background: var(--ecl-primary-grad);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ecl-popover-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

    .ecl-popover-title i {
        color: rgba(255,255,255,0.8);
        font-size: 0.85rem;
    }

.ecl-popover-count {
    background: #ffffff;
    color: var(--ecl-primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ecl-popover-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ecl-popover-close {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
}

    .ecl-popover-close:hover {
        background: rgba(255,255,255,0.25);
    }

.ecl-popover-body {
    background: var(--ecl-surface);
}

.ecl-popover-scroll {
    max-height: 380px;
    overflow-y: auto;
}

.ecl-popover-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 20px;
    color: var(--ecl-text-faint);
    font-size: 0.82rem;
}

    .ecl-popover-empty i {
        font-size: 1.5rem;
        opacity: 0.5;
    }

.ecl-popover-footer {
    border-top: 1px solid var(--ecl-border-soft);
    padding: 8px;
    flex-shrink: 0;
}

.ecl-popover-link {
    display: block;
    text-align: center;
    padding: 9px;
    border-radius: var(--ecl-radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--ecl-primary);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

    .ecl-popover-link:hover {
        background: var(--ecl-accent-soft);
        color: var(--ecl-primary-dark);
    }

/* ── Approval list item ── */
.ecl-approval-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ecl-border-soft);
    text-decoration: none;
    transition: background 0.1s;
}

    .ecl-approval-item:last-child {
        border-bottom: none;
    }

    .ecl-approval-item:hover {
        background: var(--ecl-accent-hover);
    }

.ecl-approval-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--ecl-accent-soft);
    color: var(--ecl-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.ecl-approval-info {
    flex: 1;
    min-width: 0;
}

.ecl-approval-amount {
    /* DM Sans + tabular figures: plain zero, digits still aligned. */
    font-family: 'DM Sans', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ecl-primary-dark);
    line-height: 1.2;
}

.ecl-approval-meta {
    font-size: 0.74rem;
    color: var(--ecl-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.ecl-approval-sub {
    font-size: 0.7rem;
    color: var(--ecl-text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ecl-approval-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ecl-approval-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.12s;
}

    .ecl-approval-btn:hover {
        filter: brightness(0.92);
    }

    .ecl-approval-btn.accept {
        background: #dcfce7;
        color: #15803d;
    }

    .ecl-approval-btn.reject {
        background: #fee2e2;
        color: #b91c1c;
    }

    .ecl-approval-btn.finalize {
        background: var(--ecl-accent-soft);
        color: var(--ecl-primary);
    }

/* ════════════════════════════════════════════════════════════════════
   5. PAGE SCAFFOLD REGIONS  (EclPageScaffold / EclDynamicPage)
   ════════════════════════════════════════════════════════════════════ */

/* Content column + optional aside panel */
.ecl-scaffold-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

    .ecl-scaffold-main.has-aside {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

@media (max-width: 1100px) {
    .ecl-scaffold-main.has-aside {
        grid-template-columns: 1fr;
    }
}

.ecl-scaffold-primary > * + * {
    margin-top: 18px;
}

/* Toolbar: filter controls flow in a row and wrap */
.ecl-region-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    padding: 14px 20px;
}

/* Footer button bar sits flush right, matches ecl-btn-row spacing */
.ecl-region-footer {
    justify-content: flex-end;
    margin-top: 0; /* .ecl-btn-row adds 16px; scaffold gap already covers it */
}

/* Header actions cluster (right side of the banner) */
.ecl-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Aside panel headings reuse the section-title style */
.ecl-region-aside .ecl-section-title {
    margin-top: 14px;
}

    .ecl-region-aside .ecl-section-title:first-child {
        margin-top: 0;
    }
