/* AXIS Enterprise UI — performance-oriented design system */
:root {
    --axis-primary: #1e3a5f;
    --axis-primary-dark: #0f2744;
    --axis-primary-light: #2563eb;
    --axis-accent: #eff6ff;
    --axis-sidebar: #0f172a;
    --axis-sidebar-hover: #1e293b;
    --axis-sidebar-active: #2563eb;
    --axis-surface: #ffffff;
    --axis-bg: #ffffff;
    --axis-border: #e2e8f0;
    --axis-text: #0f172a;
    --axis-muted: #64748b;
    --axis-success: #059669;
    --axis-warning: #d97706;
    --axis-danger: #dc2626;
    --sidebar-w: 272px;
    --sidebar-w-col: 72px;
    --topbar-h: 56px;
    --topnav-h: 42px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--axis-bg);
    color: var(--axis-text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--axis-primary-light); }
a:hover { color: var(--axis-primary-dark); }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: var(--sidebar-w);
    background: var(--axis-sidebar);
    transition: width var(--transition), transform var(--transition);
    z-index: 1045;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-md);
    contain: layout style;
}

#sidebar.collapsed { width: var(--sidebar-w-col); }

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #fff;
    min-height: 110px;
    text-decoration: none;
}

/* Logos — application (platform) vs company (tenant); CSS scales per placement */
.logo,
.brand-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}

.logo--app.logo--login,
.brand-logo--login {
    display: block;
    height: 32px;
    max-height: 32px;
    width: auto;
    max-width: 100%;
    margin-inline: auto;
    object-fit: contain;
    object-position: center;
}

.logo--company.logo--sidebar,
.brand-logo--sidebar {
    max-height: 52px;
    max-width: 170px;
}

.logo--app.logo--topbar,
.brand-logo--topbar {
    max-height: 28px;
    max-width: 140px;
}

.logo--company.logo--settings,
.brand-logo--settings {
    max-height: 60px;
    max-width: 160px;
}

.logo--company.logo--inline,
.brand-logo--inline {
    max-height: 28px;
    max-width: 28px;
    border-radius: 4px;
}

.logo--company.logo--picker,
.logo--company.logo--inline {
    max-height: 32px;
    max-width: 32px;
    border-radius: 4px;
}

.logo--company.logo--print,
.brand-logo--print {
    max-height: 55px;
    max-width: 160px;
}

.logo-preview,
.brand-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 60px;
    padding: 4px;
    border: 1px solid var(--axis-border);
    border-radius: 6px;
    background: #fff;
}

.sidebar-brand span {
    max-width: 100%;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.25;
    color: var(--axis-text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar.collapsed .sidebar-brand { min-height: 72px; padding: 12px 8px; }
#sidebar.collapsed .logo--company.logo--sidebar,
#sidebar.collapsed .brand-logo--sidebar { max-height: 34px; max-width: 52px; }
#sidebar.collapsed .sidebar-brand span { display: none; }

.nav-group-label {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 16px 6px;
    white-space: nowrap;
    overflow: hidden;
}

.nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
    gap: 8px;
}

.nav-group-leading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nav-group-leading > i {
    font-size: 15px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    color: #94a3b8;
}

.nav-group-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.nav-group-toggle:hover .nav-group-leading > i,
.nav-group-toggle[aria-expanded="true"] .nav-group-leading > i { color: #fff; }
.nav-group-toggle[aria-expanded="true"] { color: #fff; }
.nav-group-toggle .group-arrow { font-size: 11px; transition: transform var(--transition); color: #94a3b8; flex-shrink: 0; }
.nav-group-toggle[aria-expanded="true"] .group-arrow { transform: rotate(90deg); color: #fff; }
#sidebar.collapsed .nav-group-label { visibility: hidden; height: 6px; padding: 0; }

.nav-item-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    text-decoration: none;
    padding: 10px 16px;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    overflow: hidden;
    border-left: 3px solid transparent;
    font-size: 13px;
    font-weight: 500;
    min-height: 40px;
}

.nav-item-link i { font-size: 16px; flex-shrink: 0; width: 18px; text-align: center; color: #94a3b8; }
.nav-item-link:hover { background: var(--axis-sidebar-hover); color: #fff; }
.nav-item-link:hover i, .nav-item-link.active i { color: #fff; }
.nav-item-link.active {
    background: rgba(37, 99, 235, 0.18);
    color: #fff;
    font-weight: 600;
    border-left-color: var(--axis-sidebar-active);
}

.nav-submenu { background: #0b1220; padding: 2px 0 8px; border-top: 1px solid rgba(255, 255, 255, 0.04); }
.nav-submenu .nav-item-link { padding-left: 16px; font-size: 12.5px; min-height: 36px; color: #94a3b8; }
.nav-submenu .nav-item-link i { font-size: 14px; width: 16px; }
.nav-submenu .nav-item-link.active { background: rgba(37, 99, 235, 0.12); color: #fff; }
.nav-submenu-toggle { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; }
.nav-submenu-toggle .arrow { margin-left: auto; font-size: 11px; transition: transform var(--transition); }
.nav-submenu-toggle[aria-expanded="true"] .arrow { transform: rotate(90deg); }
.nav-sub-submenu { background: #070d18; padding: 2px 0 6px; }
.nav-sub-submenu .nav-item-link { padding-left: 28px; font-size: 12px; min-height: 34px; }
.nav-sub-submenu .nav-item-link i { font-size: 13px; width: 15px; }
#sidebar.collapsed .nav-submenu { display: none !important; }
#sidebar.collapsed .nav-item-link { justify-content: center; padding: 10px 8px; margin: 2px 6px; border-radius: var(--radius-sm); border-left: 0; }
#sidebar.collapsed .nav-item-link span, #sidebar.collapsed .nav-item-link .badge { display: none; }

/* Sidebar scrollbar — easier to grab with mouse on desktop */
@media (min-width: 769px) {
    #sidebar {
        scrollbar-width: auto;
        scrollbar-color: #64748b #0f172a;
    }

    #sidebar::-webkit-scrollbar {
        width: 14px;
    }

    #sidebar::-webkit-scrollbar-track {
        background: #0f172a;
        border-left: 1px solid rgba(255, 255, 255, 0.06);
    }

    #sidebar::-webkit-scrollbar-thumb {
        background: #64748b;
        border-radius: 8px;
        border: 3px solid #0f172a;
        min-height: 48px;
    }

    #sidebar::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

    #sidebar::-webkit-scrollbar-thumb:active {
        background: #cbd5e1;
        cursor: grabbing;
    }

    #sidebar::-webkit-scrollbar-corner {
        background: #0f172a;
    }
}

@media (max-width: 768px) {
    #sidebar {
        scrollbar-width: thin;
        scrollbar-color: #475569 #0f172a;
    }

    #sidebar::-webkit-scrollbar { width: 8px; }
    #sidebar::-webkit-scrollbar-track { background: #0f172a; }
    #sidebar::-webkit-scrollbar-thumb {
        background: #475569;
        border-radius: 999px;
        border: 2px solid #0f172a;
    }
}

#sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

#sidebar-backdrop.show { display: block; }

/* ── Topbar ──────────────────────────────────────────────────────────── */
#topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--axis-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 1030;
    transition: left var(--transition);
}

#topbar.expanded { left: var(--sidebar-w-col); }

#topbar:has(.topbar-user-menu.show) {
    z-index: 1070;
}

#sidebarToggle {
    background: none;
    border: none;
    color: var(--axis-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#sidebarToggle:hover { background: var(--axis-accent); }

.topbar-center {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-brand-logo-link {
    align-items: center;
    line-height: 0;
    text-decoration: none;
    flex-shrink: 0;
}
.topbar-brand-logo-link--mobile { margin-left: 4px; }


.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--axis-primary-light);
    flex-shrink: 0;
}

/* ── Topbar user menu ────────────────────────────────────────────────────── */
.topbar-user-dropdown { position: relative; }

.topbar-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--axis-text);
}

