/* ===========================================================
   Quotation Manager — "Ledger" theme
   Paper-white surfaces, deep ink navy, brass accent.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --bg:        #F5F4F0;
    --surface:   #FFFFFF;
    --ink:       #1B2333;
    --ink-soft:  #5C6472;
    --ink-faint: #9AA1AC;
    --accent:    #9C6B30;
    --accent-dark: #7C5424;
    --accent-soft: #F1E6D6;
    --border:    #E4E1D9;
    --border-soft: #EDEBE4;
    --danger:    #B3402A;
    --danger-soft: #F7E4DE;
    --success:   #2F6B4F;
    --success-soft: #E3EEE7;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(27,35,51,0.04), 0 6px 20px rgba(27,35,51,0.05);
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

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

.mobile-topbar,
.sidebar-backdrop {
    display: none !important;
}

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--ink);
    color: #EDEEF0;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar .brand {
    padding: 0 22px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 18px;
}
.sidebar .brand .mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 10px;
}
.sidebar .brand .name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
}
.sidebar .brand .tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

.nav { list-style: none; margin: 0; padding: 0 12px; flex: 1; }
.nav li { margin-bottom: 2px; }
.nav .nav-section {
    margin: 16px 10px 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.36);
}
.nav .nav-section:first-child { margin-top: 0; }
.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.72);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav .icon { width: 16px; text-align: center; opacity: 0.9; font-family: var(--font-mono); font-size: 12px; }

.sidebar .foot {
    padding: 14px 22px 4px;
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 32px 40px 60px;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 26px;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar .titles h1 { font-size: 24px; }
.topbar .titles p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13.5px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .12s ease;
    line-height: 1;
}
.btn:hover { border-color: var(--ink-faint); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--border-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Cards / surfaces ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card .card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card .card-header h2 { font-size: 16px; }
.card .card-body {
    padding: 22px;
    overflow-x: auto;
}

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
    body.menu-open { overflow: hidden; }

    .app {
        display: block;
        min-height: 100vh;
        padding-top: 64px;
    }

    .mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 90;
        height: 64px;
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        background: var(--ink);
        color: #fff;
        box-shadow: 0 1px 0 rgba(255,255,255,0.08), 0 8px 24px rgba(27,35,51,0.16);
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        border: 1px solid rgba(255,255,255,0.14);
        border-radius: var(--radius-sm);
        background: rgba(255,255,255,0.06);
        cursor: pointer;
        flex-shrink: 0;
    }

    .menu-toggle span {
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: #fff;
    }

    .mobile-brand {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-brand .mark {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: var(--accent);
        color: #fff;
        font-family: var(--font-display);
        font-weight: 700;
        flex-shrink: 0;
    }

    .mobile-brand .name {
        font-family: var(--font-display);
        font-size: 16px;
        font-weight: 600;
        line-height: 1.1;
        white-space: nowrap;
    }

    .mobile-brand .tag {
        max-width: calc(100vw - 120px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-family: var(--font-mono);
        font-size: 10px;
        color: rgba(255,255,255,0.52);
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 110;
        width: min(84vw, 310px);
        max-width: 310px;
        height: 100dvh;
        padding-top: 22px;
        transform: translateX(-100%);
        transition: transform .18s ease;
        box-shadow: 18px 0 48px rgba(0,0,0,0.26);
        overflow-y: auto;
    }

    body.menu-open .sidebar { transform: translateX(0); }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 100;
        display: block !important;
        pointer-events: none;
        opacity: 0;
        background: rgba(11,16,24,0.48);
        transition: opacity .18s ease;
    }

    body.menu-open .sidebar-backdrop {
        pointer-events: auto;
        opacity: 1;
    }

    .main {
        width: 100%;
        padding: 22px 14px 42px;
    }

    .topbar {
        align-items: stretch;
        margin-bottom: 18px;
    }

    .topbar .titles,
    .topbar .actions {
        width: 100%;
    }

    .topbar .titles h1 {
        font-size: 22px;
        line-height: 1.15;
    }

    .topbar .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .topbar .actions .btn {
        justify-content: center;
        flex: 1 1 auto;
    }

    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .card { border-radius: 8px; }

    .card .card-header {
        padding: 15px 16px;
        align-items: stretch;
        flex-direction: column;
    }

    .card .card-header form {
        width: 100%;
        flex-wrap: wrap;
    }

    .card .card-header form input,
    .card .card-header form select,
    .card .card-header form .btn {
        max-width: none !important;
        width: 100% !important;
    }

    .card .card-body { padding: 16px; }

    table { min-width: 680px; }

    .doc-shell { max-width: none; }

    .doc-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .doc-toolbar > div { flex-wrap: wrap; }

    .doc-paper {
        padding: 24px 18px;
        overflow-x: auto;
    }

    .doc-head,
    .doc-parties {
        flex-direction: column;
        gap: 16px;
    }

    .doc-head .doc-title { text-align: left; }

    .doc-totals,
    .totals-box {
        width: 100%;
    }

    .btn {
        min-height: 40px;
    }
}

/* ---------- Stat tiles ---------- */
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.stat .eyebrow { margin-bottom: 8px; }
.stat .value { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--ink); }
.stat .sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Forms ---------- */
label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.field { margin-bottom: 16px; }
.field-hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=password], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #FDFCFA;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #fff;
}
textarea { resize: vertical; min-height: 80px; font-family: var(--font-body); }

