:root {
  --ink: #102033;
  --ink-soft: #56667a;
  --muted: #8c9aae;
  --line: #e8edf4;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --blue: #2d66d5;
  --blue-dark: #1d4faa;
  --blue-pale: #e9f1ff;
  --cyan: #55c4e9;
  --red: #d9232e;
  --red-pale: #fff0f1;
  --green: #158b67;
  --green-pale: #e9f8f2;
  --amber: #b36a0b;
  --amber-pale: #fff5e6;
  --shadow: 0 16px 45px rgba(25, 53, 89, .08);
  --shadow-soft: 0 7px 24px rgba(25, 53, 89, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 27px 16px 18px; background: var(--surface); border-right: 1px solid var(--line); z-index: 10; }
.brand { display: flex; align-items: center; height: 45px; padding: 3px 12px 7px; margin: 0 0 31px; }
.brand img { width: 171px; height: auto; display: block; }
.brand-mark { width: 33px; height: 33px; border-radius: 10px; display: grid; place-items: center; color: white; font-weight: 800; font-size: 18px; background: linear-gradient(145deg, var(--blue), var(--cyan)); box-shadow: 0 7px 18px rgba(45,102,213,.22); }
.nav-group { display: grid; gap: 5px; }
.nav-label { margin: 5px 12px 10px; color: var(--muted); font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 0 13px; border: 0; border-radius: 12px; color: var(--ink-soft); background: transparent; font-size: 13px; font-weight: 650; text-align: left; transition: .18s ease; }
.nav-item:hover { color: var(--ink); background: #f6f8fc; }
.nav-item.active { color: var(--blue-dark); background: var(--blue-pale); }
.nav-item svg { width: 18px; height: 18px; flex: none; stroke-width: 1.8; }
.sidebar-spacer { flex: 1; }
.profile-card { display: flex; align-items: center; gap: 10px; padding: 10px 9px; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 50%; background: linear-gradient(145deg, #e8f1ff, #d6f4fb); color: var(--blue-dark); font-size: 11px; font-weight: 800; }
.profile-name { font-size: 12px; font-weight: 750; }
.profile-role { color: var(--muted); font-size: 10px; margin-top: 3px; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: var(--surface); }
.icon-button:hover { color: var(--blue); border-color: #cbdafa; background: var(--blue-pale); }
.icon-button svg { width: 17px; height: 17px; }

.main-area { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; min-height: 77px; padding: 0 42px; background: rgba(245,247,251,.9); border-bottom: 1px solid rgba(232,237,244,.72); backdrop-filter: blur(16px); }
.topbar-title { font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.topbar-subtitle { margin-top: 3px; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search-box { display: flex; align-items: center; gap: 8px; width: 230px; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box svg { width: 15px; height: 15px; }
.page { width: min(1450px, 100%); padding: 32px 42px 70px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(25px, 3vw, 34px); line-height: 1.1; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 18px; letter-spacing: -.025em; }
h3 { margin-bottom: 5px; font-size: 14px; letter-spacing: -.015em; }
.lede { margin-bottom: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.muted { color: var(--muted); }
.tiny { font-size: 10px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 750; transition: .18s ease; }
.button svg { width: 16px; height: 16px; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(45,102,213,.18); }
.button-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.button-secondary { color: var(--ink-soft); border-color: var(--line); background: var(--surface); }
.button-secondary:hover { color: var(--blue); border-color: #cbdafa; background: var(--blue-pale); }
.button-ghost { color: var(--blue); border-color: transparent; background: transparent; padding: 0 6px; }
.button-danger { color: var(--red); border-color: #ffd4d6; background: var(--red-pale); }
.button-sm { min-height: 31px; padding: 0 10px; border-radius: 8px; font-size: 11px; }

.card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-soft); }
.card-pad { padding: 20px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 120px; padding: 18px; overflow: hidden; }
.metric-card::after { position: absolute; right: -22px; bottom: -30px; width: 92px; height: 92px; border-radius: 50%; content: ""; background: var(--metric-tint, var(--blue-pale)); opacity: .78; }
.metric-top { display: flex; justify-content: space-between; align-items: center; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.metric-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: var(--metric-color, var(--blue)); background: var(--metric-tint, var(--blue-pale)); }
.metric-icon svg { width: 15px; height: 15px; }
.metric-value { position: relative; z-index: 1; margin-top: 14px; font-size: 25px; font-weight: 820; letter-spacing: -.04em; }
.metric-foot { position: relative; z-index: 1; margin-top: 4px; color: var(--muted); font-size: 10px; }
.grid-2 { display: grid; grid-template-columns: 1.18fr .82fr; gap: 18px; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.section-head h2 { margin-bottom: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.link-button { border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 750; }
.link-button:hover { color: var(--blue-dark); }

.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 62px 14px minmax(0,1fr); gap: 11px; padding: 12px 0; }
.timeline-item:not(:last-child)::after { position: absolute; left: 68px; top: 35px; bottom: -2px; width: 1px; content: ""; background: var(--line); }
.timeline-time { color: var(--muted); font-size: 10px; padding-top: 3px; }
.timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 3px solid #dfeaff; border-radius: 50%; background: var(--blue); }
.timeline-main { min-width: 0; }
.timeline-title { font-size: 12px; font-weight: 750; }
.timeline-meta { overflow: hidden; margin-top: 4px; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-status { margin-top: 7px; }
.status { display: inline-flex; align-items: center; min-height: 21px; padding: 0 8px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.status-blue { color: var(--blue-dark); background: var(--blue-pale); }
.status-green { color: var(--green); background: var(--green-pale); }
.status-amber { color: var(--amber); background: var(--amber-pale); }
.status-red { color: var(--red); background: var(--red-pale); }
.status-gray { color: var(--ink-soft); background: #eef2f6; }

.workflow { display: grid; gap: 14px; }
.workflow-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 11px; align-items: center; }
.workflow-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--blue); background: var(--blue-pale); }
.workflow-icon svg { width: 15px; height: 15px; }
.workflow-label { font-size: 11px; font-weight: 700; }
.workflow-bar { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 10px; background: #edf1f5; }
.workflow-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.workflow-count { color: var(--muted); font-size: 11px; font-weight: 800; }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { padding: 0 12px 11px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: .15s ease; }
.data-table tbody tr:hover { background: #fbfcfe; }
.table-primary { font-weight: 750; }
.table-secondary { margin-top: 4px; color: var(--muted); font-size: 10px; }
.right { text-align: right; }
.table-action { color: var(--blue); border: 0; background: transparent; font-size: 11px; font-weight: 750; }
.empty-state { display: grid; place-items: center; min-height: 210px; padding: 28px; color: var(--muted); text-align: center; }
.empty-state svg { width: 30px; height: 30px; margin-bottom: 12px; color: #adc1e7; }
.empty-state p { margin: 0; font-size: 12px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }
.filter-select, .text-input, .text-area, .form-select { width: 100%; min-height: 39px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: var(--surface); font-size: 12px; transition: .15s ease; }
.filter-select { min-width: 145px; }
.text-area { min-height: 100px; padding: 11px; resize: vertical; line-height: 1.5; }
.text-input:focus, .text-area:focus, .form-select:focus, .filter-select:focus { border-color: #9fbbf1; box-shadow: 0 0 0 3px rgba(45,102,213,.09); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-label { color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.form-help { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.check-pill { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fbfcfe; font-size: 10px; cursor: pointer; }
.check-pill:has(input:checked) { color: var(--blue-dark); border-color: #bfd1f6; background: var(--blue-pale); }
.check-pill input { accent-color: var(--blue); }

.list-stack { display: grid; gap: 10px; }
.list-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); transition: .16s ease; }
.list-card:hover { border-color: #c9d8f2; box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.list-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.list-avatar { display: grid; place-items: center; width: 37px; height: 37px; flex: none; border-radius: 11px; color: var(--blue-dark); background: linear-gradient(145deg, #e7f0ff, #e6f9fc); font-size: 11px; font-weight: 850; }
.list-copy { min-width: 0; }
.list-title { overflow: hidden; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { overflow: hidden; margin-top: 4px; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.list-side { display: flex; align-items: center; gap: 10px; flex: none; }

.invoice-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-card { padding: 15px 17px; }
.summary-label { color: var(--muted); font-size: 10px; font-weight: 750; }
.summary-value { margin-top: 7px; font-size: 20px; font-weight: 820; letter-spacing: -.035em; }
.summary-accent { margin-top: 7px; color: var(--green); font-size: 10px; font-weight: 750; }
.invoice-number { color: var(--blue-dark); font-size: 12px; font-weight: 820; }
.amount { font-size: 12px; font-weight: 820; }

.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { padding: 9px; }
.settings-tab { display: block; width: 100%; padding: 11px; border: 0; border-radius: 9px; color: var(--ink-soft); background: transparent; font-size: 11px; font-weight: 700; text-align: left; }
.settings-tab.active, .settings-tab:hover { color: var(--blue-dark); background: var(--blue-pale); }
.settings-panel { display: grid; gap: 18px; }
.subsection { padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.subsection:last-child { padding-bottom: 0; border-bottom: 0; }
.subsection-head { margin-bottom: 13px; }
.subsection-head h2 { margin-bottom: 4px; font-size: 15px; }
.subsection-head p { margin: 0; color: var(--muted); font-size: 11px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 9px; border-radius: 8px; color: var(--ink-soft); background: #f0f3f7; font-size: 10px; font-weight: 700; }
.tag button { display: grid; place-items: center; width: 15px; height: 15px; padding: 0; border: 0; color: var(--muted); background: transparent; }
.tag button:hover { color: var(--red); }

.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(16,32,51,.42); backdrop-filter: blur(4px); }
.modal { width: min(720px, 100%); max-height: min(88vh, 850px); overflow: auto; border: 1px solid rgba(255,255,255,.3); border-radius: 18px; background: var(--surface); box-shadow: 0 28px 80px rgba(16,32,51,.25); }
.modal-wide { width: min(1040px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.modal-body { padding: 22px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 24px 22px; border-top: 1px solid var(--line); }
.close-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; color: var(--muted); background: #f5f7fa; }
.close-button:hover { color: var(--red); background: var(--red-pale); }
.close-button svg { width: 16px; height: 16px; }
.detail-header { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.detail-title { font-size: 20px; font-weight: 820; letter-spacing: -.035em; }
.detail-meta { margin-top: 5px; color: var(--ink-soft); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.detail-item { padding: 12px; border-radius: 11px; background: #f7f9fc; }
.detail-label { margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-value { font-size: 11px; font-weight: 700; line-height: 1.45; }
.detail-section { margin-top: 20px; }
.detail-section h3 { margin-bottom: 9px; font-size: 12px; }
.method-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.method-tag { padding: 6px 8px; border-radius: 7px; color: var(--blue-dark); background: var(--blue-pale); font-size: 10px; font-weight: 700; }

.report-editor { display: grid; gap: 18px; }
.report-stepper { display: flex; align-items: center; gap: 0; padding: 12px 14px; overflow-x: auto; }
.report-step { position: relative; display: flex; align-items: center; gap: 7px; min-width: max-content; padding: 5px 12px 5px 0; margin-right: 12px; color: var(--muted); font-size: 10px; font-weight: 750; }
.report-step:not(:last-child)::after { position: absolute; top: 50%; right: 0; width: 10px; height: 1px; content: ""; background: var(--line); }
.report-step-number { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #eef2f6; font-size: 9px; }
.report-step.active { color: var(--blue-dark); }
.report-step.active .report-step-number { color: white; background: var(--blue); }
.report-editor-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; }
.editor-section { display: grid; gap: 14px; padding: 20px; }
.editor-section + .editor-section { margin-top: 18px; }
.editor-section h2 { margin-bottom: 0; font-size: 15px; }
.section-kicker { margin-bottom: -4px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.voice-row { display: flex; align-items: center; gap: 8px; }
.voice-button { display: inline-flex; align-items: center; gap: 7px; min-height: 31px; padding: 0 10px; border: 1px solid #cae4f4; border-radius: 8px; color: #11749c; background: #eefaff; font-size: 10px; font-weight: 800; }
.voice-button.recording { color: white; border-color: var(--red); background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(217,35,46,.13); } }
.voice-button svg { width: 14px; height: 14px; }
.ai-note { display: flex; gap: 9px; padding: 11px; border-radius: 9px; color: #5a6777; background: #f4f7fb; font-size: 10px; line-height: 1.45; }
.ai-note svg { width: 15px; height: 15px; flex: none; color: var(--blue); }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.photo-item { position: relative; overflow: hidden; aspect-ratio: 1.05; border-radius: 10px; background: #eef2f6; }
.photo-item img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-caption { position: absolute; right: 0; bottom: 0; left: 0; padding: 24px 8px 8px; color: white; background: linear-gradient(transparent, rgba(0,0,0,.7)); font-size: 9px; }
.photo-delete { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 7px; color: var(--red); background: rgba(255,255,255,.92); }
.photo-delete svg { width: 13px; height: 13px; }
.photo-add { display: grid; place-items: center; aspect-ratio: 1.05; border: 1px dashed #b7c7df; border-radius: 10px; color: var(--blue); background: #f7faff; font-size: 10px; font-weight: 750; text-align: center; }
.photo-add svg { width: 20px; height: 20px; margin-bottom: 6px; }
.photo-input { display: none; }
.side-sticky { position: sticky; top: 97px; display: grid; gap: 18px; align-self: start; }
.progress-card { padding: 18px; }
.progress-circle { display: grid; place-items: center; width: 90px; height: 90px; margin: 9px auto 15px; border-radius: 50%; background: conic-gradient(var(--blue) 0deg 262deg, #e9eef5 262deg 360deg); }
.progress-circle span { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; color: var(--ink); background: white; font-size: 17px; font-weight: 850; }
.progress-legend { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.progress-legend strong { color: var(--ink); }

.invoice-document { padding: 32px; }
.invoice-doc-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 28px; border-bottom: 2px solid var(--ink); }
.invoice-doc-brand { width: 160px; }
.invoice-doc-brand img { width: 100%; }
.invoice-doc-type { text-align: right; }
.invoice-doc-type h1 { margin: 0; font-size: 28px; }
.invoice-doc-number { margin-top: 6px; color: var(--blue); font-size: 12px; font-weight: 800; }
.invoice-doc-info { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 28px 0; }
.invoice-block-label { margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.invoice-block-value { font-size: 12px; font-weight: 750; line-height: 1.55; white-space: pre-line; }
.invoice-lines { width: 100%; border-collapse: collapse; }
.invoice-lines th { padding: 11px 10px; color: white; background: var(--ink); font-size: 9px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.invoice-lines td { padding: 14px 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
.invoice-total-area { display: flex; justify-content: flex-end; padding-top: 22px; }
.invoice-totals { width: 280px; }
.total-row { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; color: var(--ink-soft); font-size: 11px; }
.total-row.final { margin-top: 7px; padding: 13px 0 0; border-top: 2px solid var(--ink); color: var(--ink); font-size: 14px; font-weight: 850; }
.invoice-doc-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; padding-top: 40px; margin-top: 35px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.55; }

.login-screen { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(430px, .95fr); min-height: 100vh; background: var(--surface); }
.login-visual { position: relative; display: flex; align-items: flex-end; padding: 70px; overflow: hidden; color: white; background: linear-gradient(140deg, #102033 0%, #183b6b 54%, #1684ad 100%); }
.login-visual::before, .login-visual::after { position: absolute; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: ""; }
.login-visual::before { top: -180px; right: -100px; }
.login-visual::after { right: -50px; bottom: -280px; }
.login-visual-content { position: relative; z-index: 1; max-width: 530px; }
.login-visual-logo { width: 225px; margin-bottom: 70px; filter: brightness(0) invert(1); }
.login-visual h1 { max-width: 530px; margin-bottom: 17px; color: white; font-size: clamp(34px, 4.4vw, 56px); }
.login-visual p { max-width: 450px; margin-bottom: 0; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.65; }
.login-features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.login-feature { padding: 8px 10px; border: 1px solid rgba(255,255,255,.17); border-radius: 8px; color: rgba(255,255,255,.85); background: rgba(255,255,255,.08); font-size: 10px; }
.login-form-side { display: grid; place-items: center; padding: 45px; }
.login-card { width: min(370px, 100%); }
.login-card h2 { margin-bottom: 9px; font-size: 27px; letter-spacing: -.04em; }
.login-card .lede { margin-bottom: 28px; }
.login-form { display: grid; gap: 15px; }
.login-footnote { margin: 18px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.login-footnote strong { color: var(--ink-soft); }

.mobile-bottom-nav { display: none; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 9px; max-width: min(380px, calc(100vw - 32px)); padding: 13px 15px; border: 1px solid #cde9de; border-radius: 11px; color: #0c704f; background: #effaf5; box-shadow: var(--shadow); font-size: 11px; font-weight: 750; animation: toast-in .2s ease; }
.toast.error { color: #a61e29; border-color: #ffd4d6; background: #fff5f5; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.hidden { display: none !important; }
.mobile-only { display: none; }
.no-print { }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 218px minmax(0,1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .page, .topbar { padding-left: 26px; padding-right: 26px; }
  .grid-2 { grid-template-columns: 1fr; }
  .report-editor-grid { grid-template-columns: 1fr; }
  .side-sticky { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .app-shell { display: block; padding-bottom: 67px; }
  .mobile-only { display: grid; }
  .sidebar { position: fixed; top: 0; left: -280px; width: 255px; transition: left .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .topbar { min-height: 67px; padding: 0 17px; }
  .topbar-actions .search-box { display: none; }
  .topbar-actions .icon-button { display: none; }
  .page { padding: 25px 17px 45px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .page-heading .button { width: 100%; }
  .metrics-grid, .invoice-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .data-table { min-width: 660px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar-left .search-box, .toolbar-left .filter-select { flex: 1; width: 100%; }
  .checkbox-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .mobile-bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); height: 67px; padding: 7px 4px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(17px); }
  .mobile-nav-item { display: grid; place-items: center; gap: 3px; border: 0; color: var(--muted); background: transparent; font-size: 9px; font-weight: 750; }
  .mobile-nav-item.active { color: var(--blue); }
  .mobile-nav-item svg { width: 18px; height: 18px; }
  .brand { margin-bottom: 22px; }
  .login-screen { display: block; }
  .login-visual { min-height: 320px; padding: 35px 25px; align-items: flex-end; }
  .login-visual-logo { width: 170px; margin-bottom: 40px; }
  .login-visual h1 { font-size: 34px; }
  .login-visual p { font-size: 12px; }
  .login-features { display: none; }
  .login-form-side { min-height: 480px; padding: 38px 25px; }
  .invoice-document { padding: 20px; }
}
@media (max-width: 480px) {
  .metrics-grid { gap: 9px; }
  .metric-card { min-height: 105px; padding: 13px; }
  .metric-value { margin-top: 10px; font-size: 21px; }
  .metric-top { font-size: 10px; }
  .metric-foot { font-size: 9px; }
  .card-pad { padding: 15px; }
  .detail-grid { grid-template-columns: 1fr; }
  .side-sticky { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .button { flex: 1; }
  .invoice-doc-info { gap: 18px; }
  .invoice-doc-footer { grid-template-columns: 1fr; }
}

@media print {
  body { background: white; }
  .no-print, .sidebar, .topbar, .mobile-bottom-nav, #toast-region { display: none !important; }
  .app-shell { display: block; }
  .page { padding: 0; width: auto; }
  .card { border: 0; box-shadow: none; }
}