.topbar-user-toggle:hover { background: var(--axis-accent); }

.topbar-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--axis-text);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user-caret {
    font-size: 11px;
    color: #94a3b8;
}

.topbar-user-menu {
    min-width: 260px;
    border: 1px solid var(--axis-border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    z-index: 1070;
}

.topbar-user-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.topbar-user-summary-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--axis-border);
    flex-shrink: 0;
}

.topbar-user-summary-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.topbar-user-summary-role {
    font-size: 12px;
    color: var(--axis-muted);
    margin-top: 1px;
}

.topbar-user-summary-email {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    word-break: break-all;
}

.topbar-user-menu .dropdown-item {
    font-size: 13px;
    padding: 9px 16px;
}

/* ── My Profile modal ────────────────────────────────────────────────────── */
.profile-modal-dialog { max-width: 480px; }

.profile-modal {
    border: 1px solid var(--axis-border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

.profile-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.profile-modal-subtitle {
    font-size: 13px;
    color: var(--axis-muted);
    margin-top: 2px;
}

.profile-photo-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.profile-photo-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--axis-border);
    flex-shrink: 0;
}

.profile-photo-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-upload-btn { cursor: pointer; }

.profile-remove-btn:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.profile-form-label {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.profile-input-readonly {
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
}

.profile-save-btn {
    background: var(--axis-primary);
    border-color: var(--axis-primary);
    min-width: 88px;
}

.profile-save-btn:hover {
    background: var(--axis-primary-dark);
    border-color: var(--axis-primary-dark);
}

/* ── Top navigation menu bar ───────────────────────────────────────────── */
#topnav {
    position: fixed;
    top: var(--topbar-h);
    left: var(--sidebar-w);
    right: 0;
    height: var(--topnav-h);
    background: #fff;
    border-bottom: 1px solid var(--axis-border);
    z-index: 1035;
    transition: left var(--transition);
    overflow: hidden;
}

#topnav.expanded { left: var(--sidebar-w-col); }

.topnav-scroll {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.topnav-scroll::-webkit-scrollbar {
    height: 4px;
}

.topnav-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.topnav-menu {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    justify-content: space-between;
    column-gap: 2px;
    width: max-content;
    min-width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 8px;
    list-style: none;
}

.topnav-item {
    position: relative;
    flex: 0 0 auto;
}

.topnav-item--compact .topnav-link {
    padding-left: 9px;
    padding-right: 9px;
}

.topnav-item--module .topnav-link {
    padding-left: 12px;
    padding-right: 12px;
}

.topnav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 100%;
    padding: 0 10px;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--transition), color var(--transition);
}

.topnav-link-label {
    line-height: 1.2;
    white-space: nowrap;
}

.topnav-item--module .topnav-link-label {
    font-size: 12.5px;
    letter-spacing: -0.01em;
}

.topnav-item--compact + .topnav-item--module {
    margin-left: 4px;
    padding-left: 4px;
    border-left: 1px solid #e8edf3;
}

.topnav-link:hover,
.topnav-link.show,
.topnav-link.active {
    background: var(--axis-accent);
    color: var(--axis-primary-light);
}

.topnav-link.dropdown-toggle::after {
    display: none;
}

.topnav-link-icon {
    font-size: 14px;
    line-height: 1;
    color: #64748b;
    flex-shrink: 0;
}

.topnav-link:hover .topnav-link-icon,
.topnav-link.show .topnav-link-icon,
.topnav-link.active .topnav-link-icon {
    color: var(--axis-primary-light);
}

.topnav-link-caret {
    font-size: 10px;
    line-height: 1;
    color: #94a3b8;
    margin-left: 1px;
    flex-shrink: 0;
}

.topnav-link:hover .topnav-link-caret,
.topnav-link.show .topnav-link-caret,
.topnav-link.active .topnav-link-caret {
    color: var(--axis-primary-light);
}

.topnav-dropdown {
    font-size: 13px;
    border: 1px solid var(--axis-border);
    box-shadow: var(--shadow-md);
    z-index: 1060;
    overflow: visible;
}

.topnav-dropdown--scroll {
    max-height: 70vh;
    overflow-x: hidden;
    overflow-y: auto;
}

#topnav .dropdown-menu.show {
    display: block;
}

.topnav-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    padding: 8px 14px;
}

.topnav-dropdown .dropdown-item.active,
.topnav-dropdown .dropdown-item:active {
    background: var(--axis-accent);
    color: var(--axis-primary-light);
}

.topnav-inline-toggle {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
}

.topnav-inline-toggle > span {
    flex: 1;
}

.topnav-inline-caret {
    margin-left: auto;
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.topnav-inline-toggle:hover .topnav-inline-caret,
.topnav-inline-toggle[aria-expanded="true"] .topnav-inline-caret,
.topnav-inline-toggle.active .topnav-inline-caret {
    color: var(--axis-primary-light);
}

.topnav-inline-toggle[aria-expanded="true"] .topnav-inline-caret {
    transform: rotate(90deg);
}

.topnav-inline-submenu .topnav-inline-sub {
    padding-left: 2.5rem;
    font-size: 12px;
}

/* ── Open windows tab bar (topbar center) ─────────────────────────────── */
#open-windows {
    flex: 1;
    min-width: 0;
    height: 34px;
    background: #f8fafc;
    border: 1px solid var(--axis-border);
    border-radius: 8px;
    overflow: hidden;
}

#open-windows[hidden] {
    display: none !important;
}

