/* ============================================================
   AutoBooks Pro — Light Theme
   ============================================================ */

:root {
    --bg-primary: #f6f8fb;
    --bg-secondary: #eef4fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f7fafc;
    --bg-input: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.92);
    --border: #dbe3ec;
    --border-light: #c7d3e0;
    --text-primary: #17212b;
    --text-secondary: #445468;
    --text-muted: #728196;
    --accent-blue: #2563eb;
    --accent-blue-glow: rgba(37, 99, 235, 0.10);
    --accent-green: #15803d;
    --accent-green-glow: rgba(21, 128, 61, 0.10);
    --accent-red: #dc2626;
    --accent-red-glow: rgba(220, 38, 38, 0.10);
    --accent-yellow: #b45309;
    --accent-yellow-glow: rgba(180, 83, 9, 0.10);
    --accent-purple: #7c3aed;
    --accent-purple-glow: rgba(124, 58, 237, 0.10);
    --accent-cyan: #06b6d4;
    --gradient-blue: linear-gradient(135deg, #2563eb, #1d4ed8);
    --gradient-green: linear-gradient(135deg, #16a34a, #15803d);
    --gradient-red: linear-gradient(135deg, #ef4444, #dc2626);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #7c3aed);
    --gradient-cyan: linear-gradient(135deg, #06b6d4, #0891b2);
    --gradient-card: linear-gradient(135deg, rgba(37,99,235,0.03), rgba(124,58,237,0.02));
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 26px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 18px 42px rgba(15, 23, 42, 0.10);
    --shadow-glow-blue: 0 0 0 rgba(0,0,0,0);
    --shadow-glow-green: 0 0 0 rgba(0,0,0,0);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 88px;
    --header-height: 64px;
    --table-shell-height: min(62vh, 720px);
    --table-shell-inline-height: min(46vh, 430px);
    --table-min-width: 960px;
    --transition: all 0.18s ease;
}

.date-time-stack {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
    text-align: inherit;
    white-space: nowrap;
}

.date-time-primary {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.date-time-secondary {
    font-size: 11px;
    color: var(--text-muted);
}

td.text-right .date-time-stack,
th.text-right .date-time-stack {
    align-items: flex-end;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 8% -8%, rgba(37, 99, 235, 0.10), transparent 28%),
        radial-gradient(circle at 94% 4%, rgba(21, 128, 61, 0.08), transparent 24%),
        var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

body.sidebar-open {
    overflow: hidden;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a { color: var(--accent-blue); text-decoration: none; transition: var(--transition); }
a:hover { color: #1d4ed8; }

/* ============ LAYOUT ============ */
.app-container {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: clip;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fa 100%);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 12px;
}

.sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    background: #ffffff;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    padding: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.sidebar-brand .brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sidebar-brand .brand-text {
    font-size: 18px; font-weight: 700;
    color: var(--text-primary);
}

.sidebar-brand .brand-version {
    font-size: 10px; color: var(--text-muted);
    background: var(--bg-card); padding: 2px 6px;
    border-radius: 4px; margin-left: auto;
}

body.sidebar-collapsed .sidebar-brand .brand-text,
body.sidebar-collapsed .sidebar-brand .brand-version,
body.sidebar-collapsed .sidebar-user .user-info,
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .sidebar-logout-btn {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: auto;
}

body.sidebar-collapsed .sidebar-nav {
    padding-inline: 10px;
}

.nav-section { margin-bottom: 24px; }
.nav-section-title {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-muted); padding: 0 12px;
    margin-bottom: 8px;
}

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    color: var(--text-secondary); font-size: 13.5px; font-weight: 500;
    transition: var(--transition); text-decoration: none;
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.nav-link.active {
    background: #ffffff;
    color: var(--accent-blue);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.10);
}

.nav-link.active::before {
    content: '';
    position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--accent-blue);
    border-radius: 0 3px 3px 0;
}

.nav-link .nav-icon {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; opacity: 0.8;
}

.nav-link .nav-badge {
    margin-left: auto;
    background: var(--accent-red);
    color: white; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 10px;
    min-width: 18px; text-align: center;
}

body.sidebar-collapsed .nav-link {
    justify-content: center;
    font-size: 0;
    padding-inline: 10px;
}

body.sidebar-collapsed .nav-link .nav-icon {
    font-size: 18px;
    margin: 0;
}

body.sidebar-collapsed .nav-link .nav-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
}

body.sidebar-collapsed .sidebar-user {
    justify-content: center;
}

.sidebar-footer {
    padding: 16px; border-top: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(238, 244, 250, 0), #eef4fa 36%);
}

.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; border-radius: var(--radius-sm);
    background: var(--bg-card);
}

.sidebar-user .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gradient-purple);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: white;
}

.sidebar-user .user-info { flex: 1; }
.sidebar-user .user-name { font-size: 13px; font-weight: 600; }
.sidebar-user .user-role { font-size: 11px; color: var(--text-muted); }

.sidebar-logout-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.sidebar-logout-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-red);
    border-color: rgba(220, 38, 38, 0.18);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    min-width: 0;
    min-height: 100dvh;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
    max-width: calc(100% - var(--sidebar-collapsed-width));
}

/* Header */
.top-header {
    min-height: var(--header-height);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 10px 32px;
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(16px);
}

.header-left { display: flex; align-items: center; gap: 16px; }

.page-title {
    font-size: 20px; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
    min-width: 0;
}

.page-title .title-icon {
    font-size: 22px; opacity: 0.8;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.header-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
    font-size: 14px; display: flex; align-items: center; gap: 6px;
}
.header-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.notification-btn { position: relative; }
.notification-btn .badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--accent-red); color: white;
    font-size: 9px; font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
}

/* Page Content */
.page-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 24px;
    overflow-x: clip;
}

.page-header {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.page-header h1 {
    display: none !important;
}

.page-header p {
    flex-basis: 100%;
    margin-top: 0 !important;
    color: var(--text-muted);
    text-align: left;
}

.page-header > div,
.page-header > form,
.page-header form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header > div {
    flex: 1;
}

.page-header > div:has(.btn),
.page-header > div[style*="display:flex"],
.page-header > div[style*="display: flex"] {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 12px !important;
}

/* Breadcrumbs */
.breadcrumb-trail {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: none !important;
    gap: 6px;
    font-size: 13.5px;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: auto !important;
}
.breadcrumb-trail a {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}
.breadcrumb-trail a:hover {
    color: var(--accent-blue);
}
.breadcrumb-separator {
    color: var(--border-dark);
    font-size: 11px;
}
.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.breadcrumb-current i {
    color: var(--accent-blue);
    font-size: 14px;
}

.page-header .form-control,
.filter-bar .form-control {
    min-height: 42px;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

.card-header h3 {
    font-size: 16px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}

.card-body { padding: 24px; }
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* Account Cards (Dashboard — 3 Gateway) */
.account-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 32px; }

.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    position: relative; overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.account-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
}

