/* Fonts are bundled (no external requests): Inter for text, Plus Jakarta Sans for headings and numbers, Noto Sans Bengali for Bangla. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jakarta"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/jakarta-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "NotoBn"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/notobn-bengali.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CF7, U+200C-200D, U+20B9, U+25CC; }

:root {
    --navy: #14396f; --brand: #1f4e8c; --brand-2: #2f6db5; --sky: #eaf2fc; --sky-2: #f5f9fe;
    --line: #e1e9f4; --line-2: #cfdcec; --text: #1c2a3f; --muted: #66758c; --bg: #f3f6fb; --card: #fff;
    --good: #067647; --good-bg: #dcfae6; --warn: #b54708; --warn-bg: #fef0c7; --bad: #b42318; --bad-bg: #fee4e2;
    --radius: 14px; --sidebar: 252px;
    --shadow: 0 1px 2px rgba(20,57,111,.05), 0 10px 28px -14px rgba(20,57,111,.16);
    --grad: linear-gradient(135deg, #1f4e8c 0%, #2f6db5 100%);
    --font: "Inter", "NotoBn", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Jakarta", "Inter", "NotoBn", system-ui, -apple-system, "Segoe UI", sans-serif;
    --text-xs: .75rem; --text-sm: .875rem; --text-base: .9375rem; --text-lg: 1.0625rem; --text-xl: 1.25rem; --text-2xl: 1.75rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--text-base)/1.6 var(--font); font-feature-settings: "cv11", "ss03"; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
a { color: var(--brand-2); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0; color: var(--navy); letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0 0 16px; color: var(--navy); } h2 small { font-weight: 500; font-size: .85rem; }
h3 { margin: 0 0 6px; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--brand-2); }
.hidden { display: none !important; } .muted { color: var(--muted); } small { color: var(--muted); font-weight: 400; } .center { text-align: center; } .lead { margin-top: 4px; }

/* sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px 16px; z-index: 30; }
.brand { display: block; padding: 2px 8px 20px; border-bottom: 1px solid var(--line); margin-bottom: 14px; } .brand img { display: block; width: 168px; max-width: 100%; height: auto; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 4px 12px 8px; font-weight: 600; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; color: #3b4d68; padding: 11px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.sidebar nav a svg { flex-shrink: 0; opacity: .85; }
.sidebar nav a:hover { background: var(--sky); color: var(--brand); }
.sidebar nav a.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 6px 14px -6px rgba(31,78,140,.55); } .sidebar nav a.active svg { opacity: 1; }
.logout { border-top: 1px solid var(--line); padding-top: 14px; }
.user { display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; } .who { line-height: 1.25; font-weight: 600; color: var(--navy); font-size: .9rem; } .who small { display: block; font-size: .75rem; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--sky); color: var(--brand); font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.scrim { display: none; }

/* main */
.main { margin-left: var(--sidebar); padding: 30px 36px 70px; max-width: 1240px; }
body.guest .main { margin: 0; max-width: none; min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 85% -10%, #d7e6fa 0%, transparent 60%), radial-gradient(700px 400px at -10% 110%, #dbe9fb 0%, transparent 60%), var(--bg); }
body.guest .flashes { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: min(420px, 92vw); }
.topbar { display: none; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 16px; } .card-head h2 { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; min-height: 40px; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--sky); } .btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(47,109,181,.28); outline-offset: 1px; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -7px rgba(31,78,140,.7); } .btn-primary:hover { background: linear-gradient(135deg, #1a4480 0%, #2a63a8 100%); }
.btn-danger { color: var(--bad); border-color: #f3c0bb; } .btn-danger:hover { background: var(--bad-bg); }
.btn-ghost { background: transparent; border-color: transparent; } .btn-sm { padding: 5px 12px; min-height: 32px; font-size: .85rem; border-radius: 8px; } .btn-lg { padding: 14px 30px; font-size: 1.05rem; border-radius: 12px; } .btn-block { width: 100%; }
.btn[disabled] { opacity: .65; cursor: wait; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: var(--good-bg); color: var(--good); border-color: #abefc6; } .alert-error { background: var(--bad-bg); color: var(--bad); border-color: #fecdca; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; vertical-align: middle; letter-spacing: .01em; }
.badge-paid { background: var(--good-bg); color: var(--good); } .badge-partial { background: var(--warn-bg); color: var(--warn); } .badge-unpaid { background: var(--bad-bg); color: var(--bad); } .badge-void { background: #eceff3; color: var(--muted); }
.empty { color: var(--muted); padding: 10px 0; }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat span { display: block; color: var(--muted); font-size: .84rem; } .stat strong { white-space: nowrap; font-size: 1.4rem; color: var(--navy); line-height: 1.2; letter-spacing: -.01em; }
.ico { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; }
.ico-blue { background: var(--sky); color: var(--brand); } .ico-green { background: var(--good-bg); color: var(--good); } .ico-amber { background: var(--warn-bg); color: var(--warn); }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 12px; }
.client-tile { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .1s; }
.client-tile:hover { border-color: var(--brand-2); box-shadow: 0 8px 20px -12px rgba(31,78,140,.45); transform: translateY(-1px); }
.client-tile .tile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; } .client-tile strong { color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-tile .tile-text > span { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .client-tile em { font-style: normal; color: var(--brand-2); font-size: .86rem; font-weight: 700; margin-top: 2px; }
.client-tile .avatar { background: var(--grad); color: #fff; }
.search, .filters input, .filters select { padding: 9px 13px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; background: #fff; min-height: 42px; }
.card-head .search { min-width: 260px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; } .filters label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .9rem; } .filters input[type=search] { flex: 1 1 240px; }

/* tables */
.table-wrap { overflow-x: auto; } .table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 11px 12px; background: var(--sky-2); border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; }
.table th:first-child { border-top-left-radius: 10px; } .table th:last-child { border-top-right-radius: 10px; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; } .table tr:last-child td { border-bottom: 0; } .table tbody tr:hover td { background: var(--sky-2); }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; } .row-muted { opacity: .6; } .row-actions { white-space: nowrap; text-align: right; } .inline { display: inline; } .pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; } .field > span { font-weight: 600; font-size: .88rem; color: var(--navy); }
input, select, textarea { font: inherit; color: var(--text); padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; width: 100%; min-height: 43px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #b3c6de; } input:focus, select:focus, textarea:focus { border-color: var(--brand-2); }
textarea { resize: vertical; } input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--brand); } input[type=file] { padding: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.invalid, .field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.error-text { color: var(--bad); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; } .form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .form-grid .wide { grid-column: 1 / -1; } .form-grid.narrow { max-width: 480px; grid-template-columns: 1fr; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.input-group { display: flex; } .input-group input { border-radius: 10px 0 0 10px; } .input-group select { width: 72px; border-radius: 0 10px 10px 0; border-left: 0; }
.auth-card { width: min(430px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 34px 32px 30px; box-shadow: 0 24px 60px -24px rgba(20,57,111,.28); }
.auth-card h1 { font-size: 1.45rem; } .auth-card .lead { margin: 4px 0 22px; }
.auth-brand { text-align: center; margin-bottom: 20px; } .auth-brand img { width: 220px; max-width: 80%; height: auto; }

/* combo box */
.combo { position: relative; margin-bottom: 4px; } .combo-list { position: absolute; left: 0; right: 0; top: 76px; z-index: 20; margin: 0; padding: 5px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; max-height: 300px; overflow-y: auto; box-shadow: 0 16px 40px -12px rgba(20,57,111,.3); }
.combo-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; } .combo-list li span { color: var(--muted); font-size: .88rem; } .combo-list li:hover, .combo-list li.on { background: var(--sky); }

/* invoice form */
.invoice-form h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.items .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 150px 140px 36px; gap: 12px; align-items: start; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.item-total { padding-top: 4px; } .item-total span { display: block; font-weight: 600; font-size: .88rem; color: var(--navy); margin-bottom: 6px; } .item-total strong { display: block; padding: 9px 0; white-space: nowrap; } .remove-item { margin-top: 28px; font-size: 1.3rem; line-height: 1; }
.totals-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, 1fr); gap: 26px; align-items: start; }
.summary { margin: 0; background: var(--sky-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 18px; } .summary div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); } .summary div:last-child { border-bottom: 0; } .summary dt { color: var(--muted); } .summary dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.summary .grand dt, .summary .grand dd { color: var(--navy); font-size: 1.1rem; font-weight: 800; } .summary .due dd { color: var(--bad); font-weight: 800; } .summary-right { max-width: 360px; margin-left: auto; margin-top: 16px; }
.submit-bar { position: sticky; bottom: 0; display: flex; gap: 16px; align-items: center; justify-content: flex-end; padding: 16px 0 14px; background: linear-gradient(rgba(243,246,251,0), var(--bg) 35%); }
.form-status { color: var(--muted); font-weight: 600; } .form-status.error { color: var(--bad); } .form-status.ok { color: var(--good); }
.spinner { width: 16px; height: 16px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.paper-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; margin-bottom: 20px; } .paper-head h2 { font-size: 1.4rem; margin-bottom: 2px; } .paper-head p { margin: 0; color: var(--muted); } .paper-meta p span { display: inline-block; min-width: 120px; color: var(--muted); } .bill-to { margin-bottom: 20px; }

/* tablet / mobile */
@media (max-width: 860px) {
    .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 25; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 14px; }
    .topbar-logo { flex: 1; display: block; } .topbar-logo img { display: block; height: 38px; width: auto; }
    .menu-btn { background: none; border: 0; color: var(--navy); font-size: 1.6rem; cursor: pointer; min-width: 40px; min-height: 40px; }
    .sidebar { transform: translateX(-100%); transition: transform .22s; box-shadow: 0 0 50px rgba(20,57,111,.3); width: min(290px, 84vw); } .sidebar.open { transform: none; }
    .scrim.show { display: block; position: fixed; inset: 0; background: rgba(15,30,55,.45); z-index: 29; }
    .main { margin-left: 0; padding: 18px 14px 50px; }
    h1 { font-size: 1.35rem; }
    .form-grid, .form-grid.three, .totals-layout { grid-template-columns: 1fr; }
    .items .item-row { grid-template-columns: 1fr 1fr; } .item-desc { grid-column: 1 / -1; } .remove-item { margin-top: 0; justify-self: end; }
    .submit-bar { flex-direction: column; align-items: stretch; } .submit-bar .btn { width: 100%; }
    .table thead { display: none; } .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 12px; background: #fff; }
    .table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 7px 0; text-align: right !important; }
    .table td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; flex-shrink: 0; }
    .table td.row-actions { justify-content: flex-start; flex-wrap: wrap; } .table td.row-actions::before { content: none; }
    .table tbody tr:hover td { background: transparent; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 13px; flex-direction: column; align-items: flex-start; gap: 8px; } .stat strong { font-size: 1.15rem; } .ico { width: 38px; height: 38px; }
    .card { padding: 16px; } .card-head .search { min-width: 0; width: 100%; }
    .auth-card { padding: 26px 20px; }
}
@media print { .sidebar, .topbar, .actions, .submit-bar, .btn, .scrim { display: none !important; } .main { margin: 0; padding: 0; } body { background: #fff; } .card { border: 0; box-shadow: none; } }

/* invoice screens */
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; border-radius: 50%; background: var(--grad); color: #fff; font-size: .8rem; font-weight: 700; vertical-align: 1px; }
.back-link { display: inline-block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; } .back-link:hover { color: var(--brand-2); }
.invoice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.invoice-side { position: sticky; top: 18px; } .side-card { padding: 18px; margin-bottom: 16px; } .side-card h2 { margin-bottom: 12px; }
.hint { color: var(--muted); font-size: .84rem; margin: 10px 0 0; } .side-card .hint:first-of-type { margin-top: 0; }
.progress { height: 8px; border-radius: 999px; background: var(--sky); overflow: hidden; margin-bottom: 12px; } .progress span { display: block; height: 100%; background: linear-gradient(90deg, #12b76a, #32d583); border-radius: 999px; }
.mini { margin: 0; } .mini div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); } .mini div:last-child { border-bottom: 0; } .mini dt { color: var(--muted); } .mini dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; } .mini .good { color: var(--good); } .mini .bad { color: var(--bad); }

.paper-sheet { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 40px 44px 36px; box-shadow: 0 2px 4px rgba(20,57,111,.05), 0 24px 50px -24px rgba(20,57,111,.28); overflow: hidden; }
.paper-sheet::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--grad); }
.watermark { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) rotate(-20deg); font-size: 7rem; font-weight: 800; letter-spacing: .1em; color: rgba(107,114,128,.13); pointer-events: none; }
.is-void { opacity: .9; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.sheet-logo { width: 190px; max-width: 45%; height: auto; }
.sheet-title { text-align: right; } .sheet-title h2 { margin: 0; font-size: 2.3rem; font-weight: 400; color: #333; letter-spacing: .02em; line-height: 1.1; } .sheet-title span { color: var(--muted); font-size: 1.05rem; }
.sheet-company { margin: 14px 0 22px; display: flex; flex-direction: column; font-size: .92rem; line-height: 1.5; }
.sheet-meta { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 28px; margin-bottom: 26px; }
.bill-to { font-size: .95rem; line-height: 1.55; } .bill-to h3 { margin-bottom: 8px; color: var(--muted); }
.dates { margin: 0; } .dates div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 12px 6px 0; } .dates dt { color: var(--muted); } .dates dd { margin: 0; text-align: right; }
.dates .balance-box { background: #f3f4f6; padding: 11px 12px; margin-top: 6px; border-radius: 6px; } .dates .balance-box dt, .dates .balance-box dd { color: #1c2a3f; font-weight: 700; font-size: 1.05rem; }
.sheet-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 6px; }
.sheet-table th { background: #3a3a3a; color: #fff; font-weight: 400; text-align: left; padding: 11px 14px; font-size: .92rem; } .sheet-table th:first-child { border-radius: 8px 0 0 8px; } .sheet-table th:last-child { border-radius: 0 8px 8px 0; }
.sheet-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; } .sheet-table tbody tr:last-child td { border-bottom: 0; }
.sheet-totals { width: min(360px, 100%); margin: 18px 0 0 auto; } .sheet-totals div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 14px; } .sheet-totals dt { color: var(--muted); } .sheet-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.sheet-totals .total { border-top: 1px solid var(--line); } .sheet-totals .total dt, .sheet-totals .total dd { color: var(--navy); font-weight: 800; font-size: 1.05rem; }
.sheet-block { margin-top: 26px; font-size: .92rem; line-height: 1.6; } .sheet-block h3 { color: var(--muted); margin-bottom: 6px; } .sheet-block p { margin: 0; } .sheet-block .note { margin-top: 8px; }
.sheet-closing { margin: 22px 0 0; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: .95rem; }
@media (max-width: 1000px) { .invoice-layout { grid-template-columns: 1fr; } .invoice-side { position: static; } }
@media (max-width: 860px) {
    .paper-sheet { padding: 28px 18px 24px; } .sheet-meta { grid-template-columns: 1fr; gap: 16px; } .sheet-title h2 { font-size: 1.8rem; } .sheet-logo { width: 150px; }
    .sheet-table thead { display: none; } .sheet-table, .sheet-table tbody, .sheet-table tr, .sheet-table td { display: block; width: 100%; }
    .sheet-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; } .sheet-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 0; text-align: right; }
    .sheet-table td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; }
    .watermark { font-size: 4.5rem; }
}
@media print { .invoice-side, .back-link { display: none !important; } .invoice-layout { display: block; } .paper-sheet { box-shadow: none; border: 0; } }