.open-windows-scroll {
    display: flex;
    align-items: stretch;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.open-windows-scroll::-webkit-scrollbar { display: none; }

.open-window-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 8px 0 12px;
    border-right: 1px solid #e2e8f0;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 180px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.open-window-tab:hover {
    background: #e8edf3;
    color: #0f172a;
}

.open-window-tab.active {
    background: #fff;
    color: var(--axis-primary);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--axis-primary-light);
}

.open-window-label {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.open-window-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.open-window-close:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}

/* ── Main ────────────────────────────────────────────────────────────── */
#main {
    margin-left: var(--sidebar-w);
    padding-top: calc(var(--topbar-h) + var(--topnav-h));
    transition: margin-left var(--transition), padding-top var(--transition);
    min-height: 100dvh;
}

#main.expanded { margin-left: var(--sidebar-w-col); }
.page-content { padding: 20px 24px 32px; max-width: 1600px; }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title { font-size: 1.35rem; font-weight: 700; color: var(--axis-primary-dark); margin: 0; letter-spacing: -0.02em; }
.page-subtitle { font-size: 13px; color: var(--axis-muted); margin: 4px 0 0; }

/* ── Cards & tables ──────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--axis-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--axis-surface);
    overflow: hidden;
}

.card-header {
    background: var(--axis-surface);
    border-bottom: 1px solid var(--axis-border);
    padding: 14px 18px;
    font-weight: 600;
    font-size: 14px;
    color: var(--axis-primary-dark);
}

.card-body { padding: 18px; }

.kpi-card {
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--axis-border);
    box-shadow: var(--shadow-sm);
    background: var(--axis-surface);
    height: 100%;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.kpi-label { font-size: 12px; color: var(--axis-muted); font-weight: 500; margin: 0; }
.kpi-value { font-size: 1.35rem; font-weight: 700; margin: 2px 0 0; letter-spacing: -0.02em; }

.table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--axis-muted);
    font-weight: 600;
    border-top: none;
    background: #f8fafc;
    white-space: nowrap;
}

.table td { font-size: 13px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }

.table-responsive {
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
}

/* ── Forms & buttons ───────────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 4px; color: #334155; }
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--axis-border);
    font-size: 14px;
    min-height: 38px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--axis-primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--axis-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--axis-accent);
    margin-bottom: 14px;
}

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary { background: var(--axis-primary-light); border-color: var(--axis-primary-light); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-sm { font-size: 12px; min-height: 32px; padding: 4px 10px; }

.alert { border-radius: var(--radius-sm); font-size: 13px; border: none; }

.status-draft     { background: #f1f5f9; color: #475569; }
.status-submitted { background: #dbeafe; color: #1e40af; }
.status-approved  { background: #d1fae5; color: #065f46; }
.status-posted    { background: var(--axis-primary-dark); color: #fff; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-rejected  { background: #fef3c7; color: #92400e; }

.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }

/* ── Auth pages ────────────────────────────────────────────────────────── */
.axis-auth-body {
    min-height: 100dvh;
    background: linear-gradient(145deg, var(--axis-primary-dark) 0%, var(--axis-primary) 55%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.axis-login-page {
    min-height: 100dvh;
    margin: 0;
    background: #1d2939;
    font-family: Inter, 'Segoe UI', system-ui, sans-serif;
}

.axis-login-shell {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.axis-login-card {
    background: #fff;
    width: 100%;
    max-width: 400px;
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .21);
    text-align: center;
}

.axis-login-header {
    margin-bottom: 28px;
}

.axis-login-brand {
    margin-bottom: 16px;
    overflow: visible;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.axis-login-welcome {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.axis-login-tagline {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.axis-login-brand .logo--app.logo--login,
.axis-login-brand .brand-logo--login {
    display: block;
    flex-shrink: 0;
    height: 32px;
    max-height: 32px;
}

.axis-select-company-card .logo--app.logo--login,
.axis-select-company-card .brand-logo--login {
    display: block;
    flex-shrink: 0;
    height: 32px;
    max-height: 32px;
}

.axis-login-alert {
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 14px;
    padding: 10px 12px;
    text-align: left;
}

.axis-login-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.axis-login-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.axis-login-form {
    text-align: left;
}

.axis-login-field {
    margin-bottom: 1rem;
}

.axis-login-input {
    width: 100%;
    display: block;
    border: 1px solid #c0ccda;
    border-radius: 3px;
    background: #fff;
    color: #1b2e4b;
    font-size: .875rem;
    line-height: 1.5;
    padding: .59rem .75rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.axis-login-input::placeholder {
    color: #a3aeb7;
}

.axis-login-input:focus {
    border-color: #9eb4ca;
    box-shadow: none;
    outline: none;
}

.axis-login-input.is-invalid {
    border-color: #dc3545;
}

.axis-login-input:-webkit-autofill,
.axis-login-input:-webkit-autofill:hover,
.axis-login-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1b2e4b;
    box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 9999s ease-out 0s;
}

.axis-login-submit {
    width: 100%;
    border: 1px solid #17a2b8;
    border-radius: 3px;
    background: #17a2b8;
    color: #fff;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.5;
    padding: .59rem .75rem;
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out;
}

.axis-login-submit:hover {
    background: #138496;
    border-color: #117a8b;
}

.axis-login-submit:disabled {
    opacity: .85;
    cursor: not-allowed;
}

.axis-login-footer {
    margin-top: 30px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

@media (min-width: 576px) {
    .axis-login-card {
        padding: 40px;
    }
}

.axis-auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.axis-auth-logo-panel {
    background: #fff;
    padding: 28px 32px 8px;
    text-align: center;
}

.axis-auth-header {
    background: linear-gradient(145deg, var(--axis-primary-dark), var(--axis-primary-light));
    padding: 18px 32px 24px;
    text-align: center;
    color: #fff;
}

.axis-auth-header .login-tagline { font-size: 13px; opacity: 0.9; margin: 0; }
.axis-auth-body .login-body { padding: 28px 32px 32px; }
.axis-auth-body .btn-login {
    background: var(--axis-primary-light);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
}
.axis-auth-body .btn-login:hover { background: #1d4ed8; }
.axis-auth-body .login-footer { text-align: center; font-size: 12px; color: var(--axis-muted); padding: 0 32px 20px; }

.axis-select-company-body { padding: 24px; }
.axis-select-company-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 560px;
    padding: 32px;
}
.axis-select-company-card .logo--app.logo--login,
.axis-select-company-card .brand-logo--login {
    margin-bottom: 16px;
}
.select-company-title { font-size: 1.35rem; font-weight: 700; margin: 0; color: var(--axis-text); }
.company-group-welcome {
    margin: 14px 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--axis-text);
    line-height: 1.4;
}
.company-picker-list { display: flex; flex-direction: column; gap: 8px; }
.company-picker-columns {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 118px 16px;
    gap: 12px;
    align-items: center;
    padding: 0 14px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--axis-muted);
}
.company-picker-columns--compact {
    padding-left: 12px;
    padding-right: 12px;
}
.company-picker-columns-spacer { display: block; }
.company-picker-btn {
    width: 100%;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 118px 16px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--axis-border);
    border-radius: 12px;
    background: #fff;
    text-align: left;
    transition: border-color .15s, box-shadow .15s;
}
.company-picker-btn:hover {
    border-color: var(--axis-primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}
.company-picker-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: var(--axis-muted);
    font-size: 18px;
}
.company-picker-icon img { width: 100%; height: 100%; object-fit: contain; }
.company-picker-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--axis-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.company-picker-login {
    font-size: 12px;
    color: var(--axis-muted);
    white-space: nowrap;
}
.company-picker-arrow { color: #cbd5e1; font-size: 14px; justify-self: end; }
.company-picker-item { margin: 0; }
.company-picker-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}
.company-picker-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.company-picker-hide-form { margin: 0; }
.company-picker-hide-btn {
    width: 42px;
    border: 1px solid var(--axis-border);
    border-radius: 12px;
    background: #fff;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color .15s, border-color .15s, background .15s;
}
.company-picker-hide-btn:hover {
    color: #dc3545;
    border-color: #f5c2c7;
    background: #fff5f5;
}
.company-picker-btn-static { cursor: default; }
.company-picker-btn-static:hover {
    border-color: var(--axis-border);
    box-shadow: none;
}
.company-picker-hidden-panel {
    border: 1px dashed var(--axis-border);
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
}
.company-picker-hidden-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--axis-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 10px;
}
.company-picker-add-btn { white-space: nowrap; }

.text-money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Dashboard reports ───────────────────────────────────────────────────── */
.dash-report-card {
    border: 1px solid var(--axis-border);
    box-shadow: var(--shadow-sm);
}

.dash-report-card .card-body { padding: 20px; }

.dash-report-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dash-report-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.dash-report-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.dash-report-subtitle {
    font-size: 12px;
    color: var(--axis-muted);
    margin: 2px 0 0;
}

.dash-stat-box {
    border: 1px solid var(--axis-border);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fafbfc;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dash-stat-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--axis-muted);
}

.dash-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 4px;
    line-height: 1.25;
    word-break: break-word;
}