.account-card.cash::before { background: var(--gradient-green); }
.account-card.bank::before { background: var(--gradient-blue); }
.account-card.gst::before { background: var(--gradient-purple); }

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.account-card .card-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin-bottom: 16px;
}

.account-card.cash .card-icon { background: var(--accent-green-glow); color: var(--accent-green); }
.account-card.bank .card-icon { background: var(--accent-blue-glow); color: var(--accent-blue); }
.account-card.gst .card-icon { background: var(--accent-purple-glow); color: var(--accent-purple); }

.account-card .card-label {
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); margin-bottom: 8px;
}

.account-card .card-balance {
    font-size: 28px; font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.account-card .card-action {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    border: none; cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.account-card.cash .card-action { background: var(--accent-green-glow); color: var(--accent-green); }
.account-card.bank .card-action { background: var(--accent-blue-glow); color: var(--accent-blue); }
.account-card.gst .card-action { background: var(--accent-purple-glow); color: var(--accent-purple); }

.account-card .card-action:hover { filter: brightness(1.2); }

/* Account Tabs (Dashboard — 3 Tab Switcher) */
.account-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    margin-bottom: 24px;
}

.account-tab {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    text-decoration: none; color: var(--text-primary);
    transition: var(--transition);
    position: relative; overflow: hidden;
    cursor: pointer;
}

.account-tab::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px; opacity: 0.3;
}

.account-tab.cash::before { background: var(--gradient-green); }
.account-tab.bank::before { background: var(--gradient-blue); }
.account-tab.gst::before { background: var(--gradient-purple); }

.account-tab:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.account-tab.active {
    border-width: 2px;
}

.account-tab.active.cash {
    border-color: var(--accent-green);
    box-shadow: var(--shadow-sm);
}
.account-tab.active.cash::before { opacity: 1; }

.account-tab.active.bank {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
}
.account-tab.active.bank::before { opacity: 1; }

.account-tab.active.gst {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-sm);
}
.account-tab.active.gst::before { opacity: 1; }

.account-tab .tab-icon {
    font-size: 28px;
}

.account-tab .tab-content { flex: 1; }

.account-tab .tab-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); margin-bottom: 4px;
}

.account-tab .tab-balance {
    font-size: 24px; font-weight: 800;
    color: var(--text-primary);
}

.account-tab.active .tab-balance {
    color: inherit;
}

.account-tab.active.cash .tab-balance { color: var(--accent-green); }
.account-tab.active.bank .tab-balance { color: var(--accent-blue); }
.account-tab.active.gst .tab-balance { color: var(--accent-purple); }


