:root {
    --impact-burgundy: #8b143a;
    --impact-burgundy-dark: #64102a;
    --impact-navy: #2b1b22;
    --impact-navy-light: #4a303b;
    --impact-gold: #d6a24a;
    --impact-cream: #faf6f7;
    --surface: #ffffff;
    --surface-muted: #faf6f7;
    --text: #261b20;
    --muted: #6f5d65;
    --border: #eadde2;
    --success: #198754;
    --danger: #c62828;
    --warning: #a15c00;
    --shadow: 0 12px 34px rgba(139, 20, 58, 0.10);
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    min-height: 100%;
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--surface-muted);
}

a { color: var(--impact-burgundy); text-decoration: none; }
a:hover { color: var(--impact-burgundy-dark); }

button, input, select, textarea { font: inherit; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--impact-navy) 0%, #2b1b22 100%);
    color: #fff;
    box-shadow: 10px 0 30px rgba(100, 16, 42, 0.16);
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 18px;
    background: rgba(255,255,255,.05);
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-brand img {
    width: 62px;
    height: 42px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
}

.sidebar-brand strong { display: block; font-size: 15px; }
.sidebar-brand small { display: block; color: rgba(255,255,255,.66); margin-top: 3px; }

.sidebar-nav { padding: 18px 12px; overflow-y: auto; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.78);
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    transition: .18s ease;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--impact-burgundy), #d22764);
    box-shadow: 0 8px 20px rgba(180,20,75,.28);
}
.nav-icon { width: 22px; text-align: center; font-size: 18px; }
.nav-section {
    padding: 18px 14px 8px;
    font-size: 11px;
    color: rgba(255,255,255,.44);
    text-transform: uppercase;
    letter-spacing: .11em;
}
.sidebar-footer { margin-top: auto; padding: 18px; color: rgba(255,255,255,.45); }

.main-panel { min-width: 0; flex: 1; margin-left: 260px; display: flex; flex-direction: column; }

.topbar {
    min-height: 82px;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 28px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.menu-toggle {
    display: none;
    border: 0;
    background: var(--surface-muted);
    color: var(--impact-navy);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
}

.topbar-title { min-width: 0; }
.topbar-title h1 { margin: 0; font-size: 23px; color: var(--impact-navy); }
.topbar-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.user-menu { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--impact-burgundy), #d62b69);
    color: #fff; font-weight: 800;
}
.user-meta strong, .user-meta small { display: block; }
.user-meta small { color: var(--muted); margin-top: 2px; }

.content { width: 100%; max-width: 1540px; margin: 0 auto; padding: 28px; flex: 1; }
.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 28px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card + .card { margin-top: 22px; }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fff, #fbfbfd);
}
.card-header h2, .card-header h3 { margin: 0; color: var(--impact-navy); }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid var(--border); background: #fbfbfd; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.kpi-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.kpi-card::after {
    content: "";
    position: absolute;
    width: 120px; height: 120px;
    right: -45px; top: -55px;
    border-radius: 50%;
    background: rgba(180,20,75,.07);
}
.kpi-card .kpi-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi-card .kpi-value { margin-top: 8px; color: var(--impact-navy); font-size: 28px; font-weight: 800; }
.kpi-card .kpi-foot { margin-top: 10px; font-size: 12px; color: var(--muted); }
.kpi-card.accent { border-top: 4px solid var(--impact-burgundy); }
.kpi-card.navy { border-top: 4px solid var(--impact-navy); }
.kpi-card.gold { border-top: 4px solid var(--impact-gold); }
.kpi-card.green { border-top: 4px solid var(--success); }