.dash-donut-chart { min-height: 180px; }

.dash-wc-rows { display: flex; flex-direction: column; gap: 0; }

.dash-wc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.dash-wc-row.dash-wc-total {
    border-bottom: none;
    border-top: 1px solid var(--axis-border);
    margin-top: 4px;
    padding-top: 14px;
}

.dash-wc-label { font-size: 13px; color: #64748b; font-weight: 500; }
.dash-wc-value { font-size: 14px; font-weight: 600; color: #0f172a; text-align: right; white-space: nowrap; }

.dash-overdue-list { display: flex; flex-direction: column; }

.dash-overdue-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.dash-overdue-item:last-child { border-bottom: none; }

.dash-overdue-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #FCE7F3;
    color: #DB2777;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-overdue-info { flex: 1; min-width: 0; }

.dash-overdue-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-overdue-days { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.dash-overdue-amount {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .page-content { padding: 16px; }
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        width: min(88vw, 300px) !important;
    }

    #sidebar.mobile-open { transform: translateX(0); }
    #topbar, #topbar.expanded,
    #topnav, #topnav.expanded { left: 0 !important; }
    #main, #main.expanded { margin-left: 0 !important; }

    .page-title { font-size: 1.15rem; }
    .kpi-value { font-size: 1.1rem; }
    #topbar { gap: 8px; padding: 0 10px; overflow: visible; }
    #topnav { overflow: hidden; }
    .topnav-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pinch-zoom;
    }
    .nav-item-link { min-height: 44px; }
    .topbar-brand-logo-link--mobile {
        display: inline-flex !important;
    }
    .logo--app.logo--topbar,
    .brand-logo--topbar {
        display: block;
        height: 24px;
        width: auto;
        max-height: 24px;
        max-width: 110px;
        min-width: 48px;
        object-fit: contain;
        object-position: left center;
    }
    .topbar-right { gap: 6px; }
}

@media (max-width: 480px) {
    .company-picker-columns,
    .company-picker-btn {
        grid-template-columns: 34px minmax(0, 1fr) 74px 12px;
        gap: 8px;
    }

    .company-picker-columns {
        padding-left: 10px;
        padding-right: 10px;
    }

    .company-picker-btn {
        padding: 10px;
    }

    .company-picker-login {
        font-size: 10px;
    }

    .axis-select-company-card {
        padding: 24px 16px;
    }
}

/* ── Profit & Loss report panel ─────────────────────────────────────── */
body.page-profit-loss,
body.page-profit-loss #main,
body.page-general-ledger,
body.page-general-ledger #main {
    background: #fff;
}

.pl-report-wrap {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #fff;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #f9fbfd;
    box-shadow: none;
    overflow: visible;
}

.pl-report-filter-field:has(.gl-account-picker) {
    overflow: visible;
}

.pl-report-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px 0;
    background: #fff;
}

.pl-report-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.pl-report-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 0;
}

.pl-report-action-btn:hover {
    color: #111827;
}

.pl-report-action-btn i {
    font-size: 15px;
}

.pl-email-format-group .btn {
    flex: 1 1 0;
}

.pl-dimension-picker {
    position: relative;
}

.pl-dimension-picker-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    background-color: #fff;
}

.pl-dimension-picker-toggle::after {
    display: none;
}

.pl-dimension-picker-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-dimension-picker-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1060;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.pl-dimension-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.pl-dimension-picker-search i {
    color: #9ca3af;
    font-size: 13px;
}

.pl-dimension-picker-search input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.pl-dimension-picker-tree {
    max-height: 280px;
    overflow: auto;
    padding: 6px 0;
}

.pl-dimension-picker-item {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 2px 8px 2px 0;
}

.pl-dimension-picker-toggle-btn {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
}

.pl-dimension-picker-toggle-btn:hover {
    background: #f3f4f6;
}

.pl-dimension-picker-toggle-btn.is-hidden {
    visibility: hidden;
}

.pl-dimension-picker-group {
    flex: 1;
    font-size: 12.5px;
    font-weight: 700;
    color: #374151;
    padding: 6px 8px;
}

.pl-dimension-picker-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 8px 4px 0;
    font-size: 13px;
    color: #111827;
}

.pl-dimension-picker-option input {
    flex-shrink: 0;
}

.pl-dimension-picker-option-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-dimension-picker-option-code {
    font-size: 11px;
    color: #9ca3af;
}

.pl-dimension-picker-empty {
    padding: 18px 12px;
    text-align: center;
    font-size: 12.5px;
    color: #9ca3af;
}

