/* ============================================================
   cash.habibprint.com — Modern design system
   Bootstrap 5 + custom layer with light/dark theming.
   ============================================================ */

/* ───── Design tokens (Light mode) ───── */
:root {
    --brand:          #4f46e5;
    --brand-dark:     #4338ca;
    --brand-light:    #818cf8;
    --brand-bg:       #eef2ff;
    --brand-ring:     rgba(79, 70, 229, 0.25);

    --topbar-h:       56px;
    --sidebar-w:      250px;

    --bg-body:        #f8fafc;
    --bg-surface:     #ffffff;
    --bg-surface-2:   #f1f5f9;
    --bg-surface-3:   #e2e8f0;
    --bg-sidebar:     #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-topbar:      #0f172a;

    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --text-inverse:   #ffffff;
    --text-link:      var(--brand);

    --border:         #e2e8f0;
    --border-light:   #f1f5f9;

    --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl:      0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    --radius-sm:      6px;
    --radius-md:      10px;
    --radius-lg:      14px;
    --radius-xl:      18px;
    --radius-full:    999px;

    --success:        #059669;
    --success-bg:     #ecfdf5;
    --success-text:   #065f46;
    --warning:        #d97706;
    --warning-bg:     #fffbeb;
    --warning-text:   #92400e;
    --danger:         #dc2626;
    --danger-bg:      #fef2f2;
    --danger-text:    #991b1b;
    --info:           #0284c7;
    --info-bg:        #f0f9ff;
    --info-text:      #075985;

    --chart-1:        #4f46e5;
    --chart-2:        #06b6d4;
    --chart-3:        #8b5cf6;
    --chart-4:        #f59e0b;
    --chart-5:        #ec4899;
    --chart-6:        #10b981;

    --transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ───── Dark mode tokens ───── */
[data-theme="dark"] {
    --brand:          #818cf8;
    --brand-dark:     #6366f1;
    --brand-light:    #a5b4fc;
    --brand-bg:       rgba(99, 102, 241, 0.15);
    --brand-ring:     rgba(129, 140, 248, 0.3);

    --bg-body:        #0b1120;
    --bg-surface:     #131b2e;
    --bg-surface-2:   #1a2540;
    --bg-surface-3:   #243050;
    --bg-sidebar:     #0a0f1e;
    --bg-sidebar-hover: #131b2e;
    --bg-topbar:      #0a0f1e;

    --text-primary:   #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --text-inverse:   #0f172a;

    --border:         #1e293b;
    --border-light:   #162032;

    --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl:      0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);

    --success-bg:     rgba(5, 150, 105, 0.15);
    --success-text:   #6ee7b7;
    --warning-bg:     rgba(217, 119, 6, 0.15);
    --warning-text:   #fcd34d;
    --danger-bg:      rgba(220, 38, 38, 0.15);
    --danger-text:    #fca5a5;
    --info-bg:        rgba(2, 132, 199, 0.15);
    --info-text:      #7dd3fc;

    --chart-1:        #818cf8;
    --chart-2:        #22d3ee;
    --chart-3:        #a78bfa;
    --chart-4:        #fbbf24;
    --chart-5:        #f472b6;
    --chart-6:        #34d399;
}