.checkbox-row { display: flex; align-items: center; gap: 10px; }
.switch {
    position: relative;
    width: 42px; height: 24px;
    flex-shrink: 0;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch .track {
    position: absolute; inset: 0;
    background: #D9D5C9;
    border-radius: 999px;
    transition: background .15s ease;
}
.switch .thumb {
    position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform .15s ease;
}
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .thumb { transform: translateX(18px); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 13.5px; }
thead th {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border-soft); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #FBFAF7; }
td.num, th.num { text-align: right; font-family: var(--font-mono); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}
.badge-draft { background: var(--border-soft); color: var(--ink-soft); }
.badge-sent { background: #E4EAF4; color: #2C4B85; }
.badge-accepted { background: var(--success-soft); color: var(--success); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-soft);
}
.empty-state .glyph {
    font-family: var(--font-display);
    font-size: 34px;
    color: var(--ink-faint);
    margin-bottom: 10px;
}
.empty-state h3 { margin-bottom: 6px; }

/* ---------- Flash messages ---------- */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
}
.flash-success { background: var(--success-soft); color: var(--success); border-color: #C9E0D2; }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: #EAC7BC; }

/* ---------- Login ---------- */
.login-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(27,35,51,0.92), rgba(27,35,51,0.82)),
        var(--bg);
}
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 18px 60px rgba(0,0,0,0.22);
    padding: 28px;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}
.login-brand .mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}
.login-brand h1 { font-size: 26px; }
.login-brand p {
    margin: 2px 0 0;
    color: var(--ink-soft);
    font-size: 13.5px;
}
.login-submit {
    justify-content: center;
    margin-top: 4px;
}

.account-card {
    max-width: 520px;
}

/* ---------- Quotation builder ---------- */
.item-row { position: relative; }
.item-row td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.autocomplete-wrap { position: relative; }
.autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    max-height: 240px;
    overflow-y: auto;
    z-index: 40;
    display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-list.autocomplete-portal {
    position: fixed;
    right: auto;
    z-index: 1000;
}
.autocomplete-item {
    padding: 9px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-soft);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--accent-soft); }
.autocomplete-item .name { color: var(--ink); }
.autocomplete-item .price { font-family: var(--font-mono); color: var(--ink-soft); white-space: nowrap; }
.autocomplete-item-stack {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
}
.autocomplete-item .meta {
    color: var(--ink-soft);
    font-size: 12px;
}
.autocomplete-empty { padding: 12px; font-size: 13px; color: var(--ink-faint); }

.totals-box {
    width: 320px;
    margin-left: auto;
    margin-top: 18px;
}
.totals-box .row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13.5px;
    color: var(--ink-soft);
}
.totals-box .row.grand {
    border-top: 2px solid var(--ink);
    margin-top: 6px;
    padding-top: 12px;
    font-size: 18px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
}
.totals-box input[type=number] { width: 110px; text-align: right; padding: 6px 8px; }

.remove-row { color: var(--danger); cursor: pointer; font-size: 16px; line-height: 1; background: none; border: none; padding: 4px; }
.remove-row:hover { opacity: 0.7; }