/* ============ STATS GRID ============ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }

.stat-card .stat-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card .stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}

.stat-card .stat-trend {
    font-size: 12px; font-weight: 600;
    padding: 3px 8px; border-radius: 4px;
}

.stat-trend.up { background: var(--accent-green-glow); color: var(--accent-green); }
.stat-trend.down { background: var(--accent-red-glow); color: var(--accent-red); }

.stat-card .stat-value { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); }

/* ============ TABLES ============ */
.table-container {
    position: relative;
    display: block;
    overflow-x: auto;
    overflow-y: auto;
    max-height: var(--table-shell-height);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.table-container-fill {
    max-height: none;
    min-height: 320px;
}

.table-container table {
    width: max(100%, var(--table-min-width));
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.table-container-inline {
    max-height: var(--table-shell-inline-height);
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.table-container-inline table {
    width: max(100%, 760px);
}

.table-container-fit {
    max-height: none;
    overflow-x: clip;
}

.table-container-fit table {
    width: 100%;
    min-width: 0;
}

.table-compact th,
.table-compact td {
    padding: 10px 12px;
    font-size: 12.5px;
}

.table-total-room tfoot td,
.table-total-room .table-summary-row td {
    padding-top: 18px;
    padding-bottom: 18px;
}

.table-total-room tfoot .amount,
.table-total-room .table-summary-row .amount {
    padding-inline: 18px;
    letter-spacing: 0.01em;
}

.car-profitability-table table {
    table-layout: fixed;
}

.car-profitability-table th:nth-child(1) { width: 11%; }
.car-profitability-table th:nth-child(2) { width: 12%; }
.car-profitability-table th:nth-child(3) { width: 9%; }
.car-profitability-table th:nth-child(4) { width: 6%; }
.car-profitability-table th:nth-child(5),
.car-profitability-table th:nth-child(6),
.car-profitability-table th:nth-child(7),
.car-profitability-table th:nth-child(8),
.car-profitability-table th:nth-child(9) { width: 10%; }
.car-profitability-table th:nth-child(10) { width: 12%; }

.car-profitability-table td:nth-child(10) {
    white-space: normal;
    overflow-wrap: anywhere;
}

.attachment-upload-panel {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(240px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.attachment-upload-copy .form-label {
    margin-bottom: 4px;
}

.voucher-dropzone {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px dashed rgba(37, 99, 235, 0.35);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.voucher-dropzone:hover,
.voucher-dropzone:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.voucher-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.voucher-dropzone-icon {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    background: var(--accent-blue-glow);
    color: var(--accent-blue);
    font-size: 20px;
    flex: 0 0 auto;
}

.voucher-dropzone strong,
.voucher-dropzone small {
    display: block;
    line-height: 1.25;
}

.voucher-dropzone strong {
    font-size: 13px;
}

.voucher-dropzone small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.attachment-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.car-detail-stats-grid {
    margin-bottom: 12px;
}

.car-detail-stats-grid .stat-card {
    padding: 18px 20px;
}

.car-detail-pending-grid {
    margin: 0 0 20px;
}

.car-detail-main-grid {
    margin-top: 0;
    align-items: start;
}

.car-images-card .card-body {
    padding: 16px 20px 20px;
}

.car-images-upload-panel {
    grid-template-columns: minmax(190px, 240px) minmax(280px, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
}

.car-images-upload-panel .form-group {
    margin-bottom: 0;
}

.car-images-upload-panel .btn {
    min-width: 132px;
}

.car-images-columns {
    margin-top: 14px;
    gap: 14px;
}

.car-images-columns .empty-state.compact {
    min-height: 64px;
}

.attachment-group-title {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text-primary);
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.attachment-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-primary);
    overflow: hidden;
}

.attachment-card img,
.attachment-preview {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.attachment-file-icon {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    gap: 6px;
    color: var(--accent-red);
    background: var(--accent-red-glow);
    font-weight: 700;
}

.attachment-file-icon i {
    font-size: 34px;
}

.attachment-meta {
    display: grid;
    gap: 3px;
    padding: 10px;
    font-size: 12px;
}

.attachment-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-meta span {
    color: var(--text-muted);
}

.attachment-actions {
    display: flex;
    gap: 8px;
    padding: 0 10px 10px;
    flex-wrap: wrap;
}

.empty-state.compact {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    background: var(--bg-secondary);
}

table {
    width: 100%; border-collapse: collapse;
    table-layout: auto;
}

.table-container thead th,
thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted);
    background: linear-gradient(180deg, #f8fafc, #eef4fa);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.table-container tbody td,
tbody td {
    padding: 14px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.table-container td,
.table-container th {
    min-width: 0;
}

.table-container th,
.table-container td {
    box-sizing: border-box;
}

.table-container th.text-right,
.table-container td.text-right,
.table-container th.text-center,
.table-container td.text-center,
.table-container th:last-child,
.table-container td:last-child {
    white-space: nowrap;
}

.table-container .amount,
.table-container .badge,
.table-container .btn {
    white-space: nowrap;
}

.table-container td:first-child,
.table-container th:first-child {
    padding-left: 18px;
}

.table-container td:last-child,
.table-container th:last-child {
    padding-right: 18px;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--bg-card-hover); }
tbody tr:last-child td { border-bottom: none; }

/* Table Form Control Styling */
.table-container td .form-control,
table td .form-control {
    padding: 6px 10px;
    font-size: 13.5px;
    height: 34px;
    min-height: unset;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    width: 100%;
    transition: var(--transition);
}
.table-container td .form-control:hover,
table td .form-control:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
}
.table-container td .form-control:focus,
table td .form-control:focus {
    background: var(--bg-input);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}
.table-container td select.form-control,
table td select.form-control {
    background-position: right 8px center;
    padding-right: 28px;
}
.table-container td.text-center .form-control,
table td.text-center .form-control {
    text-align: center !important;
    text-align-last: center !important;
}
.table-container td.text-center select.form-control,
table td.text-center select.form-control {
    padding-left: 28px !important;
    padding-right: 28px !important;
    text-align: center !important;
    text-align-last: center !important;
}

.table-container tfoot td,
.table-summary-row td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: linear-gradient(180deg, #f8fbff, #eef4fa);
    border-top: 1px solid var(--border);
    font-weight: 700;
}

.table-container tfoot .amount,
.table-summary-row .amount {
    font-weight: 800;
}

.table-group-row td {
    background: var(--bg-secondary);
    font-weight: 700;
    color: var(--accent-blue);
}

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-green { color: var(--accent-green) !important; }
.text-red { color: var(--accent-red) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-yellow { color: var(--accent-yellow) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-bold { font-weight: 700; }

.amount { font-family: 'Inter', monospace; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.positive { color: var(--accent-green); }
.amount.negative { color: var(--accent-red); }
.amount.flow-in,
.flow-in { color: var(--accent-green) !important; }
.amount.flow-out,
.flow-out { color: var(--accent-red) !important; }
.amount.flow-neutral,
.flow-neutral { color: var(--text-secondary) !important; }
.amount.debit-amount,
.debit-amount { color: var(--accent-green) !important; }
.amount.credit-amount,
.credit-amount { color: var(--accent-red) !important; }
.dr-cr-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.dr-cr-pill.debit-amount { background: var(--accent-green-glow); }
.dr-cr-pill.credit-amount { background: var(--accent-red-glow); }

/* ============ BADGES ============ */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.badge-green { background: var(--accent-green-glow); color: var(--accent-green); }
.badge-red { background: var(--accent-red-glow); color: var(--accent-red); }
.badge-blue { background: var(--accent-blue-glow); color: var(--accent-blue); }
.badge-yellow { background: var(--accent-yellow-glow); color: var(--accent-yellow); }
.badge-purple { background: var(--accent-purple-glow); color: var(--accent-purple); }
.badge-gray { background: rgba(100,116,139,0.2); color: #94a3b8; }

.jv-balance-pill {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    font-weight: 700;
    color: var(--text-primary);
}

.jv-balance-pill.is-balanced {
    border-color: rgba(21, 128, 61, 0.25);
    background: var(--accent-green-glow);
    color: var(--accent-green);
}

.jv-balance-pill.is-warning {
    border-color: rgba(180, 83, 9, 0.25);
    background: var(--accent-yellow-glow);
    color: var(--accent-yellow);
}

/* ============ FORMS ============ */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px; font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6a7a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control { min-height: 80px; resize: vertical; }

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--accent-red); margin-top: 4px; }

.input-group {
    display: flex; align-items: stretch;
}

.input-group .input-prefix {
    display: flex; align-items: center; justify-content: center;
    padding: 0 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-muted); font-size: 14px; font-weight: 600;
}

.input-group .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 20px;
    border: none; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    text-decoration: none; white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--gradient-blue); color: white; box-shadow: none; }
.btn-primary:hover,
.btn-primary:focus-visible {
    color: white;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
    filter: saturate(1.04);
}

.btn-success { background: var(--gradient-green); color: white; box-shadow: none; }
.btn-success:hover,
.btn-success:focus-visible,
.btn-danger:hover,
.btn-danger:focus-visible,
.btn-purple:hover,
.btn-purple:focus-visible {
    color: white;
}
.btn-danger { background: var(--gradient-red); color: white; }
.btn-purple { background: var(--gradient-purple); color: white; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-light); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; min-width: 36px; }
.btn-block { width: 100%; }

/* ============ ALERTS / FLASH MESSAGES ============ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 12px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.alert-success { background: var(--accent-green-glow); border: 1px solid rgba(16,185,129,0.3); color: var(--accent-green); }
.alert-error { background: var(--accent-red-glow); border: 1px solid rgba(239,68,68,0.3); color: var(--accent-red); }
.alert-warning { background: var(--accent-yellow-glow); border: 1px solid rgba(245,158,11,0.3); color: var(--accent-yellow); }
.alert-info { background: var(--accent-blue-glow); border: 1px solid rgba(59,130,246,0.3); color: var(--accent-blue); }

.alert-close {
    margin-left: auto; background: none; border: none;
    color: inherit; cursor: pointer; font-size: 18px; opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

/* ============ MODAL ============ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.18);
    z-index: 1000;
    align-items: center; justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%; max-width: 560px;
    max-height: 85vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

.modal-header h3 { font-size: 18px; font-weight: 700; }

.modal-close {
    background: none; border: none;
    color: var(--text-muted); font-size: 20px;
    cursor: pointer; padding: 4px;
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px; justify-content: flex-end;
}

.modal-wide { max-width: 960px; }
.modal-picker { max-width: 720px; }
.modal-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

/* ============ SEARCHABLE ENTRY UX ============ */
.entry-card {
    box-shadow: var(--shadow-md);
}

.entry-helper-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff, #eff6ff);
}

.entry-helper-strip strong {
    display: block;
    color: var(--text-primary);
    font-size: 15px;
}

.entry-helper-strip span {
    color: var(--text-secondary);
    font-size: 13px;
}

.entry-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.entry-header-actions span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.simple-entry-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.simple-entry-option {
    min-height: 64px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 5px 10px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.035);
    transition: var(--transition);
}

.simple-entry-option i {
    grid-row: span 2;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    background: var(--bg-secondary);
    font-size: 19px;
}

.simple-entry-option span {
    font-size: 13px;
    font-weight: 800;
}

.simple-entry-option strong {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
}

.simple-entry-option.money-in {
    border-color: rgba(21, 128, 61, 0.24);
    background: #ffffff;
}

.simple-entry-option.money-in i,
.simple-entry-option.money-in span {
    color: var(--accent-green);
}

.simple-entry-option.money-in i {
    background: var(--accent-green-glow);
}

.simple-entry-option.money-out {
    border-color: rgba(190, 18, 60, 0.24);
    background: #ffffff;
}

.simple-entry-option.money-out i,
.simple-entry-option.money-out span {
    color: var(--accent-red);
}

.simple-entry-option.money-out i {
    background: var(--accent-red-glow);
}

.simple-entry-option.split {
    border-color: rgba(37, 99, 235, 0.2);
    background: #ffffff;
}

.simple-entry-option.split i,
.simple-entry-option.split span {
    color: var(--accent-blue);
}

.simple-entry-option.split i {
    background: var(--accent-blue-glow);
}

.simple-entry-option:hover,
.simple-entry-option.active {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.simple-entry-option.money-in:hover,
.simple-entry-option.money-in.active {
    border-color: var(--accent-green);
}

.simple-entry-option.money-out:hover,
.simple-entry-option.money-out.active {
    border-color: var(--accent-red);
}

.simple-entry-option.split:hover,
.simple-entry-option.split.active {
    border-color: var(--accent-blue);
}

.entry-workstation {
    border: 1px solid rgba(199, 211, 224, 0.9);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    overflow: visible;
}

.entry-form {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.entry-core-panel {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(219, 227, 236, 0.92);
    border-radius: 10px;
    background: #f8fafc;
}

.entry-core-panel .form-row,
.entry-core-panel .form-row-3 {
    gap: 12px;
}

.native-transaction-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.txn-type-picker {
    position: relative;
}

.txn-type-trigger {
    width: 100%;
    min-height: 52px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.txn-type-trigger:hover,
.txn-type-trigger[aria-expanded="true"] {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.txn-type-trigger.is-invalid {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px var(--accent-red-glow);
}

.txn-type-trigger.money-in {
    border-color: rgba(21, 128, 61, 0.28);
}

.txn-type-trigger.money-out {
    border-color: rgba(190, 18, 60, 0.28);
}

.txn-type-trigger-icon,
.txn-type-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--accent-blue);
    font-size: 20px;
    flex: 0 0 auto;
}

.txn-type-trigger-copy {
    min-width: 0;
}

.txn-type-trigger-copy strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
}

.txn-type-trigger-copy small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.txn-type-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.txn-type-search {
    width: 100%;
    min-height: 42px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    color: var(--text-primary);
    outline: none;
}

.txn-type-search:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.txn-type-list {
    display: grid;
    gap: 6px;
    max-height: 360px;
    overflow: auto;
}

.txn-type-group {
    padding: 8px 6px 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.txn-type-item {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.txn-type-item strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
}

.txn-type-item small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.txn-type-item.money-in .txn-type-icon {
    background: var(--accent-green-glow);
    color: var(--accent-green);
}

.txn-type-item.money-out .txn-type-icon {
    background: var(--accent-red-glow);
    color: var(--accent-red);
}

.txn-type-item.both .txn-type-icon {
    background: var(--accent-blue-glow);
    color: var(--accent-blue);
}

.txn-type-item:hover,
.txn-type-item.active {
    border-color: var(--accent-blue);
    background: #f8fbff;
}

.txn-type-empty {
    padding: 18px 8px;
    color: var(--text-muted);
    text-align: center;
    font-size: 13px;
}

.entry-form .txn-section {
    padding: 14px;
    border: 1px solid rgba(219, 227, 236, 0.92);
    border-radius: 10px;
    background: #ffffff;
}

.entry-form .txn-section h4 {
    margin: 0 0 12px !important;
    padding-top: 0 !important;
    border-top: 0 !important;
    font-size: 14px;
}

.entry-form .txn-section .form-row,
.entry-form .txn-section .form-row-3 {
    gap: 12px;
}

.searchable-select-wrap {
    display: grid;
    gap: 6px;
}

.select-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.select-search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.split-entry-panel {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 18px;
    align-items: center;
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(21, 128, 61, 0.16);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff, #f0fdf4);
}

.split-entry-panel h4 {
    color: var(--accent-green);
    margin-bottom: 4px;
}

.split-entry-panel p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.split-entry-summary {
    min-width: 150px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.split-entry-summary span,
.split-balance-card span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.split-entry-summary strong,
.split-balance-card strong {
    display: block;
    margin-top: 2px;
    color: var(--text-primary);
    font-size: 18px;
}

.split-guide {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.split-guide div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: var(--text-secondary);
    font-size: 13px;
}

.split-balance-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 6px 0 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #f8fafc;
}

.split-balance-card.is-balanced {
    border-color: rgba(21, 128, 61, 0.28);
    background: var(--accent-green-glow);
}

.split-balance-card.is-warning #split-remaining-total {
    color: var(--accent-yellow);
}

.split-lines {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.split-line-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) minmax(140px, 0.7fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
}

.picker-trigger {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.picker-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-search {
    margin-bottom: 14px;
}

.picker-results {
    display: grid;
    gap: 8px;
    max-height: 52vh;
    overflow: auto;
}

.picker-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.picker-result:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: #eff6ff;
}

.picker-result small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
}

.picker-result em {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
}

.picker-empty {
    padding: 28px;
    text-align: center;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

/* ============ PREMIUM DASHBOARD ============ */
.dashboard-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
    gap: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
    border: 1px solid rgba(37, 99, 235, 0.13);
    border-radius: 20px;
    background:
        radial-gradient(circle at 12% 18%, rgba(37, 99, 235, 0.16), transparent 28%),
        radial-gradient(circle at 90% 12%, rgba(21, 128, 61, 0.12), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef6ff 100%);
    box-shadow: var(--shadow-md);
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    inset: auto -60px -110px auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 68%);
    pointer-events: none;
}