.pl-dimension-picker-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ── P&L party / name tree picker ─────────────────────────────────────── */
.pl-party-picker {
    position: relative;
}

.pl-party-picker-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    background-color: #fff;
}

.pl-party-picker-toggle::after {
    display: none;
}

.pl-party-picker-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-party-picker-menu {
    position: absolute;
    left: 0;
    right: 0;
    min-width: 420px;
    top: calc(100% + 4px);
    z-index: 1060;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.pl-party-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.pl-party-picker-search i {
    color: #9ca3af;
    font-size: 13px;
}

.pl-party-picker-search input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.pl-party-picker-columns {
    display: grid;
    grid-template-columns: 22px 22px 88px minmax(0, 1fr) 92px;
    gap: 8px;
    align-items: center;
    padding: 8px 12px 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.pl-party-picker-tree {
    max-height: 300px;
    overflow: auto;
    padding: 4px 0;
}

.pl-party-picker-item {
    display: grid;
    grid-template-columns: 22px 22px 88px minmax(0, 1fr) 92px;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 32px;
    padding: 4px 12px 4px 8px;
    border: 0;
    background: transparent;
    text-align: left;
    color: inherit;
}

.pl-party-picker-item-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 12px;
}

.pl-party-picker-row {
    cursor: default;
    font-size: 12.5px;
}

.pl-party-picker-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.pl-party-picker-choice input {
    margin: 0;
}

.pl-party-picker-row:hover,
.pl-party-picker-row.is-selected {
    background: #eff6ff;
}

.pl-party-picker-row.is-selected .pl-party-picker-name,
.pl-party-picker-row.is-selected .pl-party-picker-type {
    color: #1d4ed8;
}

.pl-party-picker-toggle-btn {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    padding: 0;
}

.pl-party-picker-toggle-btn:hover {
    background: #f3f4f6;
}

.pl-party-picker-toggle-btn.is-hidden {
    visibility: hidden;
}

.pl-party-picker-group {
    flex: 1;
    font-size: 12.5px;
    font-weight: 700;
    color: #374151;
    padding: 4px 0;
}

.pl-party-picker-code {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-party-picker-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
}

.pl-party-picker-type {
    font-size: 11.5px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-party-picker-empty {
    padding: 18px 12px;
    text-align: center;
    font-size: 12.5px;
    color: #9ca3af;
}

.pl-party-picker-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.pl-multi-filter-option {
    cursor: pointer;
}

.pl-multi-filter-option .pl-dimension-picker-option {
    width: 100%;
}

/* ── Voucher line dimension pickers ───────────────────────────────────── */
.voucher-journal-card {
    overflow: visible;
}

.voucher-journal-card > .card-body {
    overflow: visible;
}

.voucher-journal-footer {
    overflow: visible;
}

.voucher-journal-footer-left {
    min-width: min(100%, 280px);
    max-width: 100%;
}

.voucher-attachments-inline {
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    max-width: 520px;
}

.voucher-attachments-inline-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.voucher-attachments-inline-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #495057;
}

.voucher-attachments-inline-hint {
    font-size: 11.5px;
    margin-top: 4px;
    margin-bottom: 0;
}

.voucher-attachments-inline-list {
    margin-top: 8px;
}

.voucher-attachments-inline-empty {
    font-size: 12.5px;
}

.voucher-attachments-inline .voucher-attachment-table {
    font-size: 12.5px;
    margin-bottom: 0;
}

.voucher-attachments-inline .voucher-attachment-input {
    max-width: 100%;
}

.voucher-form-actions {
    justify-content: flex-end;
}

.voucher-list-filters-card {
    overflow: visible;
}

.voucher-list-filters-card > .card-body {
    overflow: visible;
}

.voucher-list-filter-grid,
.voucher-list-filter-row-secondary,
.voucher-list-filter-field {
    overflow: visible;
}

.vl-filter-picker-menu--portal {
    position: fixed !important;
    right: auto !important;
}

.voucher-list-filters-card .pl-dimension-picker-menu,
.voucher-list-filters-card .pl-party-picker-menu {
    overflow: hidden;
}

.voucher-list-filters-card .pl-dimension-picker-tree,
.voucher-list-filters-card .pl-party-picker-tree {
    max-height: min(420px, calc(100vh - 180px));
}

.vl-dimension-filter-picker .pl-dimension-picker-menu {
    min-width: 360px;
}

.vl-dimension-picker-columns {
    display: grid;
    grid-template-columns: 22px 22px 88px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 8px 12px 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.vl-dimension-picker-item {
    display: grid;
    grid-template-columns: 22px 22px 88px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 32px;
    padding: 4px 12px 4px 8px;
    border: 0;
    background: transparent;
    text-align: left;
    color: inherit;
}

.vl-dimension-picker-item-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 12px;
    grid-column: 1 / -1;
}

.vl-dimension-picker-row {
    cursor: default;
    font-size: 12.5px;
}

.vl-dimension-picker-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.vl-dimension-picker-choice input {
    margin: 0;
}

.vl-dimension-picker-row:hover,
.vl-dimension-picker-row.is-selected {
    background: #eff6ff;
}

.vl-dimension-picker-row.is-selected .vl-dimension-picker-name {
    color: #1d4ed8;
    font-weight: 600;
}

.vl-dimension-picker-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11.5px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vl-dimension-picker-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voucher-list-filters-card .form-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.voucher-list-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 16px;
}

.voucher-list-filter-row-secondary {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px 16px;
    margin-top: 12px;
}

.voucher-list-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e9ecef;
}

.voucher-list-filter-field .form-control,
.voucher-list-filter-field .form-select,
.voucher-list-filter-field .pl-dimension-picker-toggle,
.voucher-list-filter-field .pl-party-picker-toggle {
    min-height: calc(1.5em + 0.75rem + 2px);
    font-size: 0.95rem;
}

.voucher-list-filter-field .pl-dimension-picker,
.voucher-list-filter-field .pl-party-picker,
.voucher-list-filter-field .pl-multi-filter-picker {
    width: 100%;
}

.voucher-list-table td .text-truncate {
    max-width: 260px;
}

@media (max-width: 1200px) {
    .voucher-list-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .voucher-list-filter-grid,
    .voucher-list-filter-row-secondary {
        grid-template-columns: 1fr;
    }

    .voucher-list-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.voucher-lines-table-wrap {
    overflow: visible !important;
}

.voucher-dimension-picker {
    position: relative;
    isolation: isolate;
}

.voucher-dimension-picker-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    background-color: #fff;
    padding-right: 2rem;
    position: relative;
    z-index: 2;
}

.voucher-dimension-picker-toggle::after {
    display: none;
}