/* ───── Dark mode Bootstrap overrides ───── */
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .list-group-item {
    background-color: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-primary);
}
[data-theme="dark"] .card-header {
    background-color: var(--bg-surface-2);
    border-color: var(--border);
    color: var(--text-primary);
}
[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: var(--bg-surface-2);
    --bs-table-hover-bg: var(--bg-surface-2);
    color: var(--text-primary);
}
[data-theme="dark"] .table-light {
    --bs-table-bg: var(--bg-surface-2);
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-surface-2);
    border-color: var(--border);
    color: var(--text-primary);
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--bg-surface-3);
    border-color: var(--brand);
    color: var(--text-primary);
}
[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}
[data-theme="dark"] .input-group-text {
    background-color: var(--bg-surface-3);
    border-color: var(--border);
    color: var(--text-secondary);
}
[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
}
[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--bg-surface-2);
    border-color: var(--text-muted);
    color: var(--text-primary);
}
[data-theme="dark"] .btn-outline-light {
    border-color: var(--border);
    color: var(--text-secondary);
}
[data-theme="dark"] .btn-outline-light:hover {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
}
[data-theme="dark"] .alert-warning {
    background-color: var(--warning-bg);
    border-color: rgba(217, 119, 6, 0.3);
    color: var(--warning-text);
}
[data-theme="dark"] .alert-info {
    background-color: var(--info-bg);
    border-color: rgba(2, 132, 199, 0.3);
    color: var(--info-text);
}
[data-theme="dark"] .alert-success {
    background-color: var(--success-bg);
    border-color: rgba(5, 150, 105, 0.3);
    color: var(--success-text);
}
[data-theme="dark"] .alert-danger {
    background-color: var(--danger-bg);
    border-color: rgba(220, 38, 38, 0.3);
    color: var(--danger-text);
}
[data-theme="dark"] .badge.text-bg-light {
    background-color: var(--bg-surface-3) !important;
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .badge.bg-warning {
    background-color: rgba(217, 119, 6, 0.25) !important;
    color: var(--warning-text) !important;
}
[data-theme="dark"] .badge.bg-secondary {
    background-color: var(--bg-surface-3) !important;
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}
[data-theme="dark"] .text-white-50 {
    color: var(--text-muted) !important;
}
[data-theme="dark"] .btn-link {
    color: var(--brand);
}
[data-theme="dark"] .pagination .page-link {
    background-color: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-secondary);
}
[data-theme="dark"] .pagination .page-item.active .page-link {
    background-color: var(--brand);
    border-color: var(--brand);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border);
}
[data-theme="dark"] .btn-close {
    filter: invert(1);
}

/* ───── Base ───── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition);
}

/* ───── Topbar ───── */
.app-topbar {
    height: var(--topbar-h);
    background: var(--bg-topbar);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.app-topbar .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.app-topbar .navbar-brand {
    color: #fff !important;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Theme toggle button in topbar */
.theme-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-full);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.05rem;
    padding: 0;
}
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ───── Shell layout ───── */
.app-shell {
    display: flex;
    min-height: calc(100vh - var(--topbar-h));
}
.app-sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    color: #cbd5e1;
    flex-shrink: 0;
    position: sticky;
    top: var(--topbar-h);
    align-self: flex-start;
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    padding: 0.75rem 0;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
.app-sidebar::-webkit-scrollbar { width: 5px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }
.app-sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--bg-body);
    transition: background var(--transition);
}

@media (max-width: 767.98px) {
    .app-sidebar {
        position: fixed;
        top: var(--topbar-h);
        left: -100%;
        height: calc(100vh - var(--topbar-h));
        z-index: 1020;
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    }
    .app-sidebar.show { left: 0; }
}

.sidebar-heading {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.75rem 1rem 0.25rem;
    margin-top: 0.25rem;
}
.sidebar-section { padding: 0 0.5rem; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 450;
    margin: 1px 0;
    transition: all var(--transition);
}
.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: #e2e8f0;
}
.sidebar-link.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-weight: 550;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}
.sidebar-link i { font-size: 1.05rem; opacity: 0.85; }
.sidebar-link.active i { opacity: 1; }

/* ───── Auth (login) ───── */
.auth-body {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 50%, #0c0a1a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-shell { width: 100%; max-width: 420px; padding: 1rem; }
.auth-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}
[data-theme="dark"] .auth-card {
    background: var(--bg-surface);
    border-color: var(--border);
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.auth-brand .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.auth-brand .brand-text strong { display: block; font-size: 1rem; color: var(--text-primary); }
.auth-brand .brand-text small  { color: var(--text-muted); font-size: 0.8rem; }
.auth-footer { color: rgba(255,255,255,.5) !important; }

/* ───── Dashboard KPI cards ───── */
.kpi-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    background: var(--bg-surface);
    height: 100%;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-light));
    opacity: 0;
    transition: opacity var(--transition);
}
.kpi-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
    transform: translateY(-1px);
}
.kpi-card:hover::before { opacity: 1; }
.kpi-card .label {
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}
.kpi-card .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.3;
}
.kpi-card .sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}
.kpi-card .sub a {
    color: var(--brand);
    text-decoration: none;
}
.kpi-card .sub a:hover { text-decoration: underline; }