.dashboard-hero-main,
.dashboard-hero-visual {
    position: relative;
    z-index: 1;
}

.dashboard-eyebrow {
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-hero h1 {
    margin: 4px 0 4px;
    max-width: 540px;
    color: var(--text-primary);
    font-size: clamp(18px, 2.3vw, 28px);
    line-height: 1.12;
}

.dashboard-hero p {
    max-width: 520px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.dashboard-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.dashboard-hero-pills span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-secondary);
    font-size: 10.5px;
    font-weight: 700;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.dashboard-hero-visual {
    display: grid;
    gap: 10px;
    min-width: 0;
    align-content: start;
}

.dashboard-car-showcase {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(220px, 1.1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(238,246,255,0.95));
    min-width: 0;
}

.dashboard-showcase-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.dashboard-showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-showcase-grid div {
    padding: 8px 6px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 227, 236, 0.88);
    text-align: center;
}

.dashboard-showcase-grid strong {
    display: block;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1;
}

.dashboard-showcase-grid span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-car-illustration {
    position: relative;
    min-height: 108px;
    border-radius: 14px;
    background:
        radial-gradient(circle at 82% 18%, rgba(21, 128, 61, 0.12), transparent 22%),
        linear-gradient(180deg, rgba(232, 241, 255, 0.92), rgba(248, 251, 255, 0.96));
    overflow: hidden;
}