.voucher-dimension-picker-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voucher-dimension-picker-menu {
    position: absolute;
    left: 0;
    min-width: 240px;
    width: max-content;
    max-width: 320px;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.voucher-dimension-picker-menu--portal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
}

.voucher-dimension-picker-menu.d-none,
.voucher-party-picker-menu.d-none,
.voucher-account-picker-menu.d-none {
    pointer-events: none !important;
    visibility: hidden !important;
}

.voucher-dimension-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.voucher-dimension-picker-search i {
    color: #9ca3af;
    font-size: 13px;
}

.voucher-dimension-picker-search input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.voucher-dimension-picker-tree {
    max-height: 240px;
    overflow: auto;
    padding: 6px 0;
}

.voucher-dimension-picker-item {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 30px;
    padding: 2px 8px 2px 0;
}

.voucher-dimension-picker-toggle-btn {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
}

.voucher-dimension-picker-toggle-btn:hover {
    background: #f3f4f6;
}

.voucher-dimension-picker-toggle-btn.is-hidden {
    visibility: hidden;
}

.voucher-dimension-picker-option {
    flex: 1;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12.5px;
    color: #111827;
    min-width: 0;
}

.voucher-dimension-picker-option:hover,
.voucher-dimension-picker-option.is-selected {
    background: #eff6ff;
    color: #1d4ed8;
}

.voucher-dimension-picker-option-code {
    display: block;
    font-size: 11px;
    color: #9ca3af;
}

.voucher-dimension-picker-empty {
    padding: 18px 12px;
    text-align: center;
    font-size: 12.5px;
    color: #9ca3af;
}

.voucher-dimension-picker-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ── Voucher line party / name pickers ─────────────────────────────────── */
.voucher-party-picker {
    position: relative;
    isolation: isolate;
}

.voucher-party-picker-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    background-color: #fff;
    padding-right: 2rem;
    position: relative;
    z-index: 2;
}

.voucher-party-picker-toggle::after {
    display: none;
}

.voucher-party-picker-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voucher-party-picker-menu {
    position: absolute;
    left: 0;
    min-width: 320px;
    width: max-content;
    max-width: 560px;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.voucher-party-picker-menu--portal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
}

.voucher-party-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.voucher-party-picker-search i {
    color: #9ca3af;
    font-size: 13px;
}

.voucher-party-picker-search input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.voucher-party-picker-columns {
    display: grid;
    grid-template-columns: 22px 72px minmax(0, 1fr) 78px;
    gap: 6px;
    align-items: center;
    padding: 8px 10px 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.voucher-party-picker-tree {
    max-height: 240px;
    overflow: auto;
    padding: 4px 0;
}

.voucher-party-picker-item {
    display: grid;
    grid-template-columns: 22px 72px minmax(0, 1fr) 78px;
    gap: 6px;
    align-items: center;
    width: 100%;
    min-height: 30px;
    padding: 3px 10px 3px 8px;
    border: 0;
    background: transparent;
    text-align: left;
    color: inherit;
}

.voucher-party-picker-item-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.voucher-party-picker-row {
    cursor: pointer;
    font-size: 12px;
}

.voucher-party-picker-row:hover,
.voucher-party-picker-row.is-selected {
    background: #eff6ff;
}

.voucher-party-picker-row.is-selected .voucher-party-picker-name,
.voucher-party-picker-row.is-selected .voucher-party-picker-type {
    color: #1d4ed8;
}

.voucher-party-picker-toggle-btn {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    padding: 0;
}

.voucher-party-picker-toggle-btn:hover {
    background: #f3f4f6;
}

.voucher-party-picker-toggle-btn.is-hidden {
    visibility: hidden;
}

.voucher-party-picker-group {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
}

.voucher-party-picker-code,
.voucher-party-picker-name,
.voucher-party-picker-type {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.voucher-party-picker-code,
.voucher-party-picker-type {
    color: #6b7280;
}

.voucher-party-picker-empty {
    padding: 18px 12px;
    text-align: center;
    font-size: 12.5px;
    color: #9ca3af;
}

.voucher-party-picker-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.voucher-party-header-field .voucher-party-picker {
    width: 100%;
}

.voucher-party-picker--header .voucher-party-picker-toggle {
    min-height: calc(1.5em + 0.75rem + 2px);
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    width: 100%;
}

.voucher-party-picker--header .voucher-party-picker-menu {
    min-width: 560px;
    max-width: min(560px, calc(100vw - 24px));
}

/* ── Voucher line account pickers ──────────────────────────────────────── */
.voucher-account-picker {
    position: relative;
    isolation: isolate;
}

.voucher-account-picker-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    background-color: #fff;
    padding-right: 2rem;
    position: relative;
    z-index: 2;
}

.voucher-account-picker-toggle::after {
    display: none;
}

.voucher-account-picker-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voucher-account-picker-menu {
    position: absolute;
    left: 0;
    min-width: 560px;
    width: max-content;
    max-width: min(92vw, 720px);
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.voucher-account-picker-menu--portal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
}

.voucher-account-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.voucher-account-picker-search i {
    color: #9ca3af;
    font-size: 13px;
}

.voucher-account-picker-search input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.voucher-account-picker-columns {
    display: grid;
    grid-template-columns: 22px 88px minmax(160px, 1fr) max-content;
    gap: 8px;
    align-items: center;
    padding: 8px 12px 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.voucher-account-picker-tree {
    max-height: 240px;
    overflow: auto;
    padding: 4px 0;
}

.voucher-account-picker-item {
    display: grid;
    grid-template-columns: 22px 88px minmax(160px, 1fr) max-content;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 30px;
    padding: 3px 12px 3px 8px;
    border: 0;
    background: transparent;
    text-align: left;
    color: inherit;
}

.voucher-account-picker-item-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f9fafb;
}

.voucher-account-picker-row {
    cursor: pointer;
    font-size: 12px;
}

.voucher-account-picker-row:hover,
.voucher-account-picker-row.is-selected {
    background: #eff6ff;
}

.voucher-account-picker-row.is-selected .voucher-account-picker-name,
.voucher-account-picker-row.is-selected .voucher-account-picker-type {
    color: #1d4ed8;
}

.voucher-account-picker-toggle-btn {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    padding: 0;
}

.voucher-account-picker-toggle-btn:hover {
    background: #f3f4f6;
}

.voucher-account-picker-toggle-btn.is-hidden {
    visibility: hidden;
}

.voucher-account-picker-group {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
}

.voucher-account-picker-code,
.voucher-account-picker-name,
.voucher-account-picker-type {
    font-size: 12px;
}

.voucher-account-picker-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voucher-account-picker-code,
.voucher-account-picker-type {
    color: #6b7280;
    white-space: nowrap;
}

.voucher-account-picker-empty {
    padding: 18px 12px;
    text-align: center;
    font-size: 12.5px;
    color: #9ca3af;
}

.voucher-account-picker-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ── COA parent account picker ─────────────────────────────────────────── */
.coa-parent-picker {
    position: relative;
}

.coa-parent-picker-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.coa-parent-picker-toggle:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.coa-parent-picker-toggle.is-invalid {
    border-color: #ef4444;
}

.coa-parent-picker-toggle:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.coa-parent-picker-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coa-parent-picker-caret {
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}

.coa-parent-picker-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1200;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.coa-parent-picker-menu--portal {
    position: fixed;
    left: auto;
    right: auto;
    top: auto;
}

.coa-parent-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.coa-parent-picker-search i {
    color: #9ca3af;
    font-size: 13px;
}

.coa-parent-picker-search input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    font-size: 13px;
}