/* ---------- Quotation print preview ---------- */
.doc-shell { max-width: 820px; margin: 0 auto; }
.doc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.doc-paper {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 52px 56px;
}
.doc-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 26px;
    border-bottom: 3px solid var(--ink);
    margin-bottom: 26px;
}
.doc-head .biz-name { font-size: 22px; font-family: var(--font-display); font-weight: 700; }
.doc-head .biz-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.6; }
.doc-head .doc-title { text-align: right; }
.doc-head .doc-title .label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}
.doc-head .doc-title .qno { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-top: 4px; }
.doc-head .doc-title .dates { font-size: 12px; color: var(--ink-soft); margin-top: 8px; line-height: 1.7; }

.doc-parties { display: flex; justify-content: space-between; margin-bottom: 28px; gap: 30px; }
.doc-parties .block .eyebrow { margin-bottom: 8px; }
.doc-parties .block .who { font-weight: 600; font-size: 14.5px; margin-bottom: 3px; }
.doc-parties .block p { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; }

.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.doc-table thead th {
    background: var(--ink);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 10px 14px;
    font-weight: 500;
}
.doc-table thead th:first-child { border-radius: 4px 0 0 0; }
.doc-table thead th:last-child { border-radius: 0 4px 0 0; }
.doc-table tbody td { padding: 11px 14px; font-size: 13.5px; border-bottom: 1px solid var(--border-soft); }
.doc-table tbody tr:nth-child(even) { background: #FBFAF7; }
.doc-table td.num, .doc-table th.num { text-align: right; font-family: var(--font-mono); }

.doc-totals { width: 280px; margin-left: auto; margin-top: 14px; }
.doc-totals .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; color: var(--ink-soft); }
.doc-totals .row.grand {
    border-top: 2px solid var(--ink);
    margin-top: 4px; padding-top: 12px;
    font-size: 19px; font-family: var(--font-display); font-weight: 700; color: var(--ink);
}

.doc-notes { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.doc-notes .eyebrow { margin-bottom: 8px; }
.doc-notes p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.8; white-space: pre-line; margin: 0; }

.doc-foot {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
    font-size: 11px;
    color: var(--ink-faint);
    text-align: center;
    font-family: var(--font-mono);
}

/* ---------- Print ---------- */
@media print {
    @page { size: A4; margin: 10mm; }
    .sidebar, .mobile-topbar, .sidebar-backdrop, .topbar .actions, .doc-toolbar, .no-print { display: none !important; }
    .flash { display: none !important; }
    html, body, .app, .main { display: block; width: 100%; min-width: 0; margin: 0; padding: 0; background: #fff; }
    .doc-shell { width: 100%; max-width: none; margin: 0; }
    .doc-paper { width: 100%; max-width: none; margin: 0; box-shadow: none; padding: 0; }
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Inventory filters and pagination ---------- */
.inventory-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inventory-filters input,
.inventory-filters select { width: auto; min-width: 110px; }
.inventory-filters input[name="q"] { width: 220px; }
.inventory-filters input[type="number"] { width: 115px; }
.inventory-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border-soft); }
.inventory-count { color: var(--ink-soft); font-size: 12px; }
.pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
@media (max-width: 700px) {
    .inventory-filters { width: 100%; }
    .inventory-filters input[name="q"] { width: 100%; }
    .inventory-filters input,
    .inventory-filters select { flex: 1 1 120px; }
    .inventory-pagination { align-items: flex-start; flex-direction: column; }
}

/* ---------- Misc ---------- */
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.helper-inline { display: flex; gap: 10px; align-items: center; }
.pill-input { display: flex; align-items: center; gap: 8px; }
.w-100 { width: 100%; }