.dashboard-road-line {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(100, 116, 139, 0.32), rgba(148, 163, 184, 0.18));
}

.dashboard-car-body {
    position: absolute;
    right: 14px;
    bottom: 20px;
    width: 142px;
    height: 52px;
    border-radius: 16px 24px 12px 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8 55%, #0f766e 100%);
    box-shadow: 0 18px 28px rgba(37, 99, 235, 0.22);
}

.dashboard-car-roof {
    position: absolute;
    left: 34px;
    top: -18px;
    width: 66px;
    height: 32px;
    border-radius: 18px 22px 8px 8px;
    background: linear-gradient(135deg, #1d4ed8, #0f172a);
}

.dashboard-car-window {
    position: absolute;
    top: -12px;
    height: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(191,219,254,0.75));
}

.dashboard-car-window-front {
    left: 75px;
    width: 22px;
    border-radius: 5px 10px 4px 4px;
}

.dashboard-car-window-back {
    left: 46px;
    width: 20px;
    border-radius: 8px 4px 4px 6px;
}

.dashboard-car-headlight {
    position: absolute;
    right: 7px;
    top: 14px;
    width: 10px;
    height: 9px;
    border-radius: 6px;
    background: #fef08a;
    box-shadow: 0 0 14px rgba(254, 240, 138, 0.9);
}

.dashboard-car-wheel {
    position: absolute;
    bottom: -10px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #0f172a;
    border: 4px solid #cbd5e1;
}

.dashboard-car-wheel::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 999px;
    background: #475569;
}

.dashboard-car-wheel-front { right: 14px; }
.dashboard-car-wheel-back { left: 14px; }

.dashboard-floating-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(219, 227, 236, 0.9);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
}

.dashboard-chip-profit {
    left: 8px;
    top: 8px;
}

.dashboard-chip-stock {
    left: 12px;
    bottom: 24px;
}

.dashboard-focus-card {
    align-self: stretch;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
}

.dashboard-focus-card span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-focus-card strong {
    display: block;
    margin: 5px 0 8px;
    font-size: 18px;
}

.dashboard-focus-list {
    display: grid;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.dashboard-book-grid,
.dashboard-stat-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-book-grid { grid-template-columns: repeat(3, 1fr); }
.dashboard-stat-grid { grid-template-columns: repeat(4, 1fr); }

.dashboard-book-card,
.dashboard-mini-stat,
.dashboard-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.dashboard-book-card {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 16px;
    color: var(--text-primary);
    transition: var(--transition);
}

.dashboard-book-card.active {
    border-color: rgba(37, 99, 235, 0.34);
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 62%, #edf5ff 100%);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.10);
}

.dashboard-book-card:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.dashboard-book-card.active::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 24px 0 0 24px;
    background: linear-gradient(180deg, var(--accent-blue), #1d4ed8);
}

.dashboard-book-top,
.dashboard-panel-head,
.dashboard-activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-book-icon,
.dashboard-mini-icon,
.activity-dot {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--accent-blue-glow);
    color: var(--accent-blue);
    font-size: 20px;
}

.activity-dot {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 17px;
    flex-shrink: 0;
}

.dashboard-book-card.active .dashboard-book-icon {
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.dashboard-book-label,
.dashboard-mini-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-book-tag {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-book-tag-cash {
    background: rgba(21, 128, 61, 0.10);
    color: var(--accent-green);
}

.dashboard-book-tag-bank {
    background: rgba(37, 99, 235, 0.10);
    color: var(--accent-blue);
}

.dashboard-book-meta {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.dashboard-book-balance {
    font-size: 25px;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 8px;
}

.dashboard-book-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(219, 227, 236, 0.86);
}

.dashboard-book-state,
.dashboard-book-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
}

.dashboard-book-state {
    color: var(--text-muted);
}

.dashboard-book-state.active {
    color: var(--accent-blue);
}

.dashboard-book-link {
    color: var(--text-secondary);
}

.dashboard-mini-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.dashboard-mini-value {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.05;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
}

.dashboard-panel {
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
}

.dashboard-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.55), rgba(21, 128, 61, 0.22), rgba(124, 58, 237, 0.42));
    opacity: 0.9;
}

.dashboard-panel-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.dashboard-panel-head h3 {
    font-size: 15px;
}

.dashboard-panel-body {
    padding: 4px 0;
}

.dashboard-panel-foot {
    padding: 10px 16px 14px;
    border-top: 1px solid rgba(219, 227, 236, 0.92);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.3), rgba(239, 244, 250, 0.72));
}

.dashboard-activity-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.dashboard-activity-row:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05), rgba(255, 255, 255, 0.96) 38%);
}

.dashboard-activity-row:last-child {
    border-bottom: none;
}

.activity-info strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
}

.activity-info span,
.activity-side span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
}