/* dashboard v2 */
.sub { margin: 4px 0 0; font-size: .92rem; } .sub strong { color: var(--navy); }
.stat em { display: block; font-style: normal; font-size: .8rem; color: var(--muted); margin-top: 2px; } .stat em.bad { color: var(--bad); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.chip b { background: var(--sky); color: var(--brand); border-radius: 999px; padding: 0 8px; font-size: .78rem; line-height: 1.6; }
.chip:hover { background: var(--sky-2); } .chip.on { background: var(--grad); border-color: transparent; color: #fff; } .chip.on b { background: rgba(255,255,255,.22); color: #fff; }
.progress-lg { height: 10px; margin: 0 0 18px; }
.search-wide { width: 100%; margin-bottom: 14px; }
.client-tile { position: relative; } .client-tile .tile-text { flex: 1; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; } .tile-foot em { margin: 0; font-size: .82rem; white-space: nowrap; }
.state { flex-shrink: 0; white-space: nowrap; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; }
.state-pending { background: var(--warn-bg); color: var(--warn); } .state-done { background: var(--good-bg); color: var(--good); }
.client-tile.is-done { background: var(--sky-2); } .client-tile.is-done .avatar { background: var(--good-bg); color: var(--good); }
@media (max-width: 860px) { .dash-head .actions { width: 100%; } .dash-head .actions .btn { flex: 1; } .chips { width: 100%; } .chip { flex: 1; justify-content: center; } }


/* typography & polish v3 */
h1, h2, h3, .brand-title, .stat strong, .sheet-title h2, .auth-card h1 { font-family: var(--font-display); }
h1 { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
h2 { font-size: var(--text-lg); font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
h3 { font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em; }
p { margin: 0 0 .75em; }
strong, b { font-weight: 650; }
small { font-size: var(--text-sm); line-height: 1.4; }
.sub { font-size: var(--text-sm); line-height: 1.5; color: var(--muted); }
.num, .stat strong, .summary dd, .sheet-totals dd, .sheet-table td.num, .dates dd, .mini dd, .item-total strong, td[data-label="Total"], td[data-label="Balance"], td[data-label="Amount"], td[data-label="Rate"] { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum", "lnum", "cv11"; }
.stat strong { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; }
.stat span { font-size: var(--text-sm); font-weight: 500; }
.stat em { font-size: var(--text-xs); }
.page-head { margin-bottom: 26px; }
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* controls */
.btn { font-size: var(--text-sm); font-weight: 600; letter-spacing: .005em; }
.btn-sm { font-size: var(--text-xs); }
.btn-lg { font-size: var(--text-lg); font-family: var(--font-display); font-weight: 650; letter-spacing: -.005em; }
.field > span { font-size: var(--text-sm); font-weight: 600; letter-spacing: 0; }
input, select, textarea { font-size: var(--text-base); }
::placeholder { color: #98a6ba; opacity: 1; }
.badge { font-size: var(--text-xs); font-weight: 650; letter-spacing: .02em; }
.chip { font-size: var(--text-sm); }
.alert { font-size: var(--text-sm); font-weight: 500; }
.error-text { font-size: var(--text-xs); }

/* sidebar */
.nav-label { font-size: 11px; letter-spacing: .12em; }
.sidebar nav a { font-size: var(--text-sm); font-weight: 550; }
.sidebar nav a.active { font-weight: 650; }
.who { font-size: var(--text-sm); }

/* tables */
.table th { font-size: 11px; letter-spacing: .08em; font-weight: 700; color: #5b6b82; }
.table td { font-size: var(--text-sm); }
.table td a { font-weight: 650; }
.table td small { font-size: var(--text-xs); }

/* cards: calmer, more air */
.card { padding: 24px; }
.card h2 { margin-bottom: 18px; }
.card-head h2 { margin-bottom: 0; }
.client-tile strong { font-size: var(--text-sm); font-weight: 650; }
.client-tile .tile-text > span { font-size: var(--text-xs); }
.client-tile em { font-size: var(--text-xs); }
.summary dt { font-size: var(--text-sm); } .summary dd { font-size: var(--text-sm); }
.summary .grand dt, .summary .grand dd { font-family: var(--font-display); font-size: var(--text-xl); letter-spacing: -.01em; }
.submit-bar .form-status { font-size: var(--text-sm); }

/* auth */
.auth-card h1 { font-size: var(--text-xl); letter-spacing: -.02em; }
.auth-card .lead { font-size: var(--text-sm); }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn-block { min-height: 46px; font-size: var(--text-base); margin-top: 4px; }

/* invoice sheet */
.sheet-title h2 { font-weight: 300; letter-spacing: .04em; }
.sheet-company, .bill-to { font-size: var(--text-sm); line-height: 1.6; }
.sheet-table th { font-size: var(--text-sm); font-weight: 500; }
.sheet-table td { font-size: var(--text-sm); }
.sheet-totals dt, .sheet-totals dd { font-size: var(--text-sm); }
.sheet-block { font-size: var(--text-sm); }
.step { font-family: var(--font-display); }

/* motion + a11y */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
::selection { background: rgba(47,109,181,.22); }

/* filters + table fit */
.filters input, .filters select { width: auto; }
.filters input[type=search] { flex: 1 1 260px; min-width: 200px; }
.filters select { min-width: 150px; }
.filters .btn { min-height: 42px; }
.nowrap { white-space: nowrap; }
.table td[data-label="Client"] { min-width: 150px; }
.table td { padding: 12px 10px; }
.table td .btn + .btn { margin-left: 2px; }
@media (max-width: 860px) { .filters input, .filters select, .filters label { width: 100%; } .filters label input { width: 100%; } }