.coa-parent-picker-columns {
    display: grid;
    grid-template-columns: 22px minmax(72px, 0.9fr) minmax(120px, 1.6fr) minmax(96px, 1fr);
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.coa-parent-picker-tree {
    max-height: 220px;
    overflow: auto;
    padding: 4px 0;
}

.coa-parent-picker--compact .coa-parent-picker-tree {
    max-height: 180px;
}

.coa-parent-picker-row {
    display: grid;
    grid-template-columns: 22px minmax(72px, 0.9fr) minmax(120px, 1.6fr) minmax(96px, 1fr);
    gap: 6px;
    align-items: center;
    width: 100%;
    min-height: 32px;
    padding: 2px 8px;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 12.5px;
    color: #111827;
    cursor: pointer;
}

.coa-parent-picker-row:hover:not(:disabled) {
    background: #eff6ff;
}

.coa-parent-picker-row.is-selected {
    background: #dbeafe;
    color: #1d4ed8;
}

.coa-parent-picker-row:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.coa-parent-picker-row.is-section {
    background: #f9fafb;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    cursor: default;
    min-height: 28px;
}

.coa-parent-picker-row.is-section:hover {
    background: #f9fafb;
}

.coa-parent-picker-toggle-btn {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    padding: 0;
}

.coa-parent-picker-toggle-btn.is-hidden {
    visibility: hidden;
}

.coa-parent-picker-toggle-btn:hover {
    background: #f3f4f6;
}

.coa-parent-picker-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coa-parent-picker-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coa-parent-picker-type {
    font-size: 11.5px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coa-parent-picker-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 12.5px;
    color: #9ca3af;
}

.coa-parent-picker-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.coa-parent-inline-add {
    display: none;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.coa-parent-inline-add.is-open {
    display: block;
}

.sc-coa-quick-modal .modal-dialog {
    max-width: 760px;
}

.sc-coa-quick-modal .modal-content,
.sc-coa-quick-modal .modal-body {
    overflow: visible;
}

.sc-coa-quick-modal .modal-body {
    padding: 0.85rem 1.15rem 0.35rem;
}

.sc-coa-quick-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(110px, 0.7fr) minmax(0, 1fr);
    gap: 10px 12px;
    align-items: end;
}

.sc-coa-quick-fields .form-label {
    margin-bottom: 4px;
    font-size: 12.5px;
}

.sc-coa-quick-fields .form-control,
.sc-coa-quick-fields .form-select {
    min-height: 38px;
    font-size: 13px;
}

.sc-coa-quick-parent-wrap {
    margin-top: 10px;
}

.sc-coa-quick-parent-wrap .form-label {
    margin-bottom: 4px;
    font-size: 12.5px;
}

/* ── COA create / edit centered modal (Chart of Accounts index) ──────── */
.coa-create-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    z-index: 1080;
    backdrop-filter: blur(2px);
}

.coa-create-overlay.open {
    display: block;
}

.coa-create-window {
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    width: min(480px, calc(100vw - 32px));
    max-width: 480px;
    height: auto;
    max-height: min(680px, calc(100dvh - 40px));
    margin: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
    z-index: 1090;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translate(-50%, calc(-50% + 10px)) scale(0.97);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, visibility 0.24s;
}

.coa-create-window.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#slidePanel .sp-header {
    padding: 12px 16px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 14px 14px 0 0;
    flex-shrink: 0;
}

#slidePanel .sp-body {
    padding: 10px 14px;
    overflow: hidden;
    flex: 0 1 auto;
    min-height: 0;
}

#slidePanel .sp-footer {
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 14px 14px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
}

#slidePanel .coa-create-compact > form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#slidePanel .coa-create-compact .form-label {
    margin-bottom: 3px;
    font-size: 12px;
    line-height: 1.2;
}

#slidePanel .coa-create-compact .form-control,
#slidePanel .coa-create-compact .form-select,
#slidePanel .coa-create-compact .coa-parent-picker-toggle {
    min-height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 12.5px;
}

#slidePanel .coa-create-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(96px, 0.75fr);
    gap: 8px 10px;
}

#slidePanel .coa-create-sub-block {
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

#slidePanel .coa-create-sub-label {
    margin-bottom: 4px;
    font-size: 12px;
}

#slidePanel .coa-parent-picker--compact .coa-parent-picker-tree {
    max-height: 150px;
}

#slidePanel .coa-create-flags {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

#slidePanel .coa-create-flags .form-check {
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 12px;
}

#slidePanel .sp-footer .btn {
    min-height: 34px;
}

@media (max-width: 575.98px) {
    .coa-create-window {
        width: calc(100vw - 24px);
        max-width: none;
        max-height: calc(100dvh - 24px);
    }
}

/* ── Voucher document attachments ──────────────────────────────────────── */
.voucher-attachment-table td {
    vertical-align: middle;
}

.pl-report-heading {
    text-align: center;
    padding: 18px 20px 12px;
    background: #fff;
}

.pl-report-filters {
    padding: 0 20px 18px;
    border-bottom: 1px solid #f9fbfd;
    background: #fff;
}

.pl-report-filter-row {
    display: grid;
    gap: 14px 16px;
}

.pl-report-filter-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pl-report-filter-row-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 14px;
}

.pl-report-filter-field .form-label {
    margin-bottom: 4px;
    font-size: 12.5px;
}

.pl-report-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f9fbfd;
}

