/* ============================================================
   GKSinvoice — stylesheet utama
   ============================================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f1f5f9;
    --card: #ffffff;
    --sidebar: #0f172a;
    --sidebar-hover: #1e293b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin-top: 0; }
a { color: var(--primary); }
.icon { vertical-align: middle; flex-shrink: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.font-bold { font-weight: 700; }

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

.sidebar {
    width: 248px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--sidebar);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 40;
}

.brand {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -.02em;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}

.nav {
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 9px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .28); }

.sidebar-foot {
    margin-top: auto;
    padding: 18px 22px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 12px;
    color: #64748b;
    line-height: 1.7;
}

.main { margin-left: 248px; min-height: 100vh; }

.topbar {
    height: 72px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar h1 { margin: 0; font-size: 18px; letter-spacing: -.01em; }

.topbar-right { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--line); }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.user-meta strong { color: var(--ink); font-size: 12.5px; white-space: nowrap; }
.user-meta > span { font-size: 10.5px; color: var(--muted); }
.logout-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}
.logout-link:hover { color: var(--danger); }
.logout-link .icon { width: 16px; height: 16px; }

.menu-toggle { display: none; }

.content { padding: 28px 30px 48px; max-width: 1440px; }

.overlay { display: none; }

/* ---------- Kartu & header halaman ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

.card-body { padding: 22px; }

.card-head {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-head h3 { margin: 0; font-size: 15px; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 19px 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

.stat-card .stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.stat-value { font-size: 23px; font-weight: 750; margin-top: 12px; letter-spacing: -.03em; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

.icon-blue { background: #dbeafe; color: #1d4ed8; }
.icon-green { background: #dcfce7; color: #166534; }
.icon-amber { background: #fef3c7; color: #92400e; }
.icon-slate { background: #f1f5f9; color: #475569; }

.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-top: 16px; }

/* ---------- Grafik batang sederhana ---------- */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 210px; padding-top: 12px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.chart-bar { width: 100%; max-width: 40px; min-height: 4px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #60a5fa, #2563eb); }
.chart-label { font-size: 11px; color: var(--muted); }
.chart-value { font-size: 10px; color: var(--muted); }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
.table-title { font-weight: 600; }
.table-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { background: #fff; color: #334155; border-color: var(--line); }
.btn-light:hover { background: #f8fafc; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-warning { background: #fff; color: var(--warning); border-color: #fde68a; }
.btn-warning:hover { background: #fffbeb; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
}
.icon-btn:hover { background: #eef2ff; color: var(--primary); }
.icon-btn.danger:hover { background: #fef2f2; color: var(--danger); }
.action-group { display: flex; gap: 4px; justify-content: flex-end; }

/* ---------- Form ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 7px; }
.required::after { content: ' *'; color: var(--danger); }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
}
textarea.form-control { min-height: 78px; resize: vertical; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
select.form-control { width: auto; min-width: 170px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.section-title { font-size: 14px; font-weight: 700; margin: 8px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { position: relative; flex: 1; max-width: 320px; }
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 36px; width: 100%; padding-top: 9px; padding-bottom: 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; }
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

/* ---------- Badge & alert ---------- */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #166534; }

.alert { padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 6px; font-size: 15px; }

/* ---------- Login ---------- */
.login-body { background: var(--bg); }
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at 15% 10%, #dbeafe 0, transparent 38%),
                radial-gradient(circle at 85% 90%, #e0e7ff 0, transparent 35%),
                var(--bg);
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .12);
    overflow: hidden;
}
.login-head {
    padding: 30px 30px 26px;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #fff;
}
.login-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    display: grid;
    place-items: center;
    margin-bottom: 16px;
}
.login-head h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.login-head p { margin: 6px 0 0; font-size: 13px; color: #cbd5e1; }
.login-body-card { padding: 28px 30px 24px; }
.login-foot {
    border-top: 1px solid var(--line);
    background: #f8fafc;
    padding: 13px 30px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}
.login-body-card .form-group { margin-bottom: 16px; }

/* ---------- Form invoice: baris item ---------- */
.items-table th, .items-table td { padding: 10px 8px; }
.items-table input.form-control { font-size: 13px; padding: 8px 10px; }
.item-qty { max-width: 95px; }
.item-price { max-width: 155px; }
.line-total { font-weight: 600; white-space: nowrap; }
.totals-box { width: 340px; max-width: 100%; margin-left: auto; margin-top: 18px; }
.totals-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.totals-row span:first-child { color: var(--muted); }
.totals-row.grand { border-top: 2px solid var(--line); margin-top: 8px; padding-top: 13px; font-size: 18px; font-weight: 750; }
.totals-row.grand span:first-child { color: var(--ink); }
.totals-inline { display: inline-block; width: 130px; text-align: right; font-weight: 600; }

/* ---------- Kertas invoice / cetak: tampilan bersih & lapang ---------- */
.paper.invoice-sheet {
    background: #fff;
    max-width: 960px;
    margin: 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, .08);
    color: #1f2937;
    font-size: 12.5px;
    overflow: hidden;
}

.sheet-head {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    padding: 34px 40px 28px;
    border-bottom: 1px solid #e5e7eb;
}
.sheet-head::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4338ca, #2563eb);
}

.sheet-brand { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.sheet-logo-box {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border: 0;
    border-radius: 0;
    background: transparent;
    display: grid;
    place-items: center;
    padding: 0;
}
.sheet-logo { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.sheet-logo-fallback { font-size: 26px; font-weight: 800; color: #4338ca; }
.sheet-brand-text { min-width: 0; }
.sheet-company-name { font-size: 19px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; color: #0f172a; }
.sheet-company-address { margin-top: 5px; font-size: 11.5px; line-height: 1.55; color: #4b5563; max-width: 430px; }
.sheet-company-contacts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 7px; font-size: 11px; color: #64748b; }
.sheet-company-contacts span { white-space: nowrap; }

.sheet-doc { text-align: right; flex-shrink: 0; }
.sheet-doc-label { font-size: 20px; line-height: 1.1; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #4338ca; }
.sheet-doc-number { margin-top: 6px; font-size: 13.5px; font-weight: 750; color: #334155; }
.sheet-doc-status { margin-top: 8px; }

.sheet-info { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; padding: 26px 40px 8px; }
.info-card { border: 1px solid #e5e7eb; border-radius: 10px; background: #f8fafc; padding: 16px 18px; }
.card-label { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #64748b; }
.card-name { margin-top: 6px; font-size: 14px; font-weight: 750; color: #0f172a; }
.card-detail { margin-top: 6px; font-size: 11.5px; line-height: 1.55; color: #475569; }
.meta-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 5px 0; font-size: 11.5px; }
.meta-row + .meta-row { border-top: 1px solid #e2e8f0; }
.meta-row > span { color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.meta-row > strong { color: #0f172a; text-align: right; font-weight: 700; }
.meta-row .badge { font-size: 9px; padding: 2px 7px; }

.sheet-table-wrap { padding: 18px 40px 8px; overflow-x: auto; }
.sheet-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11.5px; }
.sheet-table thead th { background: #f1f5f9; color: #334155; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 11px 12px; border-bottom: 1px solid #cbd5e1; }
.sheet-table td { padding: 12px; border-bottom: 1px solid #edf2f7; vertical-align: top; line-height: 1.5; }
.sheet-table tbody tr:nth-child(even) { background: #fafbfc; }
.sheet-table tbody tr:hover { background: transparent; }
.sheet-table tbody tr:last-child td { border-bottom: 1px solid #cbd5e1; }
.sheet-table .col-no { width: 4%; }
.sheet-table .col-product { width: 34%; }
.sheet-table .col-spec { width: 24%; }
.sheet-table .col-qty { width: 11%; }
.sheet-table .col-price { width: 13%; }
.sheet-table .col-total { width: 14%; }

.sheet-summary { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; padding: 16px 40px 26px; }
.summary-note { border: 1px dashed #cbd5e1; border-radius: 10px; padding: 15px 18px; }
.summary-note p { margin: 7px 0 0; font-size: 12px; font-style: italic; line-height: 1.6; color: #334155; }
.sheet-notes { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e2e8f0; font-size: 11px; line-height: 1.55; color: #64748b; }
.summary-totals { border: 1px solid #e5e7eb; border-radius: 10px; background: #f8fafc; padding: 14px 18px; }
.total-line { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; font-size: 11.5px; }
.total-line > span:first-child { color: #64748b; font-weight: 650; }
.total-line.grand { border-top: 1px solid #cbd5e1; margin-top: 8px; padding-top: 11px; font-size: 15px; font-weight: 800; color: #0f172a; }
.total-line.grand > span:last-child { color: #4338ca; }

.paid-stamp { display: inline-block; border: 2px solid #dc2626; color: #dc2626; font-size: 14px; font-weight: 800; letter-spacing: .12em; padding: 3px 11px; transform: rotate(-6deg); margin-top: 8px; }
.stamp-date { font-size: 10px; color: #64748b; margin-top: 4px; }

.sheet-footer { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; padding: 0 40px 28px; }
.payment-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 15px 18px; }
.payment-card p { margin: 7px 0 10px; font-size: 11.5px; color: #475569; }
.bank-row { display: flex; gap: 10px; font-size: 11.5px; padding: 2px 0; }
.bank-row span { width: 38px; color: #64748b; font-weight: 700; }
.signature-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 15px 18px; text-align: center; }
.sign-space { height: 58px; }
.signature-card strong { display: block; border-top: 1px solid #94a3b8; padding-top: 7px; font-size: 12px; }
.sign-role { display: block; margin-top: 3px; font-size: 10.5px; color: #64748b; }

.sheet-footnote { border-top: 1px solid #e5e7eb; background: #f8fafc; padding: 12px 40px; text-align: center; font-size: 10.5px; color: #64748b; }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    .sidebar.open { transform: translateX(0); }
    .overlay.visible { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 35; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .topbar { padding: 0 16px; }
    .topbar-right .date, .user-meta, .logout-link span { display: none; }
    .content { padding: 20px 16px 40px; }
    .form-grid { grid-template-columns: 1fr; }
    .sheet-head { flex-direction: column; padding: 26px 20px; gap: 18px; }
    .sheet-doc { text-align: left; }
    .sheet-info, .sheet-summary, .sheet-footer { grid-template-columns: 1fr; padding-left: 20px; padding-right: 20px; }
    .sheet-table-wrap { padding-left: 20px; padding-right: 20px; }
    .sheet-table { min-width: 680px; }
    .sheet-footnote { padding: 12px 20px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .totals-box { width: 100%; }
}

/* ---------- Cetak: gaya retro, pas 1 lembar A4 ---------- */
@media print {
    @page { size: A4 portrait; margin: 10mm; }

    html, body { width: auto; height: auto; margin: 0; background: #fff; }
    body {
        font-family: "Courier New", Courier, monospace;
        font-size: 9.5pt;
        color: #3b3026;
    }
    * { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .sidebar, .topbar, .overlay, .no-print, .alert, .menu-toggle { display: none !important; }
    .app, .main { display: block; min-height: 0 !important; margin: 0 !important; }
    .content { padding: 0 !important; max-width: none !important; }

    /* Kertas putih tanpa bingkai pinggir. */
    .paper.invoice-sheet {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        background: #fff !important;
        color: #3b3026;
        font-size: 9pt;
    }
    .paper.invoice-sheet * { color: #3b3026; }

    .sheet-head::before { display: none !important; }
    .sheet-head {
        position: relative;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 14px !important;
        padding: 10px 12px 10px !important;
        border-bottom: 0 !important;
    }
    /* Garis tebal dua baris tepat di bawah header. */
    .sheet-head::after {
        content: "";
        position: absolute;
        left: 12px; right: 12px; bottom: 0;
        height: 6px;
        border-top: 2px solid #6b5741;
        border-bottom: 2px solid #6b5741;
        background: transparent;
    }
    .sheet-brand { gap: 10px; }
    .sheet-logo-box {
        width: 72px; height: 72px; padding: 0;
        border: 0; border-radius: 0; background: transparent;
    }
    .sheet-logo-fallback { font-size: 24pt; color: #6b5741; }
    .sheet-company-name {
        font-size: 14pt; line-height: 1.15; font-weight: 700;
        text-transform: uppercase; letter-spacing: .08em;
    }
    .sheet-company-address { margin-top: 3px; font-size: 7.8pt; line-height: 1.3; max-width: none; }
    .sheet-company-contacts { margin-top: 3px; gap: 1px 10px; font-size: 7.5pt; }
    .sheet-doc { text-align: right !important; }
    .sheet-doc-label {
        display: inline-block; font-size: 13pt; font-weight: 700;
        letter-spacing: .12em; text-transform: uppercase;
        border: 2px double #8a5a2b; padding: 2px 8px;
        transform: rotate(-1deg);
    }
    .sheet-doc-number { margin-top: 5px; font-size: 9pt; font-weight: 700; letter-spacing: .04em; }
    .sheet-doc-status { margin-top: 5px; }
    .badge {
        border: 1px dashed #6b5741; border-radius: 0;
        background: #fff !important; color: #3b3026 !important;
        font-size: 7.5pt; padding: 1px 6px; text-transform: uppercase;
    }

    .sheet-info,
    .sheet-summary,
    .sheet-footer {
        grid-template-columns: 1.15fr 1fr !important;
        gap: 10px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .sheet-info { padding-top: 8px !important; padding-bottom: 4px !important; }
    .info-card {
        border: 1px solid #8a7860 !important; border-radius: 0 !important;
        background: #fff !important; padding: 7px 9px !important;
    }
    .card-label {
        font-size: 7.5pt; font-weight: 700; letter-spacing: .1em;
        text-transform: uppercase; border-bottom: 1px dashed #8a7860;
        padding-bottom: 3px;
    }
    .card-name { margin-top: 4px; font-size: 9.5pt; font-weight: 700; }
    .card-detail { margin-top: 3px; font-size: 7.8pt; line-height: 1.3; }
    .meta-row { padding: 2px 0; font-size: 7.8pt; border-bottom: 1px dotted #a19077 !important; }
    .meta-row + .meta-row { border-top: 0 !important; }
    .meta-row > span { font-size: 7pt; font-weight: 700; text-transform: uppercase; }
    .meta-row > strong { text-align: right; }

    .sheet-table-wrap { padding: 7px 12px 4px !important; overflow: visible !important; min-width: 0 !important; }
    .sheet-table {
        width: 100%; min-width: 0 !important; table-layout: fixed;
        border-collapse: collapse; border: 2px double #6b5741; font-size: 7.8pt;
    }
    .sheet-table thead { display: table-header-group; }
    .sheet-table thead th {
        background: #fff !important; border: 1px solid #6b5741;
        padding: 5px 6px; font-size: 7pt; font-weight: 700;
        text-transform: uppercase; letter-spacing: .06em; text-align: center;
    }
    .sheet-table thead th.col-product,
    .sheet-table thead th.col-spec { text-align: left; }
    .sheet-table td {
        border: 1px solid #8a7860; padding: 5px 6px; line-height: 1.25;
        vertical-align: top; word-break: break-word;
    }
    .sheet-table tbody tr:nth-child(even) { background: #fff !important; }
    .sheet-table tbody tr:hover { background: transparent !important; }
    .sheet-table tbody tr:last-child td { border-bottom: 1px solid #6b5741; }
    .sheet-table tr { break-inside: avoid; page-break-inside: avoid; }

    .sheet-summary { padding-top: 4px !important; padding-bottom: 0 !important; }
    .summary-note, .summary-totals, .payment-card, .signature-card {
        border: 1px solid #8a7860 !important; border-radius: 0 !important;
        background: #fff !important; padding: 6px 9px !important;
    }
    .summary-note p { margin-top: 4px; font-size: 8pt; font-style: italic; line-height: 1.3; }
    .sheet-notes { margin-top: 5px; padding-top: 5px; border-top: 1px dashed #8a7860; font-size: 7.5pt; }
    .total-line { padding: 2px 0; font-size: 7.8pt; }
    .total-line > span:first-child { font-weight: 700; text-transform: uppercase; }
    .total-line.grand {
        margin-top: 4px; padding-top: 5px;
        border-top: 3px double #6b5741; font-size: 10.5pt; font-weight: 700;
    }
    .paid-stamp {
        border: 3px double #8a2f2f; color: #8a2f2f !important;
        font-size: 9.5pt; padding: 2px 8px; margin-top: 5px; letter-spacing: .14em;
    }
    .stamp-date { font-size: 7.5pt; }

    .sheet-footer { padding-top: 0 !important; padding-bottom: 0 !important; border-top: 0 !important; }
    .payment-card p { margin: 4px 0 5px; font-size: 7.8pt; }
    .bank-row { font-size: 7.8pt; padding: 1px 0; }
    .sign-space { height: 90px; }
    .signature-card strong { border-top: 1px dashed #6b5741; padding-top: 5px; font-size: 8.5pt; text-transform: uppercase; }
    .sign-role { font-size: 7.5pt; }

    .sheet-footnote {
        border-top: 3px double #6b5741 !important; background: #fff !important;
        padding: 3px 12px !important; text-align: center;
        font-size: 7.5pt; text-transform: uppercase; letter-spacing: .08em;
    }

    .sheet-head, .sheet-info, .sheet-summary, .sheet-footer,
    .info-card, .summary-note, .summary-totals, .payment-card, .signature-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
