/* Taxon web, after the Taxon v2 document: always light (no dark theme), white surfaces, deep green actions, a light sidebar with the menu, the home
   page as tiles. Colors are taken from the document's pictures. */
:root {
  --bg: #ffffff; --surface: #ffffff; --sidebar: #f8f9fa; --text: #0b132b; --text-2: #2f3a50; --muted: #6b7385;
  --border: #e8ebf0; --border-strong: #d7dce3;
  --primary: #087a2c; --primary-strong: #05631f; --primary-soft: #dcf2e2; --primary-tint: #ecfaef; --primary-ink: #ffffff;
  --accent: #22a83a;
  --navy: #0f2f63; --navy-ink: #ffffff; --link: #1d4ed8;
  --blue: #1d56d8; --blue-strong: #1746b5; --blue-soft: #e8effd;
  --danger: #dc2626; --danger-soft: #fdeceb; --warn: #ea580c; --warn-soft: #fff1e4; --ok: #15803d; --ok-soft: #dcf7e4;
  --info: #2563eb; --info-soft: #e7eefe; --head: #f6f8fa; --total: #e3edfb;
  --radius: 12px; --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .03);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--link); }
h1 { font-size: 32px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 17px; margin: 0 0 14px; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 8px; }
hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 12px; }
.error { color: var(--danger); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.req::after { content: " *"; color: var(--danger); }

/* ---------- Controls ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  min-height: 42px;
}
select { padding-right: 32px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7385' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
input::placeholder, textarea::placeholder { color: #9aa3b2; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 84px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: var(--text-2); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; min-height: 42px; }
label.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
button {
  cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); padding: 9px 16px; border-radius: 10px;
  font-weight: 600; display: inline-flex; align-items: center; gap: 8px; justify-content: center; min-height: 42px;
  color: var(--text);
}
button:hover { background: var(--head); }
button:disabled { opacity: .6; cursor: progress; }
button .ico { width: 18px; height: 18px; }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
button.primary:hover { background: var(--primary-strong); }
button.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
button.blue:hover { background: var(--blue-strong); }
button.navy { background: var(--navy); border-color: var(--navy); color: var(--navy-ink); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--head); }
button.danger { color: var(--danger); }
button.small { padding: 4px 10px; font-size: 12px; min-height: 30px; border-radius: 8px; }
button.link { background: none; border: none; padding: 0; min-height: 0; color: var(--link); font-weight: 500; text-decoration: underline; }
input[readonly] { background: var(--head); color: var(--muted); }

.logo { width: 34px; height: 34px; flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 26px; color: var(--text); text-decoration: none; letter-spacing: -.02em; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; overflow-y: auto;
  padding: 26px 18px 20px; background: var(--sidebar); border-right: 1px solid var(--border);
}
.sidebar .brand { padding: 0 10px; }
.sidenav { display: grid; gap: 6px; flex: 1; align-content: start; }
.sidenav a, .nav-parent {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; color: var(--text-2);
  text-decoration: none; font-weight: 500; font-size: 15px; width: 100%; min-height: 0; border: none; background: transparent;
  justify-content: flex-start; text-align: left;
}
.sidenav a:hover, .nav-parent:hover { background: #eef1f4; }
.sidenav a.active, .nav-parent.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-parent .chevron { margin-left: auto; width: 16px; height: 16px; transition: transform .15s; }
.nav-parent[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.nav-children { display: grid; gap: 2px; margin: 4px 0 4px 24px; padding-left: 8px; border-left: 2px solid var(--border); }
.nav-children a { padding: 8px 10px; font-size: 14px; border-radius: 10px; }
.nav-children a.active { background: var(--primary-tint); color: var(--primary); font-weight: 700; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.biz-card { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.biz-name { font-weight: 700; overflow-wrap: anywhere; }
.branch-picker { gap: 2px; margin-top: 6px; }
.branch-picker select { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-weight: 600; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 40px 0; min-height: 68px; }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; font-size: 20px; padding: 4px 10px; }
.top-brand, .top-only { display: none; }
.biz-pill { align-items: center; gap: 10px; border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px 8px 6px 14px; background: var(--surface); min-height: 46px; }
.biz-pill .branch-picker { margin: 0; }
.biz-pill .branch-picker select { min-height: 32px; }
.sync-btn { border-radius: 999px; background: var(--ok-soft); border-color: transparent; color: var(--ok); padding: 8px 16px; }
.sync-btn:hover { background: #c9f0d5; }
.sync-btn.bad { background: var(--danger-soft); color: var(--danger); }
/* While the data is being read: a spinner next to the text, until the answer comes. */
.sync-btn .spinner { display: none; width: 16px; height: 16px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.sync-btn.busy .spinner { display: inline-block; }
.sync-btn:disabled { opacity: 1; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast.ok { background: var(--ok); color: #fff; }
.user-menu { position: relative; }
.avatar { width: 46px; height: 46px; min-height: 46px; border-radius: 50%; padding: 0; background: #e8ecf0; border: none; color: var(--text-2); }
.avatar:hover { background: #dde2e8; }
.user-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; width: 260px; padding: 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); display: grid; gap: 2px;
}
.user-name { font-weight: 700; }
.menu-item { justify-content: flex-start; border: none; background: transparent; min-height: 38px; padding: 8px 10px; font-weight: 500; }
.menu-item:hover { background: var(--head); }
main { padding: 8px 40px 56px; width: 100%; max-width: 1480px; }
main:focus { outline: none; }

/* Home: no sidebar, the brand and the business in the bar, tiles in the middle. */
.is-home .shell { grid-template-columns: minmax(0, 1fr); }
.is-home .sidebar { display: none; }
.is-home .top-brand { display: flex; }
.is-home .top-only { display: flex; }
.is-home .topbar { padding: 26px 64px 0; }
.is-home main { padding: 40px 64px 64px; max-width: 1440px; margin: 0 auto; }

/* ---------- Sign-in ---------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--sidebar); }
.card.login-card { width: 100%; max-width: 420px; display: grid; gap: 16px; padding: 32px 28px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-card button[type=submit] { width: 100%; }
.login-card .form-error { margin-top: 0; }

/* ---------- Page parts ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head .muted { font-size: 16px; }
.page-head > div:first-child { flex: 1 1 0; min-width: min(100%, 320px); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; flex: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 18px; }
.welcome h1 { font-size: 34px; margin-bottom: 6px; }
.welcome p { font-size: 17px; color: var(--muted); margin: 0 0 32px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 30px; }
.kpi { display: flex; gap: 18px; align-items: center; padding: 20px 22px; }
.kpi .kpi-ico { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.kpi .kpi-ico .ico { width: 28px; height: 28px; }
.kpi .value { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.kpi .label { color: var(--text-2); font-size: 14px; }
.tone-ok .kpi-ico { background: var(--ok-soft); color: var(--ok); }
.tone-warn .kpi-ico { background: var(--warn-soft); color: var(--warn); }
.tone-bad .kpi-ico { background: var(--danger-soft); color: var(--danger); }
.tone-info .kpi-ico { background: var(--info-soft); color: var(--info); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile {
  display: grid; place-items: center; align-content: center; gap: 12px; min-height: 148px; padding: 20px 16px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700;
  font-size: 19px; letter-spacing: -.01em; box-shadow: var(--shadow); transition: background .15s, border-color .15s;
}
.tile:hover, .tile:focus-visible { border-color: #bfe8c9; background: var(--primary-tint); }
.tile .ico { width: 46px; height: 46px; color: var(--accent); stroke-width: 1.5; }

/* The tabs scroll sideways on a narrow screen, without a scrollbar; the grey line is a shadow, so no tab sticks out of
   the box and no vertical scrollbar appears next to the tabs. */
.tabs { display: flex; gap: 8px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 22px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 12px 22px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary); border-color: var(--primary); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.toolbar .grow { flex: 1; min-width: 220px; }
.toolbar label { min-width: 150px; }
.toolbar .spacer { flex: 1; }
.toolbar > select { width: auto; min-width: 200px; }
.toolbar label.inline { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.toolbar label.inline input { width: auto; }
.toolbar .search.grow { min-width: 260px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.search { position: relative; display: block; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 42px; }

.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
.filter-card { background: #f9fafb; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 22px; }
.filter-card .filters { grid-template-columns: 200px 200px 200px minmax(200px, 260px) auto; justify-content: start; }
.filter-card .filters.report-filters { grid-template-columns: 200px minmax(260px, 380px) auto; }
.report td.name-cell { min-width: 200px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { background: var(--head); font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
thead th.group { text-align: center; border-left: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f7faf8; }
tfoot td { background: var(--total); font-weight: 800; border-bottom: none; }
.book th, .book td { border-left: 1px solid var(--border); }
.book th:first-child, .book td:first-child { border-left: none; }
.book th { text-align: center; white-space: normal; }
.book th, .book td { padding: 9px 10px; font-size: 13px; }
.book th { font-size: 12px; }
.book thead tr:nth-child(2) th { min-width: 88px; }
.book td a, .book .doc-no { color: var(--link); }
.empty { padding: 36px; text-align: center; color: var(--muted); }

.products-table td { padding-top: 12px; padding-bottom: 12px; }
.prod { display: flex; align-items: center; gap: 14px; min-width: 220px; }
.prod-thumb { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 16px; }
.prod-name { font-weight: 700; }
.prod .sub { color: var(--muted); font-size: 12px; }
.thumb-0 { background: #fdf0e6; color: #b45309; } .thumb-1 { background: #fde8ef; color: #be185d; } .thumb-2 { background: #e6f6ee; color: #15803d; }
.thumb-3 { background: #fff4dc; color: #a16207; } .thumb-4 { background: #e8effd; color: #1d4ed8; } .thumb-5 { background: #f1e9fd; color: #7e22ce; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--head); color: var(--muted); }
.qty-warn { color: var(--warn); font-weight: 700; }
.qty-bad { color: var(--danger); font-weight: 700; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pager .info { color: var(--text-2); font-size: 14px; }
.pager .pages { display: flex; gap: 8px; align-items: center; }
.pager button { min-width: 40px; min-height: 40px; padding: 6px 10px; border-radius: 10px; font-weight: 600; }
.pager button.current { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 18px; align-items: start; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.lines td { padding: 8px 10px; }
.lines input, .lines select { padding: 8px 10px; min-height: 38px; }
.lines .w-qty { width: 110px; } .lines .w-price { width: 130px; } .lines .w-vat { width: 116px; } .lines .w-disc { width: 104px; }
.lines .w-total { width: 120px; font-weight: 700; } .lines .w-del { width: 48px; }
.lines .w-del button { color: var(--danger); }
.doc-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.totals { display: grid; gap: 10px; font-size: 15px; }
.totals .row { display: flex; justify-content: space-between; }
.totals .grand { border-top: 1px solid var(--border-strong); padding-top: 14px; margin-top: 4px; font-size: 21px; font-weight: 800; align-items: baseline; }
.totals .grand span:last-child { color: var(--blue); font-size: 30px; }
.form-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; align-items: center; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--text); }
.notice.info { background: var(--info-soft); }
.secret { font-family: ui-monospace, Consolas, monospace; background: var(--head); padding: 10px 12px; border-radius: 8px; word-break: break-all; }
.doc-form h1 { margin-bottom: 18px; }
.line-actions { display: flex; gap: 14px; margin: 24px 0 14px; align-items: center; flex-wrap: wrap; }
.branch-cell { align-self: end; padding-bottom: 8px; }
.tile span { text-align: center; }
.branch-note { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--primary-tint); color: var(--primary); font-weight: 600; font-size: 13px; }
.pct { display: flex; align-items: center; gap: 6px; }
.pct::after { content: "%"; display: grid; place-items: center; width: 30px; height: 36px; border-radius: 8px; background: var(--head); color: var(--text-2); font-weight: 700; flex: none; }

/* Autocomplete (supplier / product pickers). The list is placed by app.js, fixed to the viewport. */
.picker { display: block; position: relative; }
.picker-list {
  position: fixed; z-index: 70; max-height: 300px; overflow-y: auto; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.picker-list .empty { padding: 12px; }
.picker-list button {
  display: flex; width: 100%; justify-content: space-between; gap: 12px; border: none; border-radius: 0; text-align: left;
  font-weight: 500; padding: 10px 14px; background: transparent; min-height: 0;
}
.picker-list button:hover, .picker-list button.active { background: var(--primary-tint); }
.picker-list .sub { color: var(--muted); font-size: 12px; }

/* Links that look like buttons, composite fields, errors */
a.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; min-height: 42px;
}
a.btn:hover { background: var(--head); }
a.btn .ico { width: 18px; height: 18px; }
a.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
a.btn.primary:hover { background: var(--primary-strong); }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 13px; align-content: start; color: var(--text-2); }
.field label { display: block; }
.mt { margin-top: 18px; }
.form-actions .spacer { flex: 1; }
.card .toolbar:last-child { margin-bottom: 0; }
[aria-invalid="true"] { border-color: var(--danger) !important; outline-color: var(--danger); }
.field-error { font-weight: 500; }
.form-error { margin-top: 16px; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.form-error:empty { display: none; }
.lines .w-product { min-width: 280px; } .lines .w-article { min-width: 320px; } .lines .w-desc { min-width: 180px; } .lines .w-unit { width: 90px; }
.lines td .field-error { display: block; margin-top: 2px; white-space: normal; }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell button + button { margin-left: 4px; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--danger); font-weight: 600; }
.print-only { display: none; }

/* Sales document and books */
.doc-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 20px; }
.doc-meta { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-meta > div { display: grid; gap: 2px; }
.book-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.vat-summary { max-width: 560px; }
.excel-ico { color: #1d6f42; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--head); padding: 2px 6px; border-radius: 6px; }

/* ---------- Modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 26, .45); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(680px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 16px; padding: 22px 26px 26px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 60; max-width: min(440px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); }
.toast.bad { background: var(--danger); color: #fff; }

@media (max-width: 1200px) {
  .kpis, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters, .filter-card .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-bottom { grid-template-columns: minmax(0, 1fr); }
  .tile { min-height: 132px; font-size: 18px; }
  .welcome h1 { font-size: 30px; }
}
@media (max-width: 860px) {
  .shell, .is-home .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; left: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .is-home .sidebar { display: flex; }
  .menu-toggle { display: inline-flex; }
  .top-brand { display: flex; font-size: 22px; }
  .top-brand .logo { width: 28px; height: 28px; }
  .is-home .top-only { display: none; }
  .topbar, .is-home .topbar { padding: 12px 16px 0; min-height: 60px; gap: 8px; }
  .sync-btn .label { display: none; }
  .sync-btn.busy .ico { display: none; }
  .sync-btn { padding: 8px 12px; }
  main, .is-home main { padding: 8px 16px 40px; }
  h1 { font-size: 26px; }
  .welcome h1 { font-size: 26px; }
  .welcome p { font-size: 15px; margin-bottom: 22px; }
  .tiles { gap: 12px; }
  .tile { min-height: 112px; font-size: 16px; gap: 10px; padding: 16px 12px; }
  .tile .ico { width: 36px; height: 36px; }
  .form-grid, .filters, .filter-card .filters, .filter-card .filters.report-filters, .doc-parties { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi .kpi-ico { width: 40px; height: 40px; }
  .kpi .kpi-ico .ico { width: 20px; height: 20px; }
  .kpi .value { font-size: 22px; }
  .kpi .label { font-size: 13px; }
  .modal .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
}
@media print {
  .sidebar, .topbar, .no-print, .pager, .toast, .picker-list { display: none !important; }
  .print-only { display: block; }
  .card, .filter-card { border: none; box-shadow: none; padding: 0; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .table-wrap { border: none; overflow: visible; box-shadow: none; }
  body { background: #fff; color: #000; }
}

/* Përdoruesit (moduli i administratorit) */
.preview { margin: 0; }
.users-table td .muted.small { display: block; }
.hint.ok { color: var(--ok); }
.hint.error { color: var(--danger); }