/* ───── Chart cards on dashboard ───── */
.chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition);
}
.chart-card:hover {
    box-shadow: var(--shadow-md);
}
.chart-card .chart-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.chart-card .chart-title i { color: var(--brand); font-size: 0.9rem; }
.chart-wrap {
    position: relative;
    height: 220px;
}

/* ───── Fast Entry tiles ───── */
.fast-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    background: var(--bg-surface);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition);
    min-height: 140px;
}
.fast-tile:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}
.fast-tile i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.fast-tile .tile-title { font-weight: 600; font-size: 0.95rem; }
.fast-tile .tile-sub   { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.fast-tile.warn  { border-left: 4px solid var(--warning); }
.fast-tile.danger{ border-left: 4px solid var(--danger); }

/* ───── Tables ───── */
.table .text-end { text-align: right; }
.money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.money.negative { color: var(--danger); }

/* ───── Cards ───── */
.card {
    border-color: var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    background: var(--bg-surface-2);
    border-color: var(--border);
    padding: 0.85rem 1.25rem;
}

/* ───── Forms ───── */
.required-mark { color: var(--danger); margin-left: 2px; }
.form-label { font-weight: 500; color: var(--text-primary); }

/* ───── Status badges ───── */
.status-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.22rem 0.6rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-final { background: var(--success-bg); color: var(--success-text); }
.status-draft { background: var(--warning-bg); color: var(--warning-text); }
.status-void  { background: var(--danger-bg); color: var(--danger-text); text-decoration: line-through; }

/* ───── Empty states ───── */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; color: var(--border); }

/* ───── Misc ───── */
.text-monospace { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.page-header h1 {
    font-size: 1.35rem;
    margin: 0;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ───── Pagination spacing ───── */
.pagination .page-link {
    min-width: 38px;
    text-align: center;
}

/* ───── Buttons refinement ───── */
.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    border-color: var(--brand-dark);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-dark) 0%, #3730a3 100%);
    border-color: #3730a3;
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
    transform: translateY(-0.5px);
}
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #d97706;
    color: #fff;
}
.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border-color: #b45309;
    color: #fff;
}

/* ───── Alerts modernization ───── */
.alert {
    border-radius: var(--radius-md);
    border-left-width: 4px;
}

/* ───── Mobile improvements ───── */
@media (max-width: 767.98px) {
    .btn { min-height: 38px; }
    .btn-lg { min-height: 48px; }
    .btn-sm { min-height: 32px; }
    .form-control,
    .form-select { min-height: 40px; font-size: 16px; }
    .form-control-lg,
    .form-select-lg { min-height: 48px; }

    .page-header h1 { font-size: 1.15rem; }
    .page-header .d-flex { flex-wrap: wrap; }

    .kpi-card { padding: 0.75rem 1rem; }
    .kpi-card .value { font-size: 1.35rem; }

    .fast-tile { min-height: 110px; padding: 1rem 0.75rem; }
    .fast-tile i { font-size: 1.6rem; margin-bottom: 0.25rem; }
    .fast-tile .tile-title { font-size: 0.85rem; }
    .fast-tile .tile-sub { font-size: 0.7rem; }

    .table-sm > :not(caption) > * > * { padding: 0.5rem 0.45rem; }

    .app-sidebar.show { width: 80vw; max-width: 280px; }

    .chart-wrap { height: 180px; }
}

/* ───── Iconography fallback for the print-actions button glyph ───── */
.print-actions .btn i {
    font-style: normal;
    font-size: 1rem;
    line-height: 1;
}

/* ============================================================
   Fast Entry — unified single-page operations console
   ============================================================ */

.fast-page {
    --fast-radius: var(--radius-lg);
    --fast-border: 1px solid var(--border);
    --fast-bg:     var(--bg-surface);
}

.fast-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.fast-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.kpi-mini {
    background: var(--bg-surface-2);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.85rem;
    text-align: right;
    line-height: 1.1;
}
.kpi-mini .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.kpi-mini .value {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--brand-dark);
}