.grid-two { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; }
.grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th {
    color: var(--impact-navy);
    background: #faf6f7;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
td { font-size: 14px; }
tbody tr:hover { background: #fcfafb; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-burgundy { color: var(--impact-burgundy); }
.nowrap { white-space: nowrap; }

.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}
.toolbar .grow { flex: 1 1 220px; }

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 10px 15px;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--impact-burgundy), #d42665); box-shadow: 0 7px 16px rgba(180,20,75,.18); }
.btn-primary:hover { color: #fff; background: linear-gradient(135deg, var(--impact-burgundy-dark), var(--impact-burgundy)); }
.btn-navy { color: #fff; background: var(--impact-navy); }
.btn-navy:hover { color: #fff; background: var(--impact-navy-light); }
.btn-success { color: #fff; background: var(--success); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-warning { color: #fff; background: var(--warning); }
.btn-light { color: var(--impact-navy); background: #fff; border-color: var(--border); }
.btn-light:hover { color: var(--impact-burgundy); border-color: #d5afbd; }
.btn-small { padding: 7px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

label { display: block; font-weight: 600; color: var(--impact-navy); }
label > span { display: block; margin-bottom: 7px; font-size: 13px; }

input, select, textarea {
    width: 100%;
    border: 1px solid #ced3dd;
    border-radius: 9px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--impact-burgundy);
    box-shadow: 0 0 0 3px rgba(180,20,75,.09);
}
textarea { min-height: 100px; resize: vertical; }
.form-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.help-text { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

.alert {
    margin-bottom: 16px;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
}
.alert-success { background: #e9f7f0; color: #11613d; border-color: #bfe6d1; }
.alert-danger { background: #fff0f0; color: #9c1b1b; border-color: #f0c3c3; }
.alert-warning { background: #fff8e8; color: #805000; border-color: #eed69f; }
.alert-info { background: #faf1f4; color: #64102a; border-color: #e5cbd4; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}
.badge-success { background: #e5f6ed; color: #16683f; }
.badge-danger { background: #fde9e9; color: #a31e1e; }
.badge-warning { background: #fff3d6; color: #825300; }
.badge-navy { background: #f5e9ed; color: var(--impact-navy); }
.badge-muted { background: #faf6f7; color: #5f6672; }

.empty-state {
    padding: 45px 20px;
    text-align: center;
    color: var(--muted);
}
.empty-state strong { display: block; color: var(--impact-navy); font-size: 18px; margin-bottom: 7px; }

.upload-zone {
    border: 2px dashed #d7bac5;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #fff9fb);
    padding: 28px;
    text-align: center;
}
.upload-zone input { max-width: 520px; margin: 15px auto; }
.upload-zone strong { display: block; color: var(--impact-navy); font-size: 18px; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.pagination a, .pagination span {
    min-width: 36px;
    padding: 8px 10px;
    border-radius: 7px;
    border: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
}
.pagination .active { color: #fff; background: var(--impact-burgundy); border-color: var(--impact-burgundy); }

.stat-list { display: grid; gap: 11px; }
.stat-row { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.stat-row:last-child { border-bottom: 0; padding-bottom: 0; }
.stat-row span { color: var(--muted); }
.stat-row strong { color: var(--impact-navy); }

.progress-bar { height: 9px; border-radius: 99px; overflow: hidden; background: #eceef3; }
.progress-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--impact-burgundy), #dc3b72); }

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
    background:
        radial-gradient(circle at 10% 15%, rgba(180,20,75,.13), transparent 32%),
        radial-gradient(circle at 90% 10%, rgba(31,36,84,.14), transparent 30%),
        #f5f6fa;
}
.auth-shell { width: min(960px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.install-shell { width: min(1080px, 100%); }
.auth-brand {
    border-radius: 20px;
    padding: 42px;
    color: #fff;
    background: linear-gradient(145deg, var(--impact-navy), #2b1b22);
    box-shadow: var(--shadow);
}
.auth-brand img { width: 200px; max-width: 100%; background: #fff; border-radius: 12px; padding: 10px; }
.auth-brand h1 { margin: 32px 0 10px; font-size: 34px; }
.auth-brand p { color: rgba(255,255,255,.72); line-height: 1.7; }
.auth-card {
    border-radius: 20px;
    padding: 34px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 18px; color: var(--impact-navy); }
.auth-card label { margin-bottom: 16px; }

.invoice-preview-shell { background: #faf6f7; min-height: 100vh; padding: 20px; }
.invoice-toolbar {
    max-width: 1040px;
    margin: 0 auto 16px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.invoice-paper {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 15mm;
    background: #fff;
    box-shadow: 0 14px 45px rgba(139,20,58,.16);
    color: #261b20;
}
.invoice-head { display: flex; justify-content: space-between; gap: 25px; align-items: flex-start; border-bottom: 4px solid var(--impact-burgundy); padding-bottom: 16px; }
.invoice-head img { width: 185px; }
.invoice-company { text-align: right; }
.invoice-company h1 { margin: 0; color: var(--impact-burgundy-dark); font-size: 20px; text-transform: uppercase; }
.invoice-company p { margin: 5px 0 0; font-size: 12px; color: #6F5D65; }
.invoice-meta-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 18px; margin: 22px 0; }
.invoice-box { border: 1px solid #eadde2; border-radius: 10px; padding: 15px; background: #fbfbfd; }
.invoice-box .label { font-size: 10px; color: var(--impact-burgundy); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.invoice-box strong { display: block; margin-top: 7px; color: var(--impact-burgundy-dark); font-size: 15px; }
.invoice-subject { margin: 18px 0; border-radius: 9px; padding: 12px 16px; color: #fff; background: var(--impact-burgundy-dark); font-weight: 800; text-align: center; letter-spacing: .03em; }
.invoice-table th { color: #fff; background: var(--impact-burgundy); }
.invoice-table td { border-bottom-color: #eadde2; }
.invoice-total-row td { font-size: 17px; font-weight: 800; color: var(--impact-burgundy-dark); background: #f6f2f4; }
.invoice-words { margin-top: 14px; border: 1px solid #eadde2; border-radius: 10px; overflow: hidden; }
.invoice-words .title { padding: 7px 12px; color: #fff; background: var(--impact-burgundy); text-align: center; font-size: 11px; font-weight: 800; }
.invoice-words .content { padding: 13px; text-align: center; font-weight: 700; text-transform: uppercase; line-height: 1.5; }
.invoice-lives { display: flex; justify-content: space-between; padding: 12px 14px; margin-top: 12px; border: 1px solid #eadde2; border-radius: 10px; font-weight: 800; }
.invoice-bottom { display: grid; grid-template-columns: 1.5fr .8fr; gap: 18px; margin-top: 18px; }
.bank-card { border: 1px solid #eadde2; border-radius: 10px; overflow: hidden; }
.bank-card .bank-title { padding: 9px 12px; color: #fff; background: var(--impact-burgundy); font-size: 12px; font-weight: 800; }
.bank-card .bank-content { padding: 13px; line-height: 1.65; font-size: 12px; }
.signature-card { min-height: 160px; border: 1px solid #eadde2; border-radius: 10px; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; padding: 16px; font-weight: 800; }
.invoice-note { margin-top: 16px; color: var(--impact-burgundy); font-size: 11px; font-weight: 700; }
.invoice-footer { margin-top: 22px; padding-top: 10px; border-top: 1px solid #ddd; display: flex; justify-content: space-between; gap: 15px; color: #6f5d65; font-size: 10px; }

.modal-backdrop { display: none; position: fixed; inset: 0; z-index: 25; background: rgba(12,15,35,.5); }
.modal-backdrop.show { display: block; }

@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-two, .grid-equal { grid-template-columns: 1fr; }
    .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-panel { margin-left: 0; }
    .menu-toggle { display: block; }
    .topbar { padding: 12px 16px; }
    .user-meta { display: none; }
    .content { padding: 18px 14px; }
    .app-footer { flex-direction: column; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}

@media (max-width: 600px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .form-grid.two, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
    .card-header { align-items: flex-start; flex-direction: column; }
    .user-menu .btn { padding: 7px 9px; }
    .topbar-title p { display: none; }
}

@media print {
    body { background: #fff; }
    .invoice-preview-shell { padding: 0; background: #fff; }
    .invoice-toolbar { display: none !important; }
    .invoice-paper { width: auto; min-height: auto; margin: 0; padding: 12mm; box-shadow: none; }
    @page { size: A4; margin: 0; }
}


/* Invoice colour policy: Impact Life burgundy, cream, charcoal and grey only. */
.invoice-preview-shell .btn-navy {
    color: #fff;
    background: var(--impact-burgundy-dark);
}
.invoice-preview-shell .btn-navy:hover {
    color: #fff;
    background: var(--impact-burgundy);
}
.invoice-paper,
.invoice-paper h1,
.invoice-paper strong,
.invoice-paper td,
.invoice-paper span {
    border-color: #eadde2;
}

/* =========================================================
   Impact Life professional interface refinements - v1.1.0
   ========================================================= */
html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at 96% 0%, rgba(139, 20, 58, .07), transparent 28rem),
        linear-gradient(180deg, #fbf8f9 0%, #f7f2f4 100%);
}

.sidebar {
    width: 272px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.045), transparent 25%),
        linear-gradient(165deg, #24191e 0%, #431525 58%, #741334 112%);
    box-shadow: 14px 0 36px rgba(58, 17, 34, .18);
}

.main-panel {
    margin-left: 272px;
}

.sidebar-brand {
    padding: 23px 20px;
}

.sidebar-brand img {
    width: 68px;
    height: 46px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,.16);
}

.sidebar-brand strong {
    font-size: 15px;
    letter-spacing: .01em;
}

.sidebar-brand small {
    font-size: 11px;
}

.sidebar-nav {
    padding: 20px 14px;
}

.sidebar-nav a {
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 650;
}

.sidebar-nav a:hover {
    border-color: rgba(255,255,255,.08);
    background: rgba(255,255,255,.075);
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, #9b1745, #c5265d);
    border-color: rgba(255,255,255,.12);
    box-shadow: 0 11px 26px rgba(94, 10, 42, .36);
}

.nav-icon {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 22px;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.topbar {
    min-height: 86px;
    padding: 14px 30px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 25px rgba(70, 31, 47, .055);
}

.topbar-title h1 {
    font-size: 24px;
    letter-spacing: -.02em;
}

.avatar {
    width: 44px;
    height: 44px;
    border: 3px solid #fff;
    box-shadow: 0 5px 14px rgba(139,20,58,.2);
}

.content {
    padding: 30px;
}

.card {
    border-radius: 18px;
    border-color: rgba(218, 196, 204, .78);
    box-shadow: 0 14px 36px rgba(72, 26, 44, .075);
}

.card-header {
    padding: 20px 22px;
    background: linear-gradient(180deg, #fff 0%, #fdfafb 100%);
}

.card-header h2,
.card-header h3 {
    letter-spacing: -.015em;
}

.card-body {
    padding: 22px;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
    padding: 28px 30px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 15%, rgba(255,255,255,.17), transparent 15rem),
        linear-gradient(135deg, #5a102b 0%, #8b143a 58%, #ad1f50 100%);
    box-shadow: 0 18px 42px rgba(100,16,42,.22);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -105px;
    bottom: -165px;
    border: 34px solid rgba(255,255,255,.07);
    border-radius: 50%;
}

.dashboard-hero-copy,
.dashboard-hero-actions {
    position: relative;
    z-index: 1;
}

.dashboard-hero .eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: rgba(255,255,255,.74);
}

.dashboard-hero h2 {
    margin: 0;
    font-size: clamp(25px, 3vw, 36px);
    letter-spacing: -.035em;
}

.dashboard-hero p {
    max-width: 720px;
    margin: 9px 0 0;
    color: rgba(255,255,255,.82);
    line-height: 1.65;
}

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

.btn-white {
    color: var(--impact-burgundy-dark);
    background: #fff;
    border-color: #fff;
    box-shadow: 0 8px 20px rgba(48, 7, 23, .16);
}

.btn-white:hover {
    color: var(--impact-burgundy);
    background: #fff8fa;
}

.btn-hero-outline {
    color: #fff;
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.42);
}

.btn-hero-outline:hover {
    color: #fff;
    background: rgba(255,255,255,.15);
}

.kpi-grid {
    gap: 20px;
}

.kpi-card {
    min-height: 142px;
    padding: 22px;
    border-radius: 18px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(72, 26, 44, .11);
}

.kpi-card::after {
    width: 135px;
    height: 135px;
    background: rgba(139,20,58,.055);
}

.kpi-card .kpi-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.kpi-card .kpi-value {
    margin-top: 11px;
    font-size: clamp(27px, 2.5vw, 34px);
    letter-spacing: -.035em;
}

.kpi-card.accent,
.kpi-card.navy,
.kpi-card.gold,
.kpi-card.green {
    border-top-color: var(--impact-burgundy);
}

.kpi-card.navy { border-top-color: #3b252f; }
.kpi-card.gold { border-top-color: #b88032; }
.kpi-card.green { border-top-color: #7a3a52; }

.table-wrap table {
    background: #fff;
}

th {
    padding-top: 12px;
    padding-bottom: 12px;
    color: #4d2635;
    background: #fbf5f7;
    font-size: 11px;
    letter-spacing: .065em;
}

td {
    padding-top: 14px;
    padding-bottom: 14px;
}

tbody tr {
    transition: background .15s ease;
}

tbody tr:hover {
    background: #fff8fa;
}

.btn {
    min-height: 39px;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 750;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #8b143a, #b91f55);
    box-shadow: 0 8px 18px rgba(139,20,58,.18);
}

.btn-light {
    background: #fff;
    box-shadow: 0 3px 9px rgba(70,31,47,.045);
}

input,
select,
textarea {
    min-height: 44px;
    border-color: #dccbd1;
    border-radius: 10px;
    background: #fffdfd;
}

textarea {
    min-height: 110px;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #cda8b6;
}

.alert {
    border-radius: 12px;
}

.upload-zone {
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 0%, rgba(139,20,58,.06), transparent 18rem),
        linear-gradient(180deg, #fff, #fff9fb);
}

.auth-body {
    background:
        radial-gradient(circle at 8% 12%, rgba(139,20,58,.15), transparent 30%),
        radial-gradient(circle at 92% 0%, rgba(95,26,52,.11), transparent 28%),
        linear-gradient(150deg, #f9f3f5 0%, #f4edef 100%);
}

.auth-shell {
    width: min(1040px, 100%);
    grid-template-columns: 1.08fr .92fr;
    gap: 0;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 28px 75px rgba(72,26,44,.18);
}

.auth-brand,
.auth-card {
    border-radius: 0;
    box-shadow: none;
}

.auth-brand {
    position: relative;
    padding: 48px;
    background:
        radial-gradient(circle at 88% 12%, rgba(255,255,255,.13), transparent 15rem),
        linear-gradient(145deg, #2b1b22 0%, #64102a 62%, #8b143a 125%);
}

.auth-brand::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -150px;
    bottom: -150px;
    border: 35px solid rgba(255,255,255,.055);
    border-radius: 50%;
}

.auth-brand img {
    width: 220px;
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(0,0,0,.2);
}

.auth-kicker {
    display: block;
    margin-top: 34px;
    color: rgba(255,255,255,.66);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.auth-brand h1 {
    margin: 10px 0 12px;
    font-size: 38px;
    letter-spacing: -.04em;
}

.auth-feature-list {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.auth-feature-list span {
    position: relative;
    padding-left: 27px;
    color: rgba(255,255,255,.83);
    font-size: 13px;
}

.auth-feature-list span::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: -1px;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #5b1630;
    background: #fff;
    font-size: 11px;
    font-weight: 900;
}

.auth-card {
    padding: 48px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 0;
}

.auth-card-mark {
    align-self: flex-start;
    margin-bottom: 16px;
    padding: 6px 10px;
    border: 1px solid #ead2db;
    border-radius: 999px;
    color: var(--impact-burgundy);
    background: #fff7fa;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.auth-card h2 {
    margin-bottom: 7px;
    font-size: 30px;
    letter-spacing: -.03em;
}

.auth-security-note {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
}

.invoice-preview-shell {
    overflow-x: auto;
    background:
        radial-gradient(circle at 90% 0%, rgba(139,20,58,.07), transparent 26rem),
        #f8f2f4;
}

.invoice-toolbar {
    border: 1px solid #eadde2;
    border-radius: 14px;
}

.invoice-paper {
    position: relative;
    overflow: hidden;
    border: 1px solid #eadde2;
    box-shadow: 0 20px 55px rgba(94,24,51,.16);
}

.invoice-head {
    border-bottom-width: 5px;
}

.invoice-box,
.invoice-subject,
.invoice-words,
.invoice-lives,
.bank-card,
.signature-card {
    border-radius: 8px;
}

.signature-card {
    position: relative;
    min-height: 160px;
    justify-content: flex-start;
    padding: 13px 14px 14px;
    background: linear-gradient(180deg, #fffcfd, #fff);
}

.signature-approval-label {
    color: var(--impact-burgundy);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.invoice-stamp {
    display: block;
    width: 100%;
    max-width: 190px;
    max-height: 86px;
    object-fit: contain;
    margin: 8px auto 5px;
}

.signature-line {
    width: 100%;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #8f7781;
    color: var(--impact-burgundy-dark);
    font-size: 11px;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .sidebar {
        width: 272px;
    }

    .main-panel {
        margin-left: 0;
    }

    .content {
        padding: 20px 15px;
    }

    .dashboard-hero {
        padding: 24px 22px;
    }

    .auth-shell {
        border-radius: 20px;
    }

    .auth-card {
        padding: 38px 28px;
    }
}

@media (max-width: 600px) {
    .topbar {
        min-height: 72px;
        padding: 11px 14px;
    }

    .topbar-title h1 {
        font-size: 20px;
    }

    .dashboard-hero h2 {
        font-size: 27px;
    }

    .dashboard-hero-actions,
    .dashboard-hero-actions .btn {
        width: 100%;
    }

    .invoice-toolbar {
        min-width: 760px;
    }

    .invoice-paper {
        min-width: 210mm;
    }
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .invoice-paper {
        border: 0;
    }

    .invoice-stamp {
        max-height: 82px;
    }
}
