/* 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: #f1f5f9;
    --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;
    --open-windows-h: 38px;
    --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-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: none;
}

.topnav-scroll::-webkit-scrollbar { display: none; }

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

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

.topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 12px;
    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: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: 11px;
    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 ──────────────────────────────────────────────── */
#open-windows {
    position: fixed;
    top: calc(var(--topbar-h) + var(--topnav-h));
    left: var(--sidebar-w);
    right: 0;
    height: var(--open-windows-h);
    background: #e2e8f0;
    border-bottom: 1px solid var(--axis-border);
    z-index: 1032;
    transition: left var(--transition);
}

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

.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 #cbd5e1;
    background: #d8e0ea;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 200px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.open-window-tab:hover {
    background: #cdd7e3;
    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;
}

body.has-open-windows #main {
    padding-top: calc(var(--topbar-h) + var(--topnav-h) + var(--open-windows-h));
}

#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,
    #open-windows, #open-windows.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;
    }
}

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