/* BizSuite (KSN) — hand-rolled stylesheet, no external dependencies. */

:root {
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --green-50: #f0fdf4; --green-700: #15803d;
  --amber-50: #fffbeb; --amber-700: #b45309;
  --red-50: #fef2f2; --red-600: #dc2626; --red-700: #b91c1c;
  --blue-50: #eff6ff; --blue-700: #1d4ed8;
  --violet-50: #f5f3ff; --violet-700: #6d28d9;
  --radius: 0.6rem;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--slate-50);
  color: var(--slate-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--indigo-600); text-decoration: none; }
a:hover { color: var(--indigo-700); }
h1, h2, h3 { margin: 0; font-weight: 600; color: var(--slate-900); }
table { border-collapse: collapse; width: 100%; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 15rem; flex-shrink: 0; background: #fff; border-right: 1px solid var(--slate-200);
  display: flex; flex-direction: column;
}
.sidebar-brand {
  height: 4rem; display: flex; align-items: center; gap: 0.5rem; padding: 0 1.25rem;
  border-bottom: 1px solid var(--slate-200); font-weight: 600;
}
.brand-mark {
  height: 1.75rem; width: 1.75rem; border-radius: 0.4rem; background: var(--indigo-600); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem;
}
.sidebar-nav { flex: 1; padding: 1rem 0.75rem; display: flex; flex-direction: column; gap: 0.125rem; }
.sidebar-nav a, .sidebar-foot a {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem; border-radius: 0.5rem;
  color: var(--slate-600); font-weight: 500; font-size: 0.875rem;
}
.sidebar-nav a:hover, .sidebar-foot a:hover { background: var(--slate-100); color: var(--slate-900); }
.sidebar-nav a.active, .sidebar-foot a.active { background: var(--indigo-50); color: var(--indigo-700); }
.sidebar-foot { border-top: 1px solid var(--slate-200); padding: 0.75rem; }
.sidebar-foot .biz-name { padding: 0.4rem 0.75rem 0; font-size: 0.75rem; color: var(--slate-400); }
.biz-switcher { padding: 0.4rem 0.75rem 0; }
.biz-switcher select {
  width: 100%; border: 1px solid var(--slate-200); border-radius: 0.4rem; padding: 0.3rem 0.5rem;
  font-size: 0.75rem; font-family: inherit; color: var(--slate-600); background: var(--slate-50);
}
.biz-add-link { color: var(--indigo-600) !important; font-size: 0.8rem !important; padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; }

.settings-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--slate-200); margin-bottom: 1.5rem; }
.settings-tabs a { padding: 0.6rem 0.9rem; font-size: 0.875rem; font-weight: 500; color: var(--slate-500); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tabs a:hover { color: var(--slate-900); }
.settings-tabs a.active { color: var(--indigo-600); border-bottom-color: var(--indigo-600); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 4rem; background: #fff; border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: 0 1.5rem;
}
.topbar .who { color: var(--slate-500); font-size: 0.875rem; }
.topbar .who strong { color: var(--slate-700); }
main.content { flex: 1; padding: 2rem; max-width: 72rem; width: 100%; margin: 0 auto; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.25rem; }
.page-header p { margin: 0.15rem 0 0; color: var(--slate-500); font-size: 0.875rem; }
.page-header .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Cards */
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card.pad { padding: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 0.5rem; font-weight: 500; font-size: 0.875rem; padding: 0.5rem 1rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn-primary { background: var(--indigo-600); color: #fff; }
.btn-primary:hover { background: var(--indigo-700); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--slate-300); color: var(--slate-700); }
.btn-secondary:hover { background: var(--slate-50); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: var(--red-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--slate-600); }
.btn-ghost:hover { background: var(--slate-100); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8125rem; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* Forms */
label, .field-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--slate-700); margin-bottom: 0.25rem; }
input, select, textarea {
  width: 100%; border: 1px solid var(--slate-300); border-radius: 0.5rem; padding: 0.5rem 0.75rem;
  font-size: 0.875rem; font-family: inherit; color: var(--slate-900); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--indigo-600); outline-offset: 1px; border-color: var(--indigo-600); }