/* ---------- Bordered quotation document ---------- */
.quote-paper { padding: 0; overflow: hidden; border-radius: 3px; color: #202733; }
.quote-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid #cfd5dd;
}
.quote-banner-title { color: #2864c8; font-size: 22px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.quote-banner-copy { color: #647080; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.quote-info-grid { display: grid; grid-template-columns: 1.25fr 1fr; }
.quote-info { min-width: 0; padding: 20px 24px; font-size: 12px; color: #586271; line-height: 1.65; }
.business-info { border-right: 1px solid #cfd5dd; }
.quote-business-name { color: #202733; font-size: 18px; font-weight: 750; margin-bottom: 5px; }
.quote-meta { display: grid; grid-template-columns: 1fr 1fr; padding: 0; }
.quote-meta > div { display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: 12px 16px; border-bottom: 1px solid #cfd5dd; border-right: 1px solid #cfd5dd; }
.quote-meta > div:nth-child(2n) { border-right: 0; }
.quote-meta > div:last-child { border-bottom: 0; }
.quote-meta span { font-size: 11px; color: #697382; }
.quote-meta strong { color: #202733; font-size: 13px; }
.quote-customer { padding: 16px 24px 18px; border-top: 1px solid #cfd5dd; border-bottom: 1px solid #cfd5dd; min-height: 110px; }
.quote-section-label { color: #343e4c; font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.quote-customer-name { font-size: 15px; font-weight: 750; color: #202733; }
.quote-customer-details { display: grid; gap: 2px; margin-top: 4px; color: #657080; font-size: 12px; line-height: 1.5; }
.quote-customer-details strong { color: #485363; font-weight: 650; }
.quote-table { margin: 0; table-layout: fixed; }
.quote-table thead th { background: #f1f4f8; color: #303a48; border: 1px solid #cfd5dd; border-top: 0; padding: 10px 9px; font-family: inherit; font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 750; }
.quote-table thead th:first-child, .quote-table thead th:last-child { border-radius: 0; }
.quote-table tbody td { border: 1px solid #d9dee5; padding: 10px 9px; font-size: 12px; }
.quote-table tbody tr:nth-child(even) { background: #fff; }
.quote-table .quote-index { width: 36px; text-align: center; }
.quote-table th:nth-child(2) { width: 34%; }
.quote-table th:nth-child(3) { width: 10%; }
.quote-table th:nth-child(4) { width: 11%; }
.quote-table th:nth-child(5), .quote-table th:nth-child(6) { width: 18%; }
.quote-table .quote-item-name { font-weight: 650; color: #202733; }
.quote-bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 40%); border-bottom: 1px solid #cfd5dd; }
.quote-extra { padding: 16px 20px; }
.quote-note + .quote-note { margin-top: 16px; }
.quote-note p { margin: 0; color: #657080; font-size: 12px; line-height: 1.6; white-space: pre-line; }
.quote-totals { padding: 10px 18px; border-left: 1px solid #cfd5dd; }
.quote-totals .row { display: flex; justify-content: space-between; gap: 15px; padding: 7px 0; color: #4f5968; font-size: 12px; }
.quote-totals .row.grand { border-top: 1px solid #aeb7c3; margin-top: 5px; padding-top: 12px; color: #202733; font-size: 16px; font-weight: 800; }
.quote-signoff { display: flex; flex-direction: column; align-items: flex-end; gap: 30px; padding: 18px 24px; color: #303a48; font-size: 12px; }
.quote-signoff span { min-width: 180px; padding-top: 7px; border-top: 1px solid #7f8996; color: #657080; text-align: center; }
.quote-paper .doc-foot { margin: 0; padding: 10px; border-top: 1px solid #d9dee5; }

@media (max-width: 600px) {
    .quote-banner { align-items: flex-start; flex-direction: column; padding: 16px; }
    .quote-info-grid { grid-template-columns: 1fr; }
    .business-info { border-right: 0; border-bottom: 1px solid #cfd5dd; }
    .quote-info { padding: 16px; }
    .quote-meta > div { border-bottom: 1px solid #cfd5dd; }
    .quote-customer { padding: 14px 16px; }
    .quote-table { min-width: 0; }
    .quote-table thead th, .quote-table tbody td { padding: 8px 5px; font-size: 10px; }
    .quote-table th:nth-child(2) { width: auto; }
    .quote-bottom-grid { grid-template-columns: 1fr; }
    .quote-totals { border-left: 0; border-top: 1px solid #cfd5dd; }
}

@media print {
    .quote-paper { border: 1px solid #8c949e !important; border-radius: 0; }
    .quote-banner, .quote-info, .quote-customer, .quote-table th, .quote-table td,
    .quote-bottom-grid, .quote-totals, .quote-signoff, .quote-paper .doc-foot { border-color: #aeb5be !important; }
    .quote-table thead th { background: #f1f4f8 !important; color: #202733 !important; print-color-adjust: exact; }
    .quote-table tbody tr { break-inside: avoid; }
}