@media (max-width: 991.98px) {
    .pl-report-filter-row-4,
    .pl-report-filter-row-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .pl-report-filter-row-4,
    .pl-report-filter-row-5 {
        grid-template-columns: 1fr;
    }

    .pl-report-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.pl-report-company {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.pl-report-title {
    font-size: 20px;
    font-weight: 700;
    margin: 4px 0 0;
    color: #111827;
}

.pl-report-period {
    font-size: 13px;
    color: #374151;
    margin-top: 2px;
}

.pl-report-body {
    background: #fff;
}

.pl-report-table > :not(caption) > * > * {
    background-color: #fff;
    border-bottom-color: #f9fbfd;
}

.pl-report-column-header {
    background: #f9fbfd;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.pl-report-section-header > th,
.pl-report-section-header > td {
    background-color: #f9fbfd !important;
    color: #212529;
    border-bottom-color: #f9fbfd !important;
}

.pl-report-total-row > th,
.pl-report-total-row > td {
    background-color: #fff !important;
    color: #212529;
}

.pl-report-account-label {
    color: #000;
    font-weight: 400;
}

.pl-report-tree-spacer,
.pl-tree-spacer {
    display: inline-block;
    width: 20px;
    flex-shrink: 0;
}

.pl-tree-toggle {
    width: 20px;
    color: #374151 !important;
}

.pl-tree-toggle:hover {
    color: #111827 !important;
}

.pl-report-account-link {
    color: #000;
    text-decoration: none;
    font-weight: 400;
}

.pl-report-account-link:hover {
    color: #000;
    text-decoration: underline;
}

.pl-report-wrap .table {
    min-width: 0;
    --bs-table-hover-bg: #fff;
    --bs-table-striped-bg: #fff;
    --bs-table-active-bg: #fff;
}

.gl-report-wrap {
    min-height: calc(100vh - 120px);
}

.gl-report-top {
    background: #fff;
    padding-top: 8px;
}

.gl-report-heading-centered {
    text-align: center;
    padding: 20px 20px 12px;
    background: #fff;
}

.gl-report-heading-centered .pl-report-company {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.gl-report-heading-centered .pl-report-title {
    margin: 6px 0 4px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.gl-report-heading-centered .pl-report-period {
    font-size: 14px;
    color: #4b5563;
}

.gl-report-toolbar-row {
    display: flex;
    justify-content: flex-end;
    padding: 0 20px 16px;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}

.gl-report-actions-right {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 22px;
}

.gl-account-picker-all-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 0;
    border-bottom: 1px solid #eef2f7;
    background: #f9fbfd;
    cursor: pointer;
}

.gl-account-picker-choice {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.gl-account-picker-choice input {
    margin: 0;
}

.gl-account-picker-columns,
.gl-account-picker .voucher-account-picker-row {
    grid-template-columns: 22px 28px 88px minmax(140px, 1fr) minmax(90px, max-content);
}

.gl-account-picker-tree {
    max-height: min(420px, 52vh);
    overflow: auto;
}

.gl-account-picker .voucher-account-picker-menu {
    overflow: visible;
}

.gl-account-picker .voucher-account-picker-menu--portal {
    overflow: hidden;
    max-height: min(520px, 72vh);
    display: flex;
    flex-direction: column;
}

.gl-account-picker .voucher-account-picker-menu--portal .gl-account-picker-tree {
    flex: 1 1 auto;
    max-height: none;
    min-height: 180px;
}

.gl-report-empty {
    text-align: center;
    padding: 48px 20px;
    background: #fff;
}

.gl-report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 40px;
    padding: 12px 20px 16px;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
}

.gl-report-table > :not(caption) > * > * {
    font-size: 12.5px;
    vertical-align: top;
}

.gl-report-table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4b5563;
    background: #f9fbfd;
    border-bottom: 1px solid #e5e7eb;
}

.gl-report-opening-row > * {
    background: #f3f4f6;
}

.gl-report-total-row > * {
    background: #f9fbfd;
    font-weight: 600;
}

.gl-split-accounts {
    font-size: 12px;
    line-height: 1.35;
    color: #374151;
}

.gl-account-header-row > td {
    background: #eef2ff;
    border-top: 2px solid #c7d2fe;
    padding-top: 14px;
    padding-bottom: 8px;
}

.gl-account-header-link {
    color: #1e3a8a;
    font-size: 14px;
}

.gl-account-total-row > * {
    background: #f8fafc;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

.gl-account-spacer-row > td {
    border: 0;
    padding: 6px 0;
    background: #fff;
}

@media print {
    #sidebar,
    #sidebar-backdrop,
    #topbar,
    #open-windows,
    #topnav,
    .pl-report-toolbar,
    .pl-report-filters,
    .gl-report-toolbar-row,
    .pl-report-wrap .no-print {
        display: none !important;
    }

    #main {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    body.page-profit-loss,
    body.page-profit-loss #main,
    body.page-general-ledger,
    body.page-general-ledger #main,
    .page-content {
        background: #fff !important;
    }

    .pl-report-wrap {
        width: 100%;
        max-width: 100%;
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .pl-tree-toggle,
    .pl-tree-spacer {
        display: none !important;
    }

    .pl-tree-row {
        display: table-row !important;
    }

    .pl-report-account-link {
        color: #000 !important;
        text-decoration: none !important;
    }

    .pl-report-section-header > td {
        background-color: #f9fbfd !important;
    }

    .gl-report-table th,
    .gl-report-table td {
        font-size: 10px;
        padding: 4px 6px !important;
    }
}

/* ── Report period calendar (Flatpickr) ─────────────────────────────── */
.axis-date-field .axis-date-trigger {
    cursor: pointer;
    background: #fff;
    color: #6b7280;
}

.axis-date-field .axis-date-trigger:hover {
    background: #f8fafc;
    color: #111827;
}

.flatpickr-calendar.axis-report-calendar {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    padding: 8px 8px 10px;
    width: 290px;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-months {
    padding: 2px 4px 8px;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-months .flatpickr-prev-month,
.flatpickr-calendar.axis-report-calendar .flatpickr-months .flatpickr-next-month {
    top: 8px;
    color: #374151;
    fill: #374151;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-current-month {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    padding-top: 2px;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-monthDropdown-months,
.flatpickr-calendar.axis-report-calendar .numInput.cur-year {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-weekdays {
    margin-top: 2px;
}

.flatpickr-calendar.axis-report-calendar span.flatpickr-weekday {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-days {
    width: 100%;
}

.flatpickr-calendar.axis-report-calendar .dayContainer {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-day {
    border: 0;
    border-radius: 999px;
    color: #111827;
    font-size: 13px;
    height: 34px;
    line-height: 34px;
    max-width: 34px;
    margin: 2px auto;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-day.prevMonthDay,
.flatpickr-calendar.axis-report-calendar .flatpickr-day.nextMonthDay {
    color: #9ca3af;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-day.today {
    border: 0;
    color: #111827;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-day.selected,
.flatpickr-calendar.axis-report-calendar .flatpickr-day.selected:hover,
.flatpickr-calendar.axis-report-calendar .flatpickr-day.startRange,
.flatpickr-calendar.axis-report-calendar .flatpickr-day.endRange {
    background: #374151;
    border-color: #374151;
    color: #fff;
}

.flatpickr-calendar.axis-report-calendar .flatpickr-day:hover {
    background: #f3f4f6;
}

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