/* Two-column shell: vertical tab rail + form panel */
.fast-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.fast-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-self: start;
    position: sticky;
    top: calc(var(--topbar-h) + 0.75rem);
}
.fast-tab {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--fast-bg);
    border: var(--fast-border);
    border-radius: var(--fast-radius);
    padding: 0.65rem 0.85rem;
    text-align: left;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .05s;
    position: relative;
}
.fast-tab i { font-size: 1.25rem; color: var(--text-muted); flex-shrink: 0; }
.fast-tab .fast-tab-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.fast-tab .fast-tab-title { font-weight: 600; font-size: 0.9rem; }
.fast-tab .fast-tab-sub { font-size: 0.72rem; color: var(--text-muted); }
.fast-tab:hover { border-color: var(--brand); background: var(--bg-surface-2); }
.fast-tab.active {
    border-color: var(--brand);
    background: var(--brand-bg);
    box-shadow: 0 1px 3px var(--brand-ring);
}
.fast-tab.active i,
.fast-tab.active .fast-tab-title { color: var(--brand-dark); }

/* Panels */
.fast-panels { min-width: 0; }
.fast-panel {
    display: none;
    background: var(--fast-bg);
    border: var(--fast-border);
    border-radius: var(--fast-radius);
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: var(--shadow-sm);
}
.fast-panel.active { display: block; }
.fast-panel-head {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border);
}
.fast-panel-head h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.15rem;
    color: var(--text-primary);
}
.fast-panel-head h2 i { color: var(--brand); margin-right: 0.35rem; }

/* Form grid: 2 columns on desktop, full-width "wide" cells, 1 column on mobile */
.fast-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
}
.fast-form .form-cell.wide { grid-column: span 2; }
.fast-form .form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.25rem; }
.fast-form .form-control,
.fast-form .form-select {
    font-size: 1rem;
}
.fast-form .input-group-text { font-weight: 600; background: var(--bg-surface-2); }

.fast-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}
.fast-form-actions .btn-primary { flex-shrink: 0; }
.fast-form-actions .btn-link { color: var(--text-muted); text-decoration: none; }
.fast-form-actions .btn-link:hover { color: var(--brand-dark); text-decoration: underline; }

/* ───── Wallet Services — brand cards ───── */
.brand-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}
.brand-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    color: #fff;
    cursor: pointer;
    transition: transform .08s, box-shadow .15s;
    overflow: hidden;
}
.brand-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.brand-card i { font-size: 1.4rem; opacity: 0.95; }
.brand-card .brand-name { font-weight: 700; font-size: 0.95rem; line-height: 1.15; }
.brand-card .brand-channel {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
}
.brand-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.brand-card.is-checked {
    border-color: #fff;
    box-shadow: 0 0 0 3px var(--brand-ring), 0 4px 14px rgba(0,0,0,.18);
}