.activity-info,
.activity-side {
    min-width: 0;
}

.activity-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-side {
    text-align: right;
}

.activity-side strong,
.activity-side span {
    white-space: nowrap;
}

.activity-side strong {
    font-size: 13px;
    line-height: 1.2;
}

.activity-side .date-time-stack {
    align-items: flex-end;
}

.activity-side .date-time-primary,
.activity-side .date-time-secondary {
    font-size: 11px;
}

.dashboard-alert {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.02), rgba(255, 255, 255, 0.95));
}

/* ============ OPERATOR DASHBOARD COCKPIT ============ */
.dashboard-command {
    display: grid;
    gap: 12px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.96)),
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.10), transparent 32%);
    box-shadow: var(--shadow-sm);
}

.dashboard-command-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.dashboard-command h1 {
    margin: 2px 0;
    color: var(--text-primary);
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.dashboard-command p {
    max-width: 620px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.dashboard-command-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(250px, 1.35fr) minmax(110px, 0.75fr);
    gap: 8px;
}

.dashboard-kpi-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 68px;
    padding: 10px;
    border: 1px solid rgba(219, 227, 236, 0.92);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-kpi-card:hover {
    border-color: rgba(37, 99, 235, 0.30);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.dashboard-kpi-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 13px;
    background: rgba(37, 99, 235, 0.09);
    color: var(--accent-blue);
    font-size: 18px;
}

.dashboard-kpi-icon.in {
    background: rgba(21, 128, 61, 0.10);
    color: var(--accent-green);
}

.dashboard-kpi-icon.out {
    background: rgba(220, 38, 38, 0.10);
    color: var(--accent-red);
}

.dashboard-kpi-card div {
    min-width: 0;
}

.dashboard-kpi-card small {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.dashboard-kpi-card strong {
    display: block;
    margin-top: 2px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 850;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.dashboard-kpi-card em {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-account-switcher {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.dashboard-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-section-title span {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-section-title strong {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
}

.dashboard-section-title a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-blue);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.dashboard-account-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
}

.dashboard-account-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(219, 227, 236, 0.95);
    border-radius: 14px;
    background: #f8fbff;
    color: var(--text-primary);
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-account-card.active {
    border-color: rgba(37, 99, 235, 0.40);
    background: linear-gradient(135deg, #ffffff, #eff6ff);
    box-shadow: inset 3px 0 0 var(--accent-blue), 0 8px 18px rgba(37, 99, 235, 0.08);
}

.dashboard-account-card:hover {
    border-color: rgba(37, 99, 235, 0.28);
}

.dashboard-account-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 66px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dashboard-account-main {
    min-width: 0;
}

.dashboard-account-name {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-account-meta {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
}

.dashboard-account-side {
    min-width: 130px;
    text-align: right;
}

.dashboard-account-side strong {
    display: block;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 850;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.dashboard-account-side span {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 750;
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex; align-items: center; gap: 4px;
    justify-content: center; margin-top: 24px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}

.pagination a:hover { background: var(--bg-card); color: var(--text-primary); }
.pagination .active { background: var(--accent-blue); color: white; font-weight: 600; }
.pagination .disabled { opacity: 0.4; pointer-events: none; }
html.js .pagination.no-js-pagination { display: none; }

.lazy-list-footer {
    position: sticky;
    left: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), #ffffff);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

.lazy-list-footer::before {
    content: '';
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--accent-blue);
    opacity: 0.18;
    transition: var(--transition);
}

.is-loading-next .lazy-list-footer::before {
    opacity: 1;
    box-shadow: 0 0 0 8px var(--accent-blue-glow);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center; padding: 60px 20px;
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* ============ RECENT TRANSACTIONS ============ */
.transaction-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.transaction-item:last-child { border-bottom: none; }

.txn-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}

.txn-icon.in { background: var(--accent-green-glow); color: var(--accent-green); }
.txn-icon.out { background: var(--accent-red-glow); color: var(--accent-red); }
.txn-icon.transfer { background: var(--accent-blue-glow); color: var(--accent-blue); }

.txn-info { flex: 1; }
.txn-type { font-size: 14px; font-weight: 600; }
.txn-narration { font-size: 12px; color: var(--text-muted); }

.txn-amount { text-align: right; }
.txn-amount .amount { font-size: 15px; }
.txn-amount .txn-date { font-size: 11px; color: var(--text-muted); }

/* ============ GRID LAYOUTS ============ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ============ FILTER BAR ============ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border: 1px solid rgba(199, 211, 224, 0.85);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 251, 255, 0.9));
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.035);
}

.entry-menu-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -6px 0 14px;
}

.entry-menu-legend span,
.transaction-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.transaction-context-chip {
    margin-top: 6px;
    width: fit-content;
}

.transaction-context-chip.flow-in {
    background: var(--accent-green-glow);
    border-color: rgba(21, 128, 61, 0.22);
}

.transaction-context-chip.flow-out {
    background: var(--accent-red-glow);
    border-color: rgba(220, 38, 38, 0.22);
}

.transaction-context-chip.flow-neutral {
    background: rgba(255, 255, 255, 0.86);
}

.narration-tooltip {
    position: relative;
    display: inline-block;
    max-width: 100%;
    cursor: help;
    color: var(--text-secondary);
    border-bottom: 1px dashed rgba(114, 129, 150, 0.45);
}

.narration-tooltip::after {
    content: attr(data-full-text);
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 18;
    width: min(360px, 48vw);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.96);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: 0.18s ease;
    white-space: normal;
}

.narration-tooltip:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.filter-bar form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    width: 100% !important;
}

.filter-bar form > div {
    min-width: 0;
    flex: 0 1 180px;
}

.filter-bar form > .form-control {
    flex: 0 1 210px;
    width: auto;
}

.filter-bar form > .btn:first-of-type,
.filter-bar form > a.btn:first-of-type {
    margin-left: auto;
}

.filter-bar .form-label {
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.filter-bar .form-control {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 13px;
}

.filter-bar .btn {
    min-height: 36px;
    padding: 7px 13px;
    border-radius: 10px;
    white-space: nowrap;
}

.filter-main-field {
    flex: 1 1 320px !important;
    min-width: min(280px, 100%) !important;
    max-width: none;
}

.filter-main-field.filter-main-field-wide {
    flex-basis: 460px !important;
    max-width: none;
}

.filter-bar.filter-bar-chipset {
    padding: 6px 8px;
    gap: 8px;
}

.filter-bar.filter-bar-chipset .btn {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 10px;
}

.entries-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 10px;
}

.entries-page-header .entries-page-copy {
    display: block;
    min-width: 0;
}

.entries-page-header .entries-page-copy h1 {
    display: none !important;
}

.entries-page-header .entries-page-copy .text-muted {
    max-width: 720px;
    margin-top: 0;
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.45;
}

.entries-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.entries-filter-bar {
    padding: 10px;
    border-radius: 14px;
}

.entries-filter-form {
    display: grid !important;
    grid-template-columns: minmax(260px, 1.35fr) minmax(150px, 0.65fr) minmax(150px, 0.65fr) auto;
    align-items: end !important;
    gap: 10px !important;
    width: 100%;
}

.entries-filter-field {
    min-width: 0;
}

.entries-filter-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.entries-filter-actions .btn {
    min-width: 78px;
}
.top-entry-btn { box-shadow: var(--shadow-sm); }

.sidebar-backdrop {
    display: none;
}

/* ============ ANIMATIONS ============ */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(59,130,246,0.1); }
    50% { box-shadow: 0 0 20px rgba(59,130,246,0.2); }
}

.animate-fade { animation: fadeIn 0.4s ease; }
.animate-slide { animation: slideIn 0.4s ease; }

/* ============ LOGIN PAGE ============ */
.login-container {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-primary);
    position: relative; overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(37,99,235,0.06), transparent);
    top: -100px; right: -100px;
    border-radius: 50%;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(124,58,237,0.05), transparent);
    bottom: -100px; left: -100px;
    border-radius: 50%;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%; max-width: 440px;
    position: relative; z-index: 1;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center; margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 64px; height: 64px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    padding: 8px;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.login-logo .logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.login-logo h1 {
    font-size: 24px; font-weight: 800;
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 14px; color: var(--text-muted);
}

/* ============ SETUP WIZARD ============ */
.setup-container {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-primary);
    padding: 40px 20px;
}

.setup-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%; max-width: 600px;
    box-shadow: var(--shadow-lg);
}

