:root {
  --navy: #0f2a44;
  --navy-2: #163757;
  --navy-3: #1e4468;
  --teal: #0d9488;
  --teal-2: #14b8a6;
  --teal-soft: #e6f6f4;
  --bg: #f3f6f9;
  --card: #ffffff;
  --line: #e2e8ef;
  --line-2: #eef2f6;
  --text: #13253a;
  --muted: #607286;
  --ok: #15803d;
  --ok-soft: #e8f6ed;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --info: #1d4ed8;
  --info-soft: #e8efff;
  --violet: #6d28d9;
  --violet-soft: #f1ebfd;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 42, 68, .06), 0 2px 8px rgba(15, 42, 68, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }

.demobar { background: #fff8e6; color: #7a5300; border-bottom: 1px solid #f2e2b8; text-align: center; font-size: 12.5px; padding: 6px 12px; }

.app { display: flex; min-height: calc(100vh - 31px); }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--navy); color: #cfdbe8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 16px; text-decoration: none; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 19px; letter-spacing: .3px; }
.brand-text small { font-size: 11px; color: #8fb0cc; line-height: 1.3; }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #cfdbe8; text-decoration: none; font-size: 13.5px; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.active { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--teal-2); }
.nav a svg { flex: 0 0 18px; opacity: .85; }
.nav .nav-sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 6px; }
.nav .badge-n { margin-left: auto; background: var(--teal-2); color: var(--navy); font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 7px; }
.sidebar-foot { padding: 12px 14px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-note { font-size: 11px; color: #7f9cb8; margin-top: 8px; }
.btn-ghost-light { background: transparent; border: 1px solid rgba(255,255,255,.2); color: #dbe6f1; border-radius: 8px; padding: 6px 10px; cursor: pointer; width: 100%; font-size: 13px; }
.btn-ghost-light:hover { background: var(--navy-2); }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 22px; min-height: 56px; }
.topbar h1 { font-size: 18px; font-weight: 650; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hamburger { display: none; background: none; border: 0; padding: 4px; cursor: pointer; color: var(--navy); }
.top-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.seg button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.view { padding: 22px; max-width: 1400px; width: 100%; }

.scrim { display: none; }

/* cards & layout */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card h3 { font-size: 14.5px; font-weight: 650; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 .right { margin-left: auto; font-weight: 500; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.page-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 760px; }

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); }
.kpi .val { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .up { color: var(--ok); font-weight: 600; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 550; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #c6d2de; background: #fafcfd; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: #0b7f75; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font-weight: 550; font-size: inherit; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-teal { background: var(--teal-soft); color: var(--teal); }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.b-navy { background: var(--navy); color: #fff; }

/* tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; background: #f8fafc; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f6fafb; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* alerts list */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fbfcfd; cursor: pointer; text-align: left; width: 100%; }
.alert:hover { border-color: #c9d6e2; }
.alert .ic { flex: 0 0 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.alert .t { font-weight: 600; font-size: 13px; }
.alert .d { font-size: 12.5px; color: var(--muted); }
.ic-ai { background: var(--violet-soft); color: var(--violet); }
.ic-warn { background: var(--warn-soft); color: var(--warn); }
.ic-bad { background: var(--bad-soft); color: var(--bad); }
.ic-ok { background: var(--ok-soft); color: var(--ok); }

/* progress bars */
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal-2); border-radius: 99px; }
.bar.warn > i { background: #f59e0b; }
.bar.bad > i { background: #ef4444; }
.load-row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: #eaf0f5; border-radius: var(--radius); padding: 10px; min-width: 0; }
.kcol h4 { font-size: 13px; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.kcol h4 .cnt { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: 0 1px 1px rgba(15,42,68,.04); }
.kcard .nm { font-weight: 650; font-size: 13px; }
.kcard .sv { font-size: 12.5px; color: var(--muted); margin: 3px 0 6px; }
.kcard .meta { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.kcard select { width: 100%; margin-top: 8px; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.kcard.fresh { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }
.night { background: #1e293b; color: #e2e8f0; }

/* forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea, .input { border: 1px solid #cfd9e3; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; min-width: 0; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 2px solid rgba(20,184,166,.35); border-color: var(--teal-2); }
.field textarea { min-height: 70px; resize: vertical; }

/* chips / filters */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* checklist */
.check { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { width: 17px; height: 17px; accent-color: var(--teal); }
.check.done span { color: var(--muted); text-decoration: line-through; }

.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.instr { background: #fffbeb; border: 1px solid #f6e3a7; border-radius: 8px; padding: 10px 12px; font-size: 13px; }

.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: 0 0 28px; }
.person { display: inline-flex; align-items: center; gap: 8px; }

.comment { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.comment b { font-weight: 600; }

/* photos */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ph { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); position: relative; background: #f1f5f9; }
.ph svg { display: block; width: 100%; height: auto; }
.ph .cap { position: absolute; left: 6px; top: 6px; background: rgba(15,42,68,.8); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 5px; }
.ph .res { position: absolute; right: 6px; bottom: 6px; }
.ph.flag { outline: 3px solid #f59e0b; outline-offset: -3px; }
.scan { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, rgba(20,184,166,.35) 50%, transparent 100%); background-size: 100% 40%; background-repeat: no-repeat; animation: scan 1.1s linear infinite; }
@keyframes scan { from { background-position: 0 -40%; } to { background-position: 0 140%; } }
.ai-result { display: flex; flex-direction: column; gap: 6px; }
.ai-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #f8fafc; font-size: 13px; }
.ai-row.ok { background: var(--ok-soft); }
.ai-row.warn { background: var(--warn-soft); }
.score-ring { display: flex; align-items: center; gap: 12px; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.spinner.dark { border-color: rgba(13,148,136,.25); border-top-color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }

/* calendar */
.cal { display: grid; grid-template-columns: 150px repeat(6, minmax(130px, 1fr)); min-width: 940px; }
.cal > div { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; min-height: 74px; }
.cal .hd { background: #f8fafc; font-weight: 600; font-size: 12px; color: var(--muted); min-height: 0; padding: 8px; }
.cal .hd.today { color: var(--teal); }
.cal .pt { font-size: 12.5px; }
.cal .pt b { display: block; font-size: 13px; }
.blk { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--teal-2); background: var(--teal-soft); border-radius: 6px; padding: 5px 7px; margin-bottom: 5px; font-size: 11.5px; cursor: pointer; color: var(--text); }
.blk b { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.blk.p-A { border-color: #0d9488; background: #e6f6f4; }
.blk.p-B { border-color: #2563eb; background: #eaf0fe; }
.blk.p-C { border-color: #7c3aed; background: #f2edfd; }
.blk.p-D { border-color: #db2777; background: #fdebf3; }
.blk.p-E { border-color: #d97706; background: #fdf3e2; }

/* stepper */
.stepper { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.step { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-weight: 700; font-size: 11.5px; }
.step.cur { border-color: var(--teal-2); color: var(--text); font-weight: 600; }
.step.cur .n { background: var(--teal); color: #fff; }
.step.done .n { background: var(--ok-soft); color: var(--ok); }

.doc { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; background: #fff; }
.doc .ico { width: 32px; height: 38px; border-radius: 4px; background: #eef4fa; display: grid; place-items: center; color: var(--navy); font-size: 10px; font-weight: 700; flex: 0 0 32px; border: 1px solid #d6e1ec; }

.lesson { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.lesson .vid { background: linear-gradient(135deg, #0f2a44, #1e4468); aspect-ratio: 16/9; display: grid; place-items: center; position: relative; }
.lesson .vid .dur { position: absolute; right: 8px; bottom: 6px; color: #fff; font-size: 11px; background: rgba(0,0,0,.4); padding: 1px 6px; border-radius: 4px; }
.lesson .bd { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

/* signature */
.sig-wrap { border: 1px dashed #b7c6d4; border-radius: 10px; background: #fff; position: relative; }
.sig-wrap canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.sig-wrap .hint { position: absolute; left: 12px; bottom: 8px; font-size: 12px; color: #9aaabb; pointer-events: none; }
.stars { display: flex; gap: 4px; }
.stars button { background: none; border: 0; font-size: 30px; cursor: pointer; color: #d4dce4; padding: 0 2px; line-height: 1; }
.stars button.on { color: #f59e0b; }

/* invoice */
.invoice { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 26px; box-shadow: 0 6px 24px rgba(15,42,68,.08); max-width: 760px; font-size: 13px; }
.invoice h2 { font-size: 20px; }
.invoice .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 16px 0; }
.invoice .tot { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-top: 14px; flex-wrap: wrap; }
.invoice .sum { min-width: 220px; }
.invoice .sum div { display: flex; justify-content: space-between; padding: 3px 0; }
.invoice .sum .grand { font-weight: 700; font-size: 16px; border-top: 2px solid var(--navy); margin-top: 4px; padding-top: 6px; }

/* charts */
.chart svg { display: block; width: 100%; height: auto; }
.hbar { display: grid; grid-template-columns: 140px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* phone */
.phone-stage { display: flex; gap: 28px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.phone { width: 360px; max-width: 100%; height: 720px; background: #0b1724; border-radius: 42px; padding: 12px; box-shadow: 0 20px 50px rgba(15,42,68,.25); flex: 0 0 auto; }
.phone-screen { background: #f4f7fa; border-radius: 32px; height: 100%; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.phone-status { display: flex; justify-content: space-between; padding: 10px 22px 4px; font-size: 12px; font-weight: 600; color: var(--navy); }
.phone-head { padding: 6px 16px 12px; }
.phone-head .hi { font-size: 18px; font-weight: 700; }
.phone-body { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.phone-nav { display: flex; border-top: 1px solid var(--line); background: #fff; }
.phone-nav button { flex: 1; background: none; border: 0; padding: 9px 2px 12px; font-size: 10.5px; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.phone-nav button.on { color: var(--teal); font-weight: 650; }
.pjob { background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); }
.pjob .tm { font-size: 12px; color: var(--muted); }
.pjob .cl { font-weight: 650; font-size: 14.5px; margin: 2px 0; }
.pbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pbtn { border: 0; border-radius: 12px; padding: 12px 8px; font-weight: 650; font-size: 13px; cursor: pointer; background: var(--line-2); color: var(--navy); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pbtn.go { background: var(--teal); color: #fff; }
.pbtn.wide { grid-column: 1 / -1; background: var(--navy); color: #fff; }
.pbtn.done { background: var(--ok-soft); color: var(--ok); }
.p-back { background: none; border: 0; color: var(--teal); font-weight: 600; cursor: pointer; padding: 4px 0 10px; }
.side-explain { max-width: 380px; }
.side-explain li { margin-bottom: 6px; }

/* toasts & modal */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 32px); }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 13px; max-width: 380px; animation: tin .2s ease-out; }
.toast small { display: block; color: #9fc1dd; font-size: 11.5px; margin-top: 2px; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-root:empty { display: none; }
.modal-bg { position: fixed; inset: 0; background: rgba(10,25,41,.45); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 640px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { font-size: 16px; flex: 1; }
.modal-b { padding: 16px 18px; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.x { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted); }

.receipt { background: #fff; width: 180px; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: 11px; border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.drop { border: 2px dashed #b7c6d4; border-radius: 10px; padding: 18px; text-align: center; background: #fafcfd; }
.drop input[type=file] { max-width: 100%; }

@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,25,41,.4); z-index: 50; }
  .hamburger { display: inline-flex; }
  .g-21, .g-12, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .view { padding: 14px 16px 40px; }
  .topbar { padding: 8px 12px; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .g-3 { grid-template-columns: minmax(0, 1fr); }
  .kpi .val { font-size: 19px; }
  .topbar h1 { font-size: 16px; }
  .top-controls { width: 100%; justify-content: space-between; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .kanban { grid-template-columns: repeat(5, 82vw); }
  .kv { grid-template-columns: 100px minmax(0, 1fr); }
  .invoice { padding: 16px; }
  .invoice .parties { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 100px 1fr 46px; }
  .load-row { grid-template-columns: 80px 1fr 40px; }
  .phone { width: 100%; height: 680px; border-radius: 34px; padding: 8px; }
  .phone-screen { border-radius: 28px; }
  .card { padding: 13px; }
}