/* Pakistani brand colours */
.brand-jazzcash  { background: linear-gradient(135deg, #6f1aab 0%, #8a2be2 100%); }
.brand-easypaisa { background: linear-gradient(135deg, #00a651 0%, #2ecc71 100%); }
.brand-ubl       { background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%); }
.brand-upaisa    { background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); }
.brand-zong      { background: linear-gradient(135deg, #15803d 0%, #16a34a 100%); }
.brand-esahulat  { background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%); }
.brand-konnect   { background: linear-gradient(135deg, #166534 0%, #4d7c0f 100%); }
.brand-nayapay   { background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%); }
.brand-sadapay   { background: linear-gradient(135deg, #0f172a 0%, #334155 100%); }
.brand-meezan    { background: linear-gradient(135deg, #064e3b 0%, #047857 100%); }
.brand-alfalah   { background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%); }
.brand-raast     { background: linear-gradient(135deg, #312e81 0%, #4338ca 100%); }
.brand-generic   { background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%); }

/* Service-type pills */
.service-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.service-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
}
.service-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.service-pill i { font-size: 0.95rem; }
.service-pill:hover { border-color: var(--brand); }
.service-pill.is-checked {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.service-pill.is-checked i { color: #fff; }

/* Wallet summary strip */
.wallet-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface-2);
    border-radius: var(--fast-radius);
    border: 1px dashed var(--border);
}
.wallet-summary > div { display: flex; flex-direction: column; }
.wallet-summary strong { font-size: 1.1rem; color: var(--brand-dark); }

/* ───── Recent activity blocks ───── */
.fast-recent { margin-top: 1rem; }
.recent-block {
    background: var(--fast-bg);
    border: var(--fast-border);
    border-radius: var(--fast-radius);
    padding: 0.85rem 1rem;
    height: 100%;
}
.recent-block header {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.recent-block header i { color: var(--brand); }
.recent-block ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.recent-block li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    align-items: baseline;
    font-size: 0.82rem;
}
.recent-block .ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    color: var(--brand-dark);
    text-decoration: none;
}
.recent-block .ref:hover { text-decoration: underline; }
.recent-block .who {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-block .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.recent-block .empty { color: var(--text-muted); font-size: 0.8rem; margin: 0; }

/* ───── Mobile / tablet ───── */
@media (max-width: 991.98px) {
    .fast-shell {
        grid-template-columns: 1fr;
    }
    .fast-tabs {
        position: relative;
        top: auto;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        gap: 0.5rem;
        scrollbar-width: thin;
    }
    .fast-tab {
        flex: 0 0 auto;
        min-width: 160px;
    }
    .fast-form .form-grid {
        grid-template-columns: 1fr;
    }
    .fast-form .form-cell.wide { grid-column: span 1; }
    .wallet-summary { gap: 0.85rem; }
    .wallet-summary > div { flex-basis: 45%; }
}

@media (max-width: 575.98px) {
    .fast-header { flex-direction: column; align-items: flex-start; }
    .fast-header-meta { width: 100%; justify-content: space-between; }
    .brand-picker { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .brand-card { padding: 0.7rem 0.85rem; }
}

/* ============================================================
   Wallet / Bill Fast Entry — primary/secondary hierarchy
   ============================================================ */

.primary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.5rem 0 1rem;
}
.primary-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--bg-surface-2);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem 0.95rem;
    transition: border-color .15s, background .15s, box-shadow .15s;
    cursor: text;
}
.primary-field:focus-within {
    border-color: var(--brand);
    background: var(--brand-bg);
    box-shadow: 0 0 0 4px var(--brand-ring);
}
.primary-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.primary-field input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0;
    font-variant-numeric: tabular-nums;
}
.primary-field input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}
.primary-input {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    width: 100%;
}
.primary-input input { width: 100%; }
.primary-currency {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Fee strip */
.fee-strip {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.85rem;
    align-items: end;
    background: var(--bg-surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.75rem;
}
.fee-strip-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.fee-strip-amt {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.fee-strip-total strong {
    font-size: 1.25rem;
    color: var(--brand-dark);
    font-variant-numeric: tabular-nums;
}
.fee-restore {
    align-self: flex-start;
    padding: 0;
    margin-top: 0.1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.72rem;
}
.fee-restore:hover { color: var(--brand-dark); }

/* Verification readback strip */
.verify-strip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--warning-bg);
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-lg);
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--warning-text);
}
.verify-strip i {
    font-size: 1.25rem;
    flex-shrink: 0;
}
.verify-strip span {
    font-weight: 500;
    line-height: 1.3;
}
.verify-strip.confirmed {
    background: var(--success-bg);
    border-color: rgba(5, 150, 105, 0.4);
    color: var(--success-text);
}
.verify-strip.confirmed i { color: var(--success); }

/* Collapsible secondary details */
.secondary-details {
    margin-bottom: 1rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
}
.secondary-details > summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    user-select: none;
}
.secondary-details > summary::-webkit-details-marker { display: none; }
.secondary-details > summary i {
    transition: transform .15s;
    margin-right: 0.25rem;
    color: var(--text-muted);
}
.secondary-details[open] > summary i { transform: rotate(90deg); }
.secondary-details[open] > summary { color: var(--text-primary); }
.secondary-details .form-grid { padding-bottom: 0.5rem; }
.secondary-details .form-cell.is-hidden { display: none; }

/* Mobile: stack the primary grid and the fee strip */
@media (max-width: 767.98px) {
    .primary-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .primary-field input { font-size: 1.4rem; }
    .fee-strip { grid-template-columns: 1fr; gap: 0.6rem; }
    .fee-strip-cell { flex-direction: row; align-items: center; justify-content: space-between; }
    .fee-strip-cell .input-group { max-width: 160px; }
}

/* ============================================================
   Fast Entry — UX-for-speed additions
   ============================================================ */

/* ───── Today's tally strip ───── */
.today-tally {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    background: var(--fast-bg);
    border: var(--fast-border);
    border-radius: var(--fast-radius);
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.85rem;
    overflow-x: auto;
}
.today-tally-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding-right: 0.85rem;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}
.today-tally-label i { color: var(--brand); font-size: 1.05rem; }
.tally-cell {
    flex: 1 1 auto;
    min-width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
    padding: 0.35rem 0.55rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .05s;
}
.tally-cell:hover { background: var(--bg-surface-2); border-color: var(--border); }
.tally-cell:active { transform: scale(0.98); }
.tally-cell i { font-size: 1.05rem; color: var(--text-muted); }
.tally-cell .tally-num {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.tally-cell .tally-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
}