.setup-steps {
    display: flex; gap: 8px; margin-bottom: 36px;
}

.setup-step {
    flex: 1; height: 4px;
    background: var(--border); border-radius: 2px;
}

.setup-step.active { background: var(--accent-blue); }
.setup-step.done { background: var(--accent-green); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
    .account-cards { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid[style] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .dashboard-hero,
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .dashboard-kpi-wide {
        grid-column: span 2;
    }
}

@media (max-width: 1440px) {
    :root {
        --sidebar-width: 232px;
        --sidebar-collapsed-width: 76px;
        --header-height: 58px;
        --table-min-width: 900px;
    }

    .page-content {
        padding: 16px;
    }

    .top-header {
        padding: 8px 18px;
        gap: 12px;
    }

    .sidebar-brand {
        padding: 16px 18px;
    }

    .sidebar-nav {
        padding: 12px 10px;
    }

    .card-header {
        padding: 14px 18px;
    }

    .card-body {
        padding: 18px;
    }

    .stats-grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        gap: 16px;
    }

    .dashboard-hero {
        padding: 15px 16px;
        gap: 12px;
        border-radius: 18px;
    }

    .dashboard-command {
        padding: 12px;
        border-radius: 16px;
    }

    .dashboard-hero h1 {
        font-size: 26px;
    }

    .dashboard-car-showcase {
        grid-template-columns: 1fr;
    }

    .dashboard-focus-card,
    .dashboard-book-card,
    .dashboard-mini-stat,
    .dashboard-panel {
        border-radius: 14px;
    }

    .filter-bar {
        padding: 8px 10px;
        gap: 8px;
    }

    .entries-filter-form {
        grid-template-columns: minmax(240px, 1fr) minmax(140px, 0.58fr) minmax(140px, 0.58fr) auto;
    }

    .dashboard-kpi-grid {
        gap: 7px;
    }

    .dashboard-kpi-card {
        min-height: 62px;
        padding: 9px;
    }

    .dashboard-kpi-icon {
        width: 34px;
        height: 34px;
        border-radius: 11px;
        font-size: 16px;
    }

    .dashboard-account-card {
        padding: 9px 10px;
    }
}

