/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a1a;
    background: #f1f5f9;
    /* Default (neutral) accent — used pre-company-selection (login / select). */
    --accent: #4f46e5;
    --accent-600: #4338ca;
    --accent-tint: #eef2ff;
}

/* ── Company theme system ──
   One variable swap re-themes the whole app. Set on <body> from the
   active company slug in layouts/main.php. Presentation only. */
body.theme-ambeat { --accent: #dc2626; --accent-600: #b91c1c; --accent-tint: #fef2f2; }
body.theme-sjbs   { --accent: #7c3aed; --accent-600: #6d28d9; --accent-tint: #f5f3ff; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: #1e293b;
    color: #fff;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}
.navbar-brand-link {
    color: #fff;
    font-weight: 700;
    font-size: 17px;
}
.navbar-brand-link:hover { text-decoration: none; }
.nav-links { display: flex; gap: 4px; }
.nav-link {
    color: #94a3b8;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
}
.nav-link:hover { color: #fff; text-decoration: none; background: #334155; }

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.company-switcher {
    display: flex;
    gap: 8px;
}

.company-link {
    color: #94a3b8;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}
.company-link:hover { color: #fff; text-decoration: none; background: #334155; }
.company-link.active { color: #fff; background: var(--accent); }

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #cbd5e1;
}

.logout-link {
    color: #f87171;
    margin-left: 8px;
}

/* ── Container ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: #374151;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint);
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-600); text-decoration: none; }
.btn-full { width: 100%; }

/* ── Login Page ── */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f1f5f9;
}
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
.login-container h1 {
    text-align: center;
    font-size: 22px;
    color: #1e293b;
    margin-bottom: 4px;
}
.login-container h2 {
    text-align: center;
    font-size: 16px;
    color: #64748b;
    font-weight: 400;
    margin-bottom: 24px;
}

/* ── Error Pages ── */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.error-container {
    text-align: center;
}
.error-container h1 {
    font-size: 72px;
    color: #1e293b;
}
.error-container p {
    color: #64748b;
    margin: 8px 0 24px;
}

/* ── Company Info ── */
.company-info {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}
.company-info h2 {
    font-size: 18px;
    margin-bottom: 4px;
}
.company-info p {
    color: #64748b;
    font-size: 14px;
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
th, td {
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
}
th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e2e8f0;
}
td { border-bottom: 1px solid #f1f5f9; }
tr:last-child td { border-bottom: none; }
.text-right { text-align: right; }

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.page-header h1 { margin: 0; }

/* ── Cards ── */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

/* ── Status Badges ── */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.status-completed { background: #dcfce7; color: #166534; }
.status-processing { background: #fef3c7; color: #92400e; }
.status-failed { background: #fef2f2; color: #991b1b; }
.status-draft { background: #f1f5f9; color: #475569; }
.status-finalized { background: #dbeafe; color: #1e40af; }

/* ── Secondary Button ── */
.btn-secondary { background: #e2e8f0; color: #374151; }
.btn-secondary:hover { background: #cbd5e1; text-decoration: none; }

/* ── Form Helpers ── */
.form-help { display: block; margin-top: 4px; font-size: 13px; color: #64748b; }
.text-muted { color: #64748b; }

/* ── Import Info Box ── */
.import-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}
.import-info h3 { font-size: 14px; margin-bottom: 8px; }
.import-info p { font-size: 13px; margin-bottom: 4px; }

/* ── Detail Grid ── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    font-size: 14px;
}

/* ── Actions ── */
.actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* ── File Input ── */
input[type="file"] {
    padding: 8px;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    cursor: pointer;
}
input[type="file"]:hover { border-color: var(--accent); }

/* ── Form Rows ── */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 150px; }
.form-sm { min-width: 100px !important; flex: 0 1 auto !important; }
.form-sm input, .form-sm select { width: 100%; }

/* ── Search Bar ── */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}
.search-bar input:focus { outline: none; border-color: var(--accent); }

/* ── Invoice Preview ── */
.invoice-preview {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
}
.invoice-header-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}
.invoice-meta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
}
.invoice-meta p { margin-bottom: 4px; }

/* ── Table Footer ── */
tfoot td {
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
}
.total-row td {
    border-top: 2px solid #1e293b;
    font-size: 15px;
}

/* ── Totals Grid ── */
.totals-grid {
    display: flex;
    gap: 32px;
    font-size: 15px;
}

/* ── Link Buttons ── */
.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}
.btn-danger { color: #dc2626; }
.btn-danger:hover { text-decoration: underline; }
button.btn-danger:not(.btn-link) {
    background: #dc2626;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
button.btn-danger:not(.btn-link):hover { background: #b91c1c; }

/* ── Card heading ── */
.card h2 { font-size: 16px; margin-bottom: 16px; color: #1e293b; }
.card h3 { font-size: 15px; margin-bottom: 12px; color: #374151; }

/* ═══════════════════════════════════════════════════════════════
   MODERN DASHBOARD SHELL (sidebar + topbar) — visual refresh only
   ═══════════════════════════════════════════════════════════════ */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid #1e293b;
    min-height: 60px;
}
.sidebar-brand .brand-logo {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
    padding: 3px;
    flex-shrink: 0;
}
.sidebar-brand .brand-name {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.snav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.snav:hover { background: #1e293b; color: #fff; text-decoration: none; }
.snav.active { background: var(--accent); color: #fff; }
.snav svg { width: 19px; height: 19px; flex-shrink: 0; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid #1e293b; font-size: 11px; color: #475569; white-space: nowrap; }

/* Collapsed sidebar (icon rail) */
body.sidebar-collapsed .sidebar { width: 64px; }
body.sidebar-collapsed .sidebar .brand-name,
body.sidebar-collapsed .snav span,
body.sidebar-collapsed .sidebar-foot { display: none; }
body.sidebar-collapsed .snav { justify-content: center; padding: 10px; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 16px 0; }

/* ── Main column ── */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Topbar ── */
.topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.sidebar-toggle {
    background: none; border: none; cursor: pointer;
    width: 38px; height: 38px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #475569;
}
.sidebar-toggle:hover { background: #f1f5f9; }
.active-company {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-tint);
    color: var(--accent-600);
    border-radius: 999px;
    padding: 5px 14px 5px 6px;
    font-weight: 600;
    font-size: 13px;
}
.active-company img { width: 24px; height: 24px; border-radius: 50%; background: #fff; object-fit: contain; padding: 2px; }
.topbar-spacer { flex: 1; }

/* ── Profile dropdown ── */
.profile { position: relative; }
.profile-btn {
    display: flex; align-items: center; gap: 10px;
    background: none; border: none; cursor: pointer;
    padding: 5px 8px; border-radius: 10px;
}
.profile-btn:hover { background: #f1f5f9; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.profile-name { font-size: 14px; font-weight: 600; color: #334155; }
.profile-btn svg { color: #94a3b8; }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 10px);
    width: 268px; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 14px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.14);
    padding: 8px; display: none; z-index: 60;
}
.profile.open .dropdown { display: block; }
.dropdown-header { padding: 10px 12px 12px; }
.dropdown-header strong { display: block; font-size: 14px; color: #0f172a; }
.dropdown-header small { color: #94a3b8; font-size: 12px; }
.dropdown-label { padding: 6px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; font-weight: 700; }
.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 9px;
    color: #334155; font-size: 14px;
}
.dropdown-item:hover { background: #f8fafc; text-decoration: none; }
.dropdown-item.is-active { background: var(--accent-tint); color: var(--accent-600); font-weight: 600; }
.dropdown-item img { width: 22px; height: 22px; border-radius: 5px; background: #fff; object-fit: contain; padding: 1px; border: 1px solid #e2e8f0; }
.dropdown-item .check { margin-left: auto; color: var(--accent); }
.dropdown-item.logout { color: #dc2626; }
.dropdown-divider { height: 1px; background: #f1f5f9; margin: 6px 4px; }

/* ── Content area ── */
.content { padding: 24px; width: 100%; max-width: 1200px; margin: 0 auto; }

/* ═══ Dashboard cards (display only) ═══ */
.dash-hero {
    background: linear-gradient(120deg, var(--accent), var(--accent-600));
    color: #fff; border-radius: 16px; padding: 28px 30px; margin-bottom: 22px;
    display: flex; align-items: center; gap: 20px;
}
.dash-hero img { width: 60px; height: 60px; border-radius: 12px; background: #fff; padding: 6px; object-fit: contain; }
.dash-hero h1 { font-size: 22px; margin: 0 0 4px; }
.dash-hero p { margin: 0; opacity: .9; font-size: 13px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.dash-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 20px; display: flex; flex-direction: column; gap: 10px;
    transition: transform .12s ease, box-shadow .12s ease;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,23,42,.08); text-decoration: none; }
.dash-card .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-tint); color: var(--accent-600); display: flex; align-items: center; justify-content: center; }
.dash-card h3 { margin: 0; font-size: 15px; color: #0f172a; }
.dash-card p { margin: 0; font-size: 13px; color: #64748b; }

/* ═══════════════════════════════════════════════════════════════
   COMPANY SELECT — full-screen diagonal split
   ═══════════════════════════════════════════════════════════════ */
.cs-wrap { position: fixed; inset: 0; overflow: hidden; background: #0f172a; }
.cs-panel {
    position: absolute; top: 0; bottom: 0; width: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; overflow: hidden; transition: filter .25s ease;
}
.cs-panel.left  { clip-path: polygon(0 0, 56% 0, 44% 100%, 0 100%); }
.cs-panel.right { clip-path: polygon(56% 0, 100% 0, 100% 100%, 44% 100%); }
.cs-ambeat {
    background:
        linear-gradient(135deg, rgba(127,29,29,.80) 0%, rgba(220,38,38,.78) 100%),
        url('/assets/img/ambeat-bg.jpg');
    background-size: cover; background-position: center;
}
.cs-sjbs {
    background:
        linear-gradient(135deg, rgba(76,29,149,.80) 0%, rgba(124,58,237,.78) 100%),
        url('/assets/img/sjbs-bg.jpg');
    background-size: cover; background-position: center;
}
.cs-panel::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.18); opacity: 0; transition: opacity .25s ease; }
.cs-ambeat:hover { filter: brightness(1.08); }
.cs-sjbs:hover { filter: brightness(1.08); }
.cs-ambeat:hover::after { opacity: 1; background: rgba(220,38,38,.30); }
.cs-sjbs:hover::after { opacity: 1; background: rgba(124,58,237,.30); }
.cs-inner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; text-align: center; padding: 24px; width: 290px; }
.cs-panel.left .cs-inner  { left: 26%; }
.cs-panel.right .cs-inner { left: 74%; }
.cs-logo { width: 96px; height: 96px; border-radius: 22px; background: #fff; padding: 14px; object-fit: contain; box-shadow: 0 10px 30px rgba(0,0,0,.25); margin-bottom: 22px; }
.cs-inner h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.cs-inner p { opacity: .85; font-size: 13px; margin-bottom: 22px; }
.cs-enter {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.5);
    color: #fff; padding: 10px 22px; border-radius: 999px; font-weight: 600; font-size: 14px;
    transition: background .2s ease;
}
.cs-panel:hover .cs-enter { background: #fff; color: #0f172a; }
.cs-title { position: absolute; top: 26px; left: 0; right: 0; text-align: center; z-index: 5; color: #fff; }
.cs-title .ct-main { font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.cs-title .ct-sub { font-size: 12px; opacity: .7; }

/* ═══════════════════════════════════════════════════════════════
   LOGIN — modern split
   ═══════════════════════════════════════════════════════════════ */
.login-shell { display: flex; min-height: 100vh; }
.login-brand {
    flex: 1; position: relative; overflow: hidden;
    background: linear-gradient(140deg, #0f172a 0%, #312e81 60%, #4f46e5 100%);
    color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center;
}
.login-brand h1 { font-size: 34px; font-weight: 800; margin-bottom: 14px; line-height: 1.15; }
.login-brand p { opacity: .82; max-width: 380px; font-size: 15px; margin-bottom: 36px; }
.login-brand .lb-logos { display: flex; gap: 18px; }
.login-brand .lb-logos img { width: 88px; height: 88px; border-radius: 16px; background: #fff; padding: 12px; object-fit: contain; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.login-formwrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: #f8fafc; }
.login-card {
    width: 100%; max-width: 400px; background: #fff;
    border-radius: 18px; padding: 40px; border: 1px solid #eef2f7;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
.login-card .lc-head { text-align: center; margin-bottom: 26px; }
.login-card .lc-head h2 { font-size: 22px; color: #0f172a; margin-bottom: 6px; }
.login-card .lc-head p { color: #94a3b8; font-size: 14px; }
.login-card .btn-primary { margin-top: 6px; padding: 12px; font-size: 15px; border-radius: 10px; }
.login-card .form-group input { padding: 12px 14px; border-radius: 10px; }

/* ═══ Responsive ═══ */
@media (max-width: 860px) {
    .login-brand { display: none; }
    .cs-panel.left  { clip-path: polygon(0 0, 100% 0, 100% 46%, 0 56%); }
    .cs-panel.right { clip-path: polygon(0 56%, 100% 46%, 100% 100%, 0 100%); }
    .cs-panel.left .cs-inner  { left: 50%; top: 27%; transform: translate(-50%, -50%); }
    .cs-panel.right .cs-inner { left: 50%; top: 73%; transform: translate(-50%, -50%); }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-collapsed .sidebar { width: 240px; }
    body.sidebar-collapsed .sidebar .brand-name, body.sidebar-collapsed .snav span, body.sidebar-collapsed .sidebar-foot { display: revert; }
    .profile-name { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   TABLE UX — containment, sticky header, icon actions, bulk select
   ═══════════════════════════════════════════════════════════════ */
/* Wrapper keeps tables inside the card and adds scroll only when needed.
   Row height / density is unchanged (no padding overrides). */
.table-wrap {
    overflow: auto;
    max-height: calc(100vh - 240px);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}
.table-wrap > table { border: 0; border-radius: 0; }
.table-wrap td, .table-wrap th { white-space: nowrap; }

/* Sticky header row (only the header; data columns are never frozen) */
.table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: inset 0 -2px 0 #e2e8f0;
}

/* Actions column may stay visible while scrolling horizontally */
.col-actions { position: sticky; right: 0; background: #fff; box-shadow: inset 1px 0 0 #e2e8f0; }
.table-wrap thead th.col-actions { background: #f8fafc; z-index: 4; }
.col-check { width: 38px; text-align: center; }
.col-check input { cursor: pointer; width: 15px; height: 15px; }

/* Icon-based row actions */
.act { display: inline-flex; align-items: center; gap: 4px; }
.act a, .act .act-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 7px;
    color: #64748b; background: none; border: none; cursor: pointer; padding: 0;
}
.act a:hover { background: var(--accent-tint); color: var(--accent-600); text-decoration: none; }
.act .act-del:hover { background: #fef2f2; color: #dc2626; }
.act svg { width: 17px; height: 17px; }

/* Bulk action bar */
.bulk-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.btn-bulk-del {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff; color: #dc2626; border: 1px solid #fecaca;
    padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-bulk-del:hover { background: #fef2f2; }
.btn-bulk-del svg { width: 16px; height: 16px; }
.bulk-count { font-size: 13px; color: #64748b; }

/* ═══════════════════════════════════════════════════════════════
   UX REFINEMENT — client detail, nav links, filter banner, pager
   (appended; see plan curried-wadler)
   ═══════════════════════════════════════════════════════════════ */

/* Invoice View renders as a whole document — no inner vertical scroll.
   Horizontal scroll is kept for the wide SJBS line table. */
.table-wrap--doc { max-height: none; }

/* Client detail — billing stat strip */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.stat-value { font-size: 22px; font-weight: 700; color: #0f172a; }

/* "Filtered by client" banner on the invoice list */
.filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--accent-tint, #eef2ff);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 14px;
}
.filter-clear { font-weight: 600; }

/* Record-source line (e.g. "Created from import #N") */
.record-source { color: #64748b; font-size: 13px; margin: -6px 0 16px; }

/* List pager */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
}
.pager-info { font-size: 13px; color: #64748b; }
.btn.is-disabled { opacity: .5; pointer-events: none; cursor: default; }