/* ───── Draft restoration banner ───── */
.draft-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--warning-bg);
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--fast-radius);
    padding: 0.7rem 1rem;
    margin-bottom: 0.85rem;
}
.draft-banner-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(245, 158, 11, 0.3); color: var(--warning-text);
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 1.1rem;
}
.draft-banner-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}
.draft-banner-text strong { color: var(--warning-text); }
.draft-banner-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* ───── Quick-amount chip strip ───── */
.quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}
.qa-chip {
    position: relative;
    z-index: 1;
    background: var(--bg-surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    -webkit-tap-highlight-color: var(--brand-ring);
    transition: background .1s, border-color .1s, transform .05s, color .1s;
    font-variant-numeric: tabular-nums;
    min-height: 32px;
}
.qa-chip:hover {
    background: var(--brand-bg);
    border-color: var(--brand);
    color: var(--brand-dark);
}
.qa-chip:active { transform: scale(0.94); }
.qa-chip.qa-clear {
    background: var(--bg-surface);
    color: var(--danger);
    border-color: var(--danger-bg);
}
.qa-chip.qa-clear:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* ───── Recently-used / common chips ───── */
.recent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.55rem;
    background: var(--bg-surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}
.recent-chips-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-right: 0.25rem;
}
.recent-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background .1s, border-color .1s, color .1s, transform .05s;
}
.recent-chip:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.recent-chip:active { transform: scale(0.97); }
.recent-chip.is-selected {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 1px 4px var(--brand-ring);
}

/* ───── Tab dot for unsaved drafts + today count badge ───── */
.fast-tab-count {
    position: absolute;
    top: 6px;
    right: 8px;
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    line-height: 1.2;
}
.fast-tab.active .fast-tab-count {
    background: var(--bg-surface);
    color: var(--brand-dark);
}
.fast-tab-dot {
    position: absolute;
    bottom: 6px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--bg-surface);
    animation: dot-pulse 1.4s infinite;
}
@keyframes dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.2); opacity: 0.7; }
}

/* ───── Sticky save bar (mobile only) ───── */
.sticky-save-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1040;
    padding: 0.6rem 0.85rem calc(0.6rem + env(safe-area-inset-bottom));
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 14px rgba(0,0,0,0.08);
}
@media (min-width: 768px) {
    .sticky-save-bar { display: none !important; }
}

@media (max-width: 767.98px) {
    body.has-sticky-save .fast-page { padding-bottom: 84px; }
}

/* ───── Submit overlay ───── */
.submit-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.submit-overlay-card {
    background: var(--bg-surface);
    padding: 1.5rem 2.25rem;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-xl);
    min-width: 180px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ───── Smooth transitions for theme switch ───── */
.app-main,
.kpi-card,
.card,
.chart-card,
.fast-tile,
.fast-panel,
.fast-tab,
.recent-block,
.table,
.form-control,
.form-select,
.btn {
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