@media (max-width: 1366px) {
    :root {
        --sidebar-width: 216px;
        --sidebar-collapsed-width: 68px;
        --table-min-width: 840px;
    }

    body {
        font-size: 13.5px;
    }

    .nav-link {
        padding: 9px 10px;
        font-size: 13px;
    }

    .page-content {
        padding: 14px;
    }

    .top-header {
        padding-inline: 14px;
    }

    .page-title {
        font-size: 18px;
    }

    .form-row,
    .form-row-3 {
        gap: 12px;
    }

    .table-container thead th,
    thead th,
    .table-container tbody td,
    tbody td {
        padding-inline: 10px;
    }

    .stats-grid {
        gap: 14px;
        margin-bottom: 20px;
    }

    .dashboard-hero {
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
        padding: 14px;
    }

    .dashboard-command h1 {
        font-size: 24px;
    }

    .dashboard-command-actions .btn {
        min-height: 38px;
        padding: 0 13px;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(240px, 1fr);
    }

    .dashboard-kpi-wide {
        grid-column: auto;
    }

    .dashboard-hero p {
        font-size: 12.5px;
    }

    .dashboard-hero-actions .btn {
        min-height: 38px;
        padding: 0 14px;
    }

    .dashboard-book-card {
        padding: 14px;
    }

    .dashboard-book-balance {
        font-size: 22px;
    }

    .dashboard-panel-head,
    .dashboard-activity-row,
    .dashboard-panel-foot {
        padding-left: 14px;
        padding-right: 14px;
    }

    .entry-form {
        padding: 14px;
        gap: 12px;
    }

    .simple-entry-option {
        min-height: 58px;
        padding: 9px 11px;
    }

    .simple-entry-option strong {
        font-size: 11px;
    }

    .entry-core-panel {
        padding: 12px;
    }
}

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

    .dashboard-kpi-wide {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.32);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
        z-index: 140;
    }
    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar {
        transform: translateX(-100%);
        z-index: 160;
        width: min(88vw, 320px);
        box-shadow: 18px 0 42px rgba(15, 23, 42, 0.18);
    }
    body.sidebar-collapsed .sidebar {
        width: min(88vw, 320px);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    .account-cards { grid-template-columns: 1fr; }
    .stats-grid,
    .stats-grid[style] { grid-template-columns: 1fr !important; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
    .attachment-upload-panel,
    .attachment-columns {
        grid-template-columns: 1fr;
    }
    .attachment-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .entry-helper-strip,
    .simple-entry-switch,
    .entry-core-panel .form-row,
    .entry-core-panel .form-row-3,
    .split-entry-panel,
    .dashboard-book-grid,
    .dashboard-kpi-grid,
    .dashboard-stat-grid,
    .split-guide,
    .split-balance-card,
    .split-line-row {
        grid-template-columns: 1fr;
    }
    .entry-helper-strip {
        align-items: stretch;
    }
    .entry-header-actions {
        width: 100%;
        margin-left: 0;
    }
    .entry-header-actions span {
        flex: 1 1 auto;
        justify-content: center;
    }
    .entry-form {
        padding: 12px;
    }
    .entry-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .dashboard-command-head {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .dashboard-command-actions {
        justify-content: stretch;
    }
    .dashboard-command-actions .btn {
        flex: 1 1 150px;
    }
    .dashboard-section-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
    .dashboard-account-rail {
        grid-template-columns: 1fr;
    }
    .dashboard-account-card {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }
    .dashboard-account-type {
        justify-content: flex-start;
        width: fit-content;
    }
    .dashboard-account-side {
        min-width: 0;
        text-align: left;
    }
    .dashboard-account-side span {
        justify-content: flex-start;
    }
    .dashboard-hero {
        padding: 20px;
        border-radius: 22px;
    }
    .dashboard-hero-pills,
    .dashboard-showcase-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-car-body {
        width: 190px;
        right: 12px;
    }
    .dashboard-hero-actions {
        flex-direction: column;
    }
    .dashboard-hero-actions .btn {
        width: 100%;
    }
    .activity-side {
        text-align: left;
    }
    .page-content { padding: 16px; }
    .top-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 16px;
    }
    .header-left,
    .header-right {
        width: 100%;
    }
    .header-right {
        justify-content: flex-start;
        gap: 10px;
    }
    .header-right > * {
        flex: 1 1 calc(50% - 10px);
        min-width: 0;
    }
    .header-right .btn,
    .header-right .header-btn {
        width: 100%;
        justify-content: center;
    }
    .page-title {
        font-size: 18px;
        line-height: 1.2;
    }
    .top-entry-btn { display: none; }
    .desktop-logout-btn {
        display: none;
    }
    .sidebar-logout-btn {
        display: inline-flex;
    }
    .table-container {
        max-height: min(52vh, 460px);
    }
    .table-container-inline {
        max-height: min(44vh, 340px);
    }
    .table-container table {
        width: max(100%, 720px);
    }
    .table-container-fill {
        min-height: 260px;
    }
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .page-header > div,
    .page-header > form,
    .page-header form,
    .page-header .btn,
    .page-header .header-btn {
        width: 100%;
    }
    .page-header p {
        width: 100%;
    }
    .filter-bar,
    .filter-bar form {
        align-items: stretch !important;
        width: 100%;
    }
    .entries-page-header {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .entries-page-actions {
        justify-content: stretch;
        white-space: normal;
    }
    .entries-page-actions .btn {
        flex: 1 1 150px;
    }
    .entries-filter-form {
        grid-template-columns: 1fr;
    }
    .entries-filter-actions {
        justify-content: stretch;
    }
    .entries-filter-actions .btn {
        flex: 1 1 0;
        width: auto;
    }
    .filter-bar form > .btn:first-of-type,
    .filter-bar form > a.btn:first-of-type {
        margin-left: 0;
    }
    .filter-bar .form-control,
    .filter-bar .btn {
        width: 100%;
    }
    .entries-filter-actions .btn {
        width: auto;
    }
    .card-body[style*="display:flex"] {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }
    .modal {
        width: calc(100% - 20px);
        max-height: calc(100dvh - 20px);
    }
    .modal-body,
    .modal-header,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    .modal-footer {
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
    }
    .split-line-row .split-remove-btn {
        width: 100%;
    }
    #transaction-form > div[style*="display: flex"] {
        flex-direction: column;
    }
}

/* ============ PRINT ============ */
@media print {
    .sidebar, .top-header, .btn, .filter-bar, .pagination { display: none !important; }
    .attachment-upload-panel,
    .car-images-upload-panel,
    input[type="file"],
    .attachment-actions,
    .modal-overlay {
        display: none !important;
    }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    body { background: white; color: black; }
    .card { border: 1px solid #ddd; }
    .table-container { border: 1px solid #ddd; }
    th { background: #f5f5f5 !important; color: #333 !important; }
    td { color: #333 !important; border-color: #ddd !important; }
}

/* Operational compact UI additions */
.compact-operational-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 12px 0 18px;
}
.compact-operational-grid .stat-card {
    min-height: auto;
    padding: 14px 16px;
}
.compact-operational-grid .stat-value {
    font-size: 21px;
    line-height: 1.15;
}
.compact-pending-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
}
.mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.mini-pill-in { background: rgba(22, 163, 74, .1); color: #15803d; }
.mini-pill-out { background: rgba(220, 38, 38, .09); color: #dc2626; }
.mini-pill-warn { background: rgba(217, 119, 6, .12); color: #b45309; }
.mini-pill-neutral { background: rgba(100, 116, 139, .12); color: #475569; }
.table-action-stack {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.inline-entry-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(140px, .7fr) minmax(180px, 1.3fr) auto;
    gap: 8px;
    align-items: end;
}
.rto-entry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.rto-span-2 { grid-column: span 2; }
.rto-actions { align-self: end; }
.compact-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(150px, .7fr) minmax(140px, .7fr) auto auto;
    gap: 10px;
    align-items: center;
    width: 100%;
}
.row-actions-details summary {
    cursor: pointer;
    color: var(--accent-blue);
    font-weight: 800;
    font-size: 12px;
}
.mini-post-form {
    display: grid;
    grid-template-columns: 128px 120px minmax(160px, 1fr);
    gap: 6px;
    min-width: 420px;
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
}
.mini-post-form .btn,
.mini-post-form input[type="file"],
.mini-post-form input[name="narration"] {
    grid-column: span 3;
}
.dashboard-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
@media (max-width: 1100px) {
    .rto-entry-grid,
    .inline-entry-form,
    .compact-filter-form {
        grid-template-columns: 1fr 1fr;
    }
    .rto-span-2,
    .mini-post-form .btn,
    .mini-post-form input[type="file"],
    .mini-post-form input[name="narration"] {
        grid-column: span 2;
    }
    .mini-post-form { min-width: 320px; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .rto-entry-grid,
    .inline-entry-form,
    .compact-filter-form,
    .mini-post-form {
        grid-template-columns: 1fr;
        min-width: 0;
    }
    .rto-span-2,
    .mini-post-form .btn,
    .mini-post-form input[type="file"],
    .mini-post-form input[name="narration"] {
        grid-column: span 1;
    }
}
