:root {
  --bg: #ffffff; --ink: #0a0a0a; --ink-soft: #6b7280; --line: #e5e7eb; --line-soft: #f3f4f6;
  --hover: #f9fafb; --radius: 10px; --radius-sm: 6px; --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.05); --shadow-lg: 0 10px 30px rgba(0,0,0,0.10);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f8f9fa; color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
.app-bar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.92); backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.app-bar-inner { max-width: 1100px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-bar-brand { display: flex; align-items: center; gap: 12px; }
.app-bar-brand img { height: 34px; width: auto; display: block; }
.brand-text { line-height: 1.1; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 10px; color: var(--ink-soft); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; }
.app-nav { display: flex; gap: 4px; }
.app-nav a { background: transparent; border: 1px solid transparent; padding: 8px 14px; color: var(--ink-soft); cursor: pointer; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; transition: all 0.15s ease; text-decoration: none; }
.app-nav a:hover { background: var(--hover); color: var(--ink); }
.app-nav a.active { background: var(--ink); color: #fff; }
.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px 96px; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.page-heading p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.invoice-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }
.invoice-header-top { padding: 40px 40px 20px; text-align: center; border-bottom: 3px solid #000; }
.invoice-title { font-size: 36px; font-weight: 800; letter-spacing: 0.05em; margin: 0; text-transform: uppercase; }
.invoice-header-bottom { display: flex; justify-content: space-between; align-items: flex-start; padding: 30px 40px; gap: 40px; }
.invoice-header-left img.logo { height: 56px; width: auto; margin-bottom: 18px; display: block; }
.business-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.business-meta { color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.invoice-header-right { text-align: right; }
.invoice-meta-block { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.invoice-meta-row { display: flex; flex-direction: column; gap: 2px; }
.invoice-meta-row .label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); font-weight: 600; }
.invoice-meta-row .value { font-weight: 700; font-variant-numeric: tabular-nums; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 15px; }
.input-inline { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; font: inherit; font-size: 14px; width: 160px; color: var(--ink); background: #fff; font-weight: 600; text-align: right; }
.input-inline:focus { outline: none; border-color: var(--ink); }
.section-block { padding: 0 40px 28px; }
.section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); font-weight: 600; margin-bottom: 14px; }
.bill-to-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 24px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.form-field input, .form-field select { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; transition: border-color 0.15s ease; }
.form-field input:focus, .form-field select:focus { outline: none; border-color: var(--ink); }
.form-field input::placeholder { color: #9ca3af; }
.custom-combobox { position: relative; }
.custom-combobox input { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 36px 10px 12px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; transition: border-color 0.15s ease; }
.custom-combobox input:focus { outline: none; border-color: var(--ink); }
.custom-combobox input::placeholder { color: #9ca3af; }
.combobox-arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-soft); transition: transform 0.2s ease; }
.custom-combobox.active .combobox-arrow { transform: translateY(-50%) rotate(180deg); }
.combobox-dropdown { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 50; max-height: 240px; overflow-y: auto; }
.combobox-dropdown.show { display: block; }
.combobox-option { padding: 10px 14px; font-size: 14px; color: var(--ink); cursor: pointer; border-bottom: 1px solid var(--line-soft); transition: background 0.1s ease; }
.combobox-option:last-child { border-bottom: none; }
.combobox-option:hover { background: var(--hover); }
.combobox-option.empty { color: var(--ink-soft); font-style: italic; pointer-events: none; }
.line-items-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.line-items-table thead th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); font-weight: 600; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.line-items-table thead th.num { text-align: right; }
.line-items-table tbody td { padding: 6px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.line-items-table tbody td.num { text-align: right; }
.line-items-table tbody td.action { width: 40px; text-align: center; }
.cell-input { width: 100%; border: 1px solid transparent; background: transparent; padding: 9px 10px; font: inherit; font-size: 14px; color: var(--ink); border-radius: var(--radius-sm); transition: all 0.15s ease; }
.cell-input.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-input:hover { border-color: var(--line); background: var(--hover); }
.cell-input:focus { outline: none; border-color: var(--ink); background: #fff; }
.cell-total { display: inline-block; padding: 9px 10px; font-variant-numeric: tabular-nums; font-weight: 500; }
.remove-row-btn { background: transparent; border: none; color: #9ca3af; cursor: pointer; width: 28px; height: 28px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; transition: all 0.15s ease; }
.remove-row-btn:hover { background: #fef2f2; color: #dc2626; }
.add-row-bar { padding: 14px 12px 0; }
.add-row-btn { background: transparent; border: 1px dashed #d1d5db; color: var(--ink-soft); padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; transition: all 0.15s ease; }
.add-row-btn:hover { border-color: var(--ink); color: var(--ink); background: var(--hover); }
.totals-block { padding: 24px 40px 36px; display: flex; justify-content: flex-end; }
.totals-table { width: 320px; }
.totals-table .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.totals-table .row.grand { border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 14px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.totals-table .row .label { color: var(--ink-soft); }
.actions-bar { margin-top: 24px; display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.status-pill { margin-right: auto; font-size: 12px; color: var(--ink-soft); padding: 6px 12px; background: var(--hover); border: 1px solid var(--line); border-radius: 999px; }
.status-pill strong { color: var(--ink); font-weight: 600; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 11px 20px; font: inherit; font-size: 14px; font-weight: 500; border-radius: 8px; cursor: pointer; transition: all 0.15s ease; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--hover); border-color: #d1d5db; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #262626; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,0.25); transform: translateY(100px); opacity: 0; transition: all 0.25s ease; z-index: 1000; max-width: 320px; }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 768px) { .app-bar-inner { padding: 12px 16px; } .container { padding: 20px 16px 80px; } .invoice-header-top { padding: 24px 20px 16px; } .invoice-header-bottom { grid-template-columns: 1fr; display: grid; gap: 24px; padding: 24px 20px; } .invoice-header-right { text-align: left; } .invoice-meta-block { align-items: flex-start; } .section-block { padding: 0 20px 24px; } .bill-to-grid { grid-template-columns: 1fr; } .totals-block { padding: 16px 20px 24px; } .actions-bar { flex-wrap: wrap; } .status-pill { width: 100%; margin: 0; } }
@media print { .no-print, .app-bar, .actions-bar, .add-row-bar, .remove-row-btn, .page-heading, .toast { display: none !important; } body { background: #fff; } .container { padding: 0; max-width: none; } .invoice-sheet { border: none; box-shadow: none; border-radius: 0; } .cell-input { border: none !important; background: transparent !important; padding: 4px 0 !important; } .cell-total { padding: 4px 0 !important; } * { -webkit-print-color-adjust: exact; print-color-adjust: exact; } @page { margin: 1.5cm; } }