:root {
    --ink: #1c2430;
    --ink-soft: #5a6472;
    --paper: #fbfaf7;
    --card: #ffffff;
    --line: #e4e1d8;
    --accent: #033E8C;
    --accent-dark: #022c63;
    --accent-soft: #e7edf7;
    --brand-orange: #FF751F;
    --brand-green: #00BF63;
    --brand-teal: #66C8D7;
    --warn: #b3541e;
    --danger: #a4302b;
    --radius: 10px;
    font-size: 16px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- Sidebar layout ---------------- */
body.has-sidebar {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--accent-dark);
    color: #fff;
    min-height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}
.sidebar .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: .3px;
    padding: 0 20px 18px;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 16px;
}
.sidebar .brand:hover { text-decoration: none; opacity: .9; }

.sidebar-company { padding: 0 20px 18px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 12px; }
.active-company { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.active-company-logo { height: 26px; width: 26px; object-fit: contain; border-radius: 5px; background: #fff; flex-shrink: 0; }
.active-company-logo.placeholder { display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.active-company-name { font-size: .88rem; font-weight: 600; line-height: 1.3; }
.switch-link { color: #cfe8e0; font-size: .8rem; }
.switch-link:hover { color: #fff; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; flex-grow: 1; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e7ede9;
    font-size: .92rem;
    padding: 10px 12px;
    border-radius: 7px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.nav-icon { font-size: 1rem; width: 18px; text-align: center; }

.sidebar-footer { padding: 16px 20px 0; border-top: 1px solid rgba(255,255,255,.12); margin-top: 12px; }
.sidebar-user { font-size: .85rem; color: #cfe8e0; margin-bottom: 4px; }

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 50;
    background: var(--accent-dark);
    color: #fff;
    border: none;
    border-radius: 7px;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    cursor: pointer;
}

@media (max-width: 860px) {
    .sidebar-toggle { display: block; }
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
        z-index: 40;
        box-shadow: 2px 0 12px rgba(0,0,0,.2);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.has-sidebar { display: block; }
    .topbar { padding-left: 60px; }
}

/* ---------------- Content column (topbar + page content) ---------------- */
.content-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* ---------------- Top bar ---------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px;
}
.topbar-title { font-weight: 700; font-size: 1rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--line);
    font-size: .82rem;
    color: var(--ink-soft);
}
.breadcrumb-bar a { color: var(--accent-dark); font-weight: 600; }
.breadcrumb-sep { color: var(--ink-soft); }
.breadcrumb-current { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .breadcrumb-bar { padding: 8px 14px; } }

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    color: #e7ede9;
    font-size: .92rem;
    padding: 10px 12px;
    border-radius: 7px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.nav-group-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-group-label { flex: 1; }
.nav-caret { font-size: .7rem; transition: transform .15s ease; }
.nav-group.expanded .nav-caret { transform: rotate(180deg); }
.nav-submenu { display: none; flex-direction: column; padding-left: 30px; gap: 1px; }
.nav-group.expanded .nav-submenu { display: flex; }
.nav-submenu a { padding: 7px 12px; font-size: .85rem; color: #d7e3de; border-radius: 6px; }
.nav-submenu a:hover, .nav-submenu a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

.icon-btn {
    position: relative;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:hover { background: var(--accent-soft); }
.badge-dot {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 20px;
    min-width: 16px;
    text-align: center;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 5px 12px 5px 5px;
    cursor: pointer;
    font-family: inherit;
    color: var(--ink);
}
.user-chip:hover { background: var(--accent-soft); }
.user-chip-name { font-size: .88rem; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { font-size: .7rem; color: var(--ink-soft); }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-initials { display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 800; }

.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(20,20,10,.12);
    min-width: 200px;
    padding: 6px;
    z-index: 60;
}
.dropdown-menu-wide { min-width: 300px; max-width: 92vw; max-height: 70vh; overflow-y: auto; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 700; padding: 6px 10px; }
.dropdown-item {
    display: block;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: .88rem;
    color: var(--ink);
}
.dropdown-item:hover { background: var(--accent-soft); text-decoration: none; }
.dropdown-empty { padding: 14px 10px; color: var(--ink-soft); font-size: .85rem; }
.notif-overdue { color: var(--danger); }
.notif-unpaid { color: var(--warn); }
.notif-hold { color: #7a2e6b; }
.notif-draft { color: var(--ink-soft); }

@media (max-width: 860px) {
    .user-chip-name { display: none; }
    .user-chip { padding: 5px; border-radius: 50%; border: none; }
}
@media (max-width: 480px) {
    .topbar { padding: 10px 14px 10px 60px; }
}

.page-wrap { flex: 1 1 auto; min-width: 0; max-width: 1180px; width: 100%; margin: 0 auto; padding: 24px clamp(16px, 4vw, 32px); }
.app-footer { text-align: center; color: var(--ink-soft); font-size: .82rem; padding: 24px; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: .92rem; }
.alert-success { background: #e5f4ea; color: #1f6a3b; border: 1px solid #bfe4cb; }
.alert-error { background: #fbe9e7; color: var(--danger); border: 1px solid #f0c4bd; }
.trial-banner { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #c7d5ec; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.trial-banner .btn-sm { flex-shrink: 0; }
.trial-note { max-width: 560px; margin: 0 auto 30px; background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #c7d5ec; border-radius: var(--radius); padding: 12px 18px; font-size: .92rem; }
.trial-note-icon { margin-right: 6px; }

h1, h2, h3 { color: var(--ink); font-weight: 700; }
h1 { font-size: 1.6rem; margin: 0 0 18px; }
h2 { font-size: 1.25rem; }
.subtitle { color: var(--ink-soft); margin-top: -12px; margin-bottom: 20px; font-size: .95rem; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(20,20,10,.04);
}

.pdf-tool-card { display: block; text-decoration: none; color: inherit; transition: box-shadow .15s ease, transform .15s ease; }
.pdf-tool-card:hover { box-shadow: 0 8px 22px rgba(28,36,48,.12); transform: translateY(-2px); text-decoration: none; }
.pdf-tool-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.pdf-tool-card h3 { margin: 0 0 6px; }

.pdf-file-list { list-style: none; margin: 12px 0 18px; padding: 0; }
.pdf-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--card);
    cursor: grab;
}
.pdf-file-row.dragging { opacity: .4; }
.pdf-file-row .drag-handle { color: var(--ink-soft); font-size: 1.1rem; }
.pdf-file-row .pdf-file-name { flex: 1 1 auto; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-file-row .pdf-file-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; padding: 2px 6px; }
.pdf-file-row .pdf-file-remove:hover { background: #fbe9e7; border-radius: 4px; }

.pdf-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-top: 16px; }
.pdf-page-tile {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    padding: 8px;
    cursor: grab;
    text-align: center;
    user-select: none;
}
.pdf-page-tile.dragging { opacity: .35; }
.pdf-page-tile img { width: 100%; height: 230px; object-fit: contain; border-radius: 4px; background: #f4f2ea; display: block; }
.pdf-page-placeholder { width: 100%; height: 230px; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; background: #f4f2ea; border-radius: 4px; }
.pdf-page-num { font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }
.pdf-page-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(28,36,48,.75);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: .78rem;
    line-height: 1;
}
.pdf-page-remove:hover { background: var(--danger); }
.pdf-stored-actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.pdf-stored-delete { background: none; border: none; color: var(--danger); cursor: pointer; font-size: .9rem; padding: 0; text-decoration: underline; }
.pdf-stored-delete:hover { color: #7a2019; }

.pdf-sign-preview { position: relative; display: inline-block; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 10px; background: #f4f2ea; }
.pdf-sign-preview img, .pdf-sign-preview canvas { display: block; max-width: 100%; height: auto; }
.pdf-sig-overlay {
    position: absolute;
    cursor: grab;
    border: 2px dashed var(--accent);
    background: rgba(255,255,255,.55);
    touch-action: none;
    user-select: none;
}
.pdf-sig-overlay:active { cursor: grabbing; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

label { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=number], input[type=date],
input[type=password], input[type=tel], input[type=url], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: .95rem;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
}
textarea { resize: vertical; }
.field { margin-bottom: 14px; }
.field-inline { display: flex; align-items: center; gap: 8px; }
.help-text { color: var(--ink-soft); font-size: .78rem; margin-top: 3px; }

.field-hint { font-size: .78rem; margin-top: 4px; min-height: 1em; }
.field-hint-checking { color: var(--ink-soft); }
.field-hint-good { color: #1f6a3b; font-weight: 600; }
.field-hint-bad { color: var(--danger); font-weight: 600; }

.pw-strength { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pw-strength-bar { flex: 1 1 auto; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.pw-strength-bar span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .2s ease, background-color .2s ease; }
.pw-strength-label { font-size: .76rem; font-weight: 700; min-width: 58px; text-align: right; }

.pw-checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.pw-checklist li { font-size: .76rem; color: var(--ink-soft); padding-left: 18px; position: relative; }
.pw-checklist li::before { content: "○"; position: absolute; left: 0; color: var(--line); font-size: .7rem; top: 2px; }
.pw-checklist li.pw-rule-met { color: #1f6a3b; }
.pw-checklist li.pw-rule-met::before { content: "✓"; color: #1f6a3b; font-weight: 700; }

.pw-field { position: relative; }
.pw-field input { padding-right: 42px; width: 100%; }
.pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 6px 8px;
    line-height: 1;
    color: var(--ink-soft);
    border-radius: 6px;
}
.pw-toggle:hover { background: var(--accent-soft); }

.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 7px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #7f231f; }
.btn-sm { padding: 5px 12px; font-size: .82rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.table-wrap table { min-width: 620px; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: .9rem; }
table th { color: var(--ink-soft); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table tr:hover td { background: #faf9f5; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge-quotation { background: #eaf1fb; color: #2255a4; }
.badge-invoice { background: #fdeee0; color: var(--warn); }
.badge-delivery_note { background: #eef0ea; color: #556b2f; }
.badge-receipt { background: #e5f4ea; color: #1f6a3b; }
.badge-credit_note { background: #f4e5f2; color: #7a2e6b; }

.badge-on_hold { background: #f4e5f2; color: #7a2e6b; }
.badge-draft { background: #eee; color: #666; }
.badge-sent { background: #eaf1fb; color: #2255a4; }
.badge-approved { background: #e0f0ff; color: #145f9c; }
.badge-paid { background: #e5f4ea; color: #1f6a3b; }
.badge-partially_paid { background: #fdf2df; color: var(--warn); }
.badge-void { background: #fbe9e7; color: var(--danger); }

.company-card { display: flex; justify-content: space-between; align-items: center; }
.company-card-info { display: flex; align-items: center; gap: 14px; }
.company-logo-sm { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; }

.doc-type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
@media (max-width: 900px) { .doc-type-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .doc-type-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card { display: block; padding: 18px; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--accent-dark); }
.stat-label { font-size: .82rem; color: var(--ink-soft); margin-top: 2px; }
.stat-danger .stat-num { color: var(--danger); }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.template-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--card); }
.template-card.active { border-color: var(--accent); background: var(--accent-soft); }
.template-swatch { height: 70px; border-radius: 7px; margin-bottom: 10px; }
.tpl-swatch-1 { background: linear-gradient(135deg,#1f5c4f,#2c7d6a); }
.tpl-swatch-2 { background: linear-gradient(135deg,#435361,#647889); }
.tpl-swatch-3 { background: linear-gradient(135deg,#16324f,#204a75); }
.tpl-swatch-4 { background: linear-gradient(135deg,#b3541e,#d98324); }
.tpl-swatch-5 { background: linear-gradient(135deg,#222,#555); }
.tpl-swatch-6 { background: linear-gradient(135deg,#7a1f2b,#a13040); }
.tpl-swatch-7 { background: linear-gradient(135deg,#0f9b8e,#28c4b5); }
.tpl-swatch-8 { background: linear-gradient(135deg,#3a6ea5,#5b8cc4); }
.tpl-swatch-9 { background: linear-gradient(135deg,#ff7e5f,#feb47b); }
.tpl-swatch-10 { background: linear-gradient(135deg,#5b2a86,#7d47ac); }
.template-card h3 { margin: 0 0 4px; font-size: 1rem; }
.template-card p { margin: 0 0 12px; font-size: .82rem; color: var(--ink-soft); }
.doc-type-tile {
    display: block;
    text-align: center;
    padding: 22px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--card);
    font-weight: 700;
    color: var(--ink);
}
.doc-type-tile:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.doc-type-tile .icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }

.pesapal-feedback-dialog {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 560px;
    width: 90vw;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.pesapal-feedback-dialog::backdrop { background: rgba(28,36,48,.55); }
.pesapal-feedback-dialog h3 { margin-top: 0; }
.pesapal-feedback-json {
    background: #f4f2ea;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    font-size: .8rem;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.items-table input, .items-table select { padding: 6px 8px; font-size: .88rem; }
.items-table td { vertical-align: top; }
.remove-row { color: var(--danger); cursor: pointer; font-weight: 700; border: none; background: none; font-size: 1.1rem; }

.pdf-preview-modal {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    width: 90vw;
    max-width: 1080px;
    max-height: 90vh;
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
    flex-direction: column;
}
.pdf-preview-modal:not([open]) { display: none; }
.pdf-preview-modal[open] { display: flex; }
.pdf-preview-modal::backdrop { background: rgba(28,36,48,.65); }
.pdf-preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.pdf-preview-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--ink-soft);
    padding: 4px 8px;
    border-radius: 6px;
}
.pdf-preview-modal-close:hover { background: var(--accent-soft); }
.pdf-preview-modal-body {
    flex: 1 1 auto;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: #f4f2ea;
}
.pdf-preview-modal-body canvas { max-width: 100%; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.pdf-preview-modal-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
    justify-content: center;
}

.sigpad-wrap { border: 1px dashed var(--line); border-radius: 8px; background: #fff; display: inline-block; }
#sigpad { touch-action: none; cursor: crosshair; display: block; }
.sig-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.sig-tabs button { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: .85rem; }
.sig-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sig-pane { display: none; }
.sig-pane.active { display: block; }

.totals-box { max-width: 320px; margin-left: auto; }
.totals-box .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .92rem; }
.totals-box .row.total { border-top: 2px solid var(--ink); font-weight: 800; font-size: 1.1rem; padding-top: 10px; margin-top: 6px; }

.or-divider { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: .8rem; margin: 18px 0; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.login-wrap { max-width: 400px; margin: 60px auto; }
.login-wrap .card { }
.center-text { text-align: center; }

.auth-card { display: flex; max-width: 900px; margin: 40px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 12px 30px rgba(28,36,48,.08); }
.auth-visual { flex: 1 1 44%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 30px; background: var(--accent-dark); }
.auth-visual img { max-width: 260px; width: 100%; height: auto; }
.auth-visual-text { color: #fff; text-align: center; max-width: 320px; }
.auth-visual-text h2 { color: #fff; margin: 0 0 8px; font-size: 1.15rem; }
.auth-visual-text p { margin: 0; opacity: .85; font-size: .88rem; }
.auth-panel { flex: 1 1 56%; padding: 40px 36px; }
.auth-panel .login-wrap { margin: 0; max-width: none; }
@media (max-width: 760px) {
    .auth-card { flex-direction: column; margin: 16px auto; box-shadow: none; border: none; }
    .auth-visual { display: none; }
    .auth-panel { padding: 0; }
}

.share-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.share-links a, .share-links button { font-size: .85rem; }

/* ---------------- Email verification blur overlay ---------------- */
body.verify-pending .sidebar,
body.verify-pending .topbar,
body.verify-pending .breadcrumb-bar,
body.verify-pending .verify-blur {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}
.otp-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(28, 36, 48, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.otp-modal {
    background: var(--card);
    border-radius: var(--radius);
    padding: 34px 30px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    text-align: center;
}
.otp-modal .otp-icon { font-size: 2.4rem; margin-bottom: 6px; }
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 20px 0 6px; }
.otp-inputs input {
    width: 46px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
}
.otp-inputs input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.otp-timer { font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }

@media print {
    .sidebar, .sidebar-toggle, .app-footer, .no-print { display: none !important; }
    body { background: #fff; display: block; }
    .page-wrap { max-width: none; padding: 0; }
}