.field { margin-bottom: 1rem; }
.field .hint { font-size: 0.75rem; color: var(--slate-400); margin-top: 0.25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.required { color: var(--red-600); }
.error-text { color: var(--red-600); font-size: 0.875rem; margin: 0.5rem 0; }
.success-text { color: var(--green-700); font-size: 0.875rem; margin: 0.5rem 0; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 0.15rem 0.65rem;
  font-size: 0.75rem; font-weight: 500; text-transform: capitalize;
}
.badge-slate { background: var(--slate-100); color: var(--slate-700); }
.badge-green { background: var(--green-50); color: var(--green-700); }
.badge-amber { background: var(--amber-50); color: var(--amber-700); }
.badge-red { background: var(--red-50); color: var(--red-700); }
.badge-blue { background: var(--blue-50); color: var(--blue-700); }
.badge-violet { background: var(--violet-50); color: var(--violet-700); }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table { font-size: 0.875rem; }
.data-table thead { background: var(--slate-50); color: var(--slate-500); text-align: left; }
.data-table th, .data-table td { padding: 0.75rem 1rem; }
.data-table tbody tr { border-top: 1px solid var(--slate-100); }
.data-table tbody tr:hover { background: rgba(248,250,252,.7); }
.text-right { text-align: right; }
.data-table .name-cell { font-weight: 500; color: var(--slate-900); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1rem; }
.stat-icon { height: 2.25rem; width: 2.25rem; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.stat-label { margin-top: 0.75rem; font-size: 0.75rem; font-weight: 500; color: var(--slate-500); }
.stat-value { margin-top: 0.1rem; font-size: 1.25rem; font-weight: 600; color: var(--slate-900); }

/* Dashboard: hero banner */
.dash-hero {
  background: linear-gradient(135deg, var(--indigo-600), #7c3aed);
  border-radius: 1rem; padding: 2rem; margin-bottom: 1.75rem; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.dash-hero::before {
  content: ""; position: absolute; top: -45%; right: -6%; width: 20rem; height: 20rem;
  background: rgba(255,255,255,.08); border-radius: 50%; pointer-events: none;
}
.dash-hero::after {
  content: ""; position: absolute; bottom: -60%; right: 18%; width: 13rem; height: 13rem;
  background: rgba(255,255,255,.06); border-radius: 50%; pointer-events: none;
}
.dash-hero-text { position: relative; z-index: 1; }
.dash-hero h1 { color: #fff; font-size: 1.5rem; }
.dash-hero p { color: rgba(255,255,255,.85); margin: 0.35rem 0 0; font-size: 0.9rem; }
.dash-hero .actions { position: relative; z-index: 1; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.dash-hero .btn-primary { background: #fff; color: var(--indigo-700); }
.dash-hero .btn-primary:hover { background: var(--slate-50); color: var(--indigo-700); }
.dash-hero .btn-secondary { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); color: #fff; }
.dash-hero .btn-secondary:hover { background: rgba(255,255,255,.26); color: #fff; }

/* Dashboard: two-column rows (charts, recent activity) */
.dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }

/* Dashboard: bigger stat numbers + colored accent border + hover lift, scoped to the dashboard only */
.dash-stat-grid .stat-value { font-size: 1.4rem; }
.stat-card-accent {
  border-top: 3px solid var(--accent, var(--indigo-600));
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card-accent:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }

/* Dashboard: section-card hover lift */
.dash-card { transition: box-shadow .15s ease, transform .15s ease; }
.dash-card:hover { box-shadow: 0 10px 24px rgba(15,23,42,.06); }

/* Dashboard: stat delta badge */
.stat-value { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.stat-delta { font-size: 0.7rem; font-weight: 600; border-radius: 999px; padding: 0.05rem 0.4rem; }
.stat-delta.up { background: var(--green-50); color: var(--green-700); }
.stat-delta.down { background: var(--red-50); color: var(--red-700); }

/* Dashboard: bar chart (revenue trend) */
.bar-chart { display: flex; align-items: flex-end; gap: 0.75rem; height: 10rem; padding-top: 0.5rem; }
.bar-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-chart-bar {
  width: 100%; max-width: 2.5rem; background: linear-gradient(180deg, #818cf8, var(--indigo-600));
  border-radius: 0.4rem 0.4rem 0 0; min-height: 3px; transition: opacity .15s, transform .15s;
}
.bar-chart-bar:hover { opacity: 0.85; transform: scaleY(1.02); }
.bar-chart-label { margin-top: 0.5rem; font-size: 0.75rem; color: var(--slate-500); }

/* Dashboard: donut chart (invoice status) */
.donut-wrap { position: relative; width: 9rem; height: 9rem; margin: 0 auto; }
.donut-chart { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center-value { font-size: 1.5rem; font-weight: 700; color: var(--slate-900); line-height: 1; }
.donut-center-label { font-size: 0.75rem; color: var(--slate-500); margin-top: 0.15rem; }
.donut-legend { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.donut-legend-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; }
.donut-legend-dot { height: 0.55rem; width: 0.55rem; border-radius: 999px; flex-shrink: 0; }
.donut-legend-name { flex: 1; color: var(--slate-600); text-transform: capitalize; }
.donut-legend-count { font-weight: 600; color: var(--slate-900); }

/* Dashboard: top clients list */
.top-clients-list { display: flex; flex-direction: column; gap: 0.9rem; }
.top-client-row { display: block; color: inherit; }
.top-client-row:hover .top-client-name { color: var(--indigo-600); }
.top-client-info { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.8125rem; margin-bottom: 0.3rem; }
.top-client-name { font-weight: 500; color: var(--slate-900); }
.top-client-amount { color: var(--slate-500); }
.top-client-bar-track { background: var(--slate-100); border-radius: 999px; height: 0.35rem; overflow: hidden; }
.top-client-bar-fill { background: linear-gradient(90deg, var(--indigo-600), #7c3aed); height: 100%; border-radius: 999px; }

/* Dashboard: quick actions */
.quick-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid var(--slate-200); border-radius: 0.6rem; padding: 0.9rem 0.5rem;
  color: var(--slate-700); font-size: 0.8125rem; font-weight: 500; text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.quick-action:hover { border-color: var(--indigo-100); color: var(--indigo-700); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15,23,42,.08); }
.quick-action-icon { height: 2.25rem; width: 2.25rem; border-radius: 0.6rem; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* SAC/GST reference help */
.sac-help-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 1.1rem; width: 1.1rem;
  border-radius: 999px; border: none; background: var(--indigo-100); color: var(--indigo-700);
  font-size: 0.7rem; line-height: 1; cursor: pointer; vertical-align: middle; margin-left: 0.2rem; padding: 0;
}
.sac-help-btn:hover { background: var(--indigo-600); color: #fff; }
.sac-modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center;
  justify-content: center; padding: 1.5rem; z-index: 100;
}
.sac-modal-overlay[hidden] { display: none; }
.sac-modal {
  background: #fff; border-radius: var(--radius); max-width: 42rem; width: 100%; max-height: 85vh;
  overflow-y: auto; padding: 1.5rem; box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.sac-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.sac-modal-head h3 { font-size: 1rem; }
.sac-modal-close {
  border: none; background: var(--slate-100); color: var(--slate-600); border-radius: 999px;
  height: 1.75rem; width: 1.75rem; cursor: pointer; font-size: 0.85rem; flex-shrink: 0;
}
.sac-modal-close:hover { background: var(--slate-200); }
.sac-modal-note { color: var(--slate-500); font-size: 0.8125rem; margin: 0 0 1rem; }
.sac-ref-table th, .sac-ref-table td { font-size: 0.8125rem; }

/* Empty state */
.empty-state {
  border: 1px dashed var(--slate-300); border-radius: var(--radius); background: rgba(248,250,252,.5);
  padding: 4rem 1.5rem; text-align: center;
}
.empty-state h3 { font-size: 0.9rem; }
.empty-state p { color: var(--slate-500); max-width: 26rem; margin: 0.4rem auto 0; }

/* Line item editor */
.items-table input, .items-table select, .items-table textarea { font-size: 0.875rem; font-family: inherit; }
.items-table th, .items-table td { padding: 0.5rem 0.6rem; vertical-align: top; }
.items-table textarea.f-desc { width: 100%; resize: vertical; min-height: 2.4rem; line-height: 1.4; }
.totals-box { max-width: 20rem; margin-left: auto; font-size: 0.875rem; }
.totals-box .row { display: flex; justify-content: space-between; padding: 0.2rem 0; color: var(--slate-500); }
.totals-box .row.grand { border-top: 1px solid var(--slate-200); margin-top: 0.4rem; padding-top: 0.6rem; font-weight: 600; font-size: 1rem; color: var(--slate-900); }
.totals-box .row.paid { color: var(--green-700); }
.totals-box input { text-align: right; width: 7rem; display: inline-block; }

/* Kanban / leads board */
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.board-col h3 { font-size: 0.875rem; color: var(--slate-700); }
.board-col-head { display: flex; justify-content: space-between; margin-bottom: 0.5rem; padding: 0 0.1rem; }
.board-col-head span { font-size: 0.75rem; color: var(--slate-400); }
.lead-card { background: #fff; border: 1px solid var(--slate-200); border-radius: 0.5rem; padding: 0.75rem; margin-bottom: 0.5rem; }
.lead-card .name { font-weight: 500; color: var(--slate-900); font-size: 0.875rem; }
.lead-card .company { font-size: 0.75rem; color: var(--slate-500); }
.lead-card select { font-size: 0.75rem; padding: 0.3rem 0.5rem; margin-top: 0.5rem; }
.lead-card-actions { display: flex; gap: 0.5rem; }
.board-empty { border: 1px dashed var(--slate-200); border-radius: 0.5rem; padding: 0.75rem; text-align: center; font-size: 0.75rem; color: var(--slate-400); }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-box { width: 100%; max-width: 24rem; }
.auth-logo { text-align: center; margin-bottom: 1.5rem; font-weight: 600; }
.auth-foot { text-align: center; font-size: 0.875rem; color: var(--slate-500); margin-top: 1rem; }

/* Landing page */
.nav-public { height: 4rem; border-bottom: 1px solid var(--slate-200); background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; }
.hero { max-width: 60rem; margin: 0 auto; padding: 5rem 1.5rem; text-align: center; }
.hero .eyebrow { display: inline-flex; background: var(--indigo-50); color: var(--indigo-700); padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; }
.hero h1 { font-size: 2.5rem; margin-top: 1.25rem; letter-spacing: -0.5px; }
.hero p { color: var(--slate-600); font-size: 1.1rem; max-width: 40rem; margin: 1rem auto 0; }
.hero .cta { margin-top: 2rem; display: flex; gap: 0.75rem; justify-content: center; }
.feature-grid { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem 6rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.feature-card { border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; padding: 1.25rem; }
.feature-card .icon { height: 2.5rem; width: 2.5rem; border-radius: 0.5rem; background: var(--indigo-50); color: var(--indigo-600); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.feature-card h3 { margin-top: 1rem; font-size: 1rem; }
.feature-card p { color: var(--slate-500); margin: 0.25rem 0 0; }

/* Invoice/quote document view */
.doc-parties { display: flex; justify-content: space-between; gap: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--slate-100); flex-wrap: wrap; }
.doc-parties .label { font-size: 0.7rem; font-weight: 600; color: var(--slate-400); text-transform: uppercase; letter-spacing: 0.03em; }
.print-header { display: none; }

/* Tax invoice print layout — bordered-box style GST tax invoice */
.tax-invoice { border: 1px solid var(--slate-900); font-size: 0.8rem; color: var(--slate-900); }
.tax-invoice .ti-title { text-align: center; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.04em; padding: 0.5rem; border-bottom: 1px solid var(--slate-900); text-transform: uppercase; }
.tax-invoice .ti-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--slate-900); }
.tax-invoice .ti-meta > div { padding: 0.5rem 0.75rem; }
.tax-invoice .ti-meta > div + div { border-left: 1px solid var(--slate-900); }
.tax-invoice .ti-meta .ti-label { font-size: 0.68rem; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.03em; }
.tax-invoice .ti-meta .ti-value { margin-top: 0.15rem; font-weight: 600; }
.tax-invoice .ti-parties { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--slate-900); }
.tax-invoice .ti-parties > div { padding: 0.6rem 0.75rem; }
.tax-invoice .ti-parties > div + div { border-left: 1px solid var(--slate-900); }
.tax-invoice .ti-parties .ti-label { font-size: 0.68rem; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.25rem; }
.tax-invoice .ti-parties .ti-name { font-weight: 700; }
.tax-invoice .ti-parties p { margin: 0.1rem 0; color: var(--slate-600); }
.tax-invoice table.ti-items { width: 100%; border-collapse: collapse; border-bottom: 1px solid var(--slate-900); }
.tax-invoice table.ti-items th, .tax-invoice table.ti-items td { border: 1px solid var(--slate-300); border-top: none; border-bottom: none; padding: 0.4rem 0.5rem; font-size: 0.78rem; vertical-align: top; }
.tax-invoice table.ti-items thead th { border-top: none; border-bottom: 1px solid var(--slate-900); background: var(--slate-50); font-weight: 600; text-align: left; }
.tax-invoice table.ti-items thead th:first-child, .tax-invoice table.ti-items tbody td:first-child { border-left: none; }
.tax-invoice table.ti-items thead th:last-child, .tax-invoice table.ti-items tbody td:last-child { border-right: none; }
.tax-invoice table.ti-items tbody tr:last-child td { border-bottom: none; }
.tax-invoice table.ti-items .ti-desc { white-space: pre-wrap; }
.tax-invoice table.ti-items .ti-num { text-align: right; white-space: nowrap; }
.tax-invoice .ti-totals-wrap { display: flex; justify-content: flex-end; border-bottom: 1px solid var(--slate-900); }
.tax-invoice .ti-totals { width: 16rem; }
.tax-invoice .ti-totals .row { display: flex; justify-content: space-between; padding: 0.35rem 0.75rem; border-top: 1px solid var(--slate-200); }
.tax-invoice .ti-totals .row:first-child { border-top: none; }
.tax-invoice .ti-totals .row.grand { border-top: 1px solid var(--slate-900); font-weight: 700; font-size: 0.9rem; }
.tax-invoice .ti-words { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--slate-900); font-size: 0.78rem; }
.tax-invoice .ti-words strong { font-weight: 600; }
.tax-invoice .ti-bottom { display: grid; grid-template-columns: 1fr 1fr; }
.tax-invoice .ti-bottom > div { padding: 0.6rem 0.75rem; }
.tax-invoice .ti-bottom > div + div { border-left: 1px solid var(--slate-900); }
.tax-invoice .ti-bottom .ti-label { font-size: 0.68rem; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.25rem; }
.tax-invoice .ti-bottom p { margin: 0.1rem 0; color: var(--slate-600); }
.tax-invoice .ti-footer { text-align: center; padding: 0.5rem; border-top: 1px solid var(--slate-900); font-size: 0.72rem; color: var(--slate-500); font-style: italic; }
@media (max-width: 640px) {
  .tax-invoice .ti-meta, .tax-invoice .ti-parties, .tax-invoice .ti-bottom { grid-template-columns: 1fr; }
  .tax-invoice .ti-meta > div + div, .tax-invoice .ti-parties > div + div, .tax-invoice .ti-bottom > div + div { border-left: none; border-top: 1px solid var(--slate-900); }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  main.content { max-width: 100%; padding: 0; }
  .card { border: none; box-shadow: none; }
}

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .board { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .doc-parties { flex-direction: column; }
  .quick-actions-grid { grid-template-columns: 1fr 1fr; }
}
