/* Tri Stone Group Sales CRM — light corporate UI
   Based on the Stitch "Multi-Enterprise Commercial CRM" design system,
   simplified for everyday use on desktop and phone. */

/* Self-hosted fonts — no external requests */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/plus-jakarta-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/plus-jakarta-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/plus-jakarta-sans-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Material Symbols Outlined'; font-style: normal; font-weight: 400; font-display: block; src: url(../fonts/material-symbols-subset.woff2) format('woff2'); }

:root {
  --bg: #F6F8FB;
  --card: #FFFFFF;
  --well: #F1F5F9;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --faint: #94A3B8;
  --primary: #0F172A;
  --primary-h: #1E293B;
  --accent: #2563EB;
  --accent-soft: #EFF6FF;
  --red: #E11D48;
  --red-soft: #FFF1F2;
  --amber: #D97706;
  --amber-soft: #FFFBEB;
  --orange: #EA580C;
  --green: #059669;
  --green-soft: #ECFDF5;
  --wa: #16A34A;
  --wa-h: #15803D;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --sh-1: 0 1px 3px rgba(15, 23, 42, .05), 0 1px 2px -1px rgba(15, 23, 42, .04);
  --sh-2: 0 6px 16px -4px rgba(15, 23, 42, .10), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --sh-3: 0 24px 48px -12px rgba(15, 23, 42, .25);
  --side: 248px;
  --top: 64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --head: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); font-feature-settings: 'tnum' 1, 'cv05' 1; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--head); letter-spacing: -.015em; margin: 0; color: var(--ink); }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .6em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.red-t { color: var(--red) !important; }
.green-t { color: var(--green) !important; }
.amber-t { color: var(--amber) !important; }
.b { font-weight: 700; }
[hidden] { display: none !important; }

.ms { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; vertical-align: middle; font-variation-settings: 'FILL' 0; flex-shrink: 0; overflow: hidden; width: 1em; text-transform: none; letter-spacing: normal; }
.ms.xl { font-size: 44px; }
.ms.fill { font-variation-settings: 'FILL' 1; }

/* ---------------- Layout ---------------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 60; }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 18px; height: var(--top); border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; }
.brand b { display: block; font-family: var(--head); font-size: 14px; line-height: 1.15; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; text-decoration: none; margin-bottom: 1px; }
.nav a .ms { color: var(--muted); font-size: 20px; }
.nav a:hover { background: var(--well); }
.nav a.on { background: var(--primary); color: #fff; }
.nav a.on .ms { color: #fff; }
.nav a span:not(.ms) { flex: 1; }
.count { font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--well); color: var(--ink-2); }
.count.red { background: var(--red); color: #fff; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); text-decoration: none !important; }
.me b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); font-size: 11px; }

.topbar { position: fixed; top: 0; left: var(--side); right: 0; height: var(--top); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; z-index: 50; }
.co-switch { display: flex; background: var(--well); padding: 3px; border-radius: 9px; gap: 2px; flex-shrink: 0; }
.co-switch a { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.co-switch a i { width: 8px; height: 8px; border-radius: 50%; }
.co-switch a.on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.co-select { display: none; }
.search { flex: 1; max-width: 460px; position: relative; display: flex; align-items: center; }
.search .ms { position: absolute; left: 11px; color: var(--faint); }
.search input[type=search] { width: 100%; height: 40px; border: 1px solid var(--line); background: var(--well); border-radius: 9px; padding: 0 12px 0 38px; font: inherit; color: var(--ink); }
.search input[type=search]:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bell-wrap { position: relative; }
.bell em { position: absolute; top: 2px; right: 2px; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: var(--red); border-radius: 10px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.bell em.amber { background: var(--amber); }
.dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-2); min-width: 240px; z-index: 70; overflow: hidden; }
.dropdown.open { display: block; }
.dd-head { padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--line); }
.dd-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--ink); }
.dd-row b { margin-left: auto; }
.dd-row:hover { background: var(--well); text-decoration: none; }
.dd-foot { display: block; padding: 10px 14px; border-top: 1px solid var(--line); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.green { background: var(--green); }

.main { margin-left: var(--side); padding: calc(var(--top) + 22px) 28px 48px; min-height: 100vh; }
.main.bare { margin: 0; padding: 0; }
.scrim { display: none; }
.only-mobile { display: none !important; }
.bottom-nav { display: none; }

/* ---------------- Page header ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn .ms { font-size: 19px; }
.btn:hover { background: var(--well); }
.btn:focus-visible, .icon-btn:focus-visible, .qa-btn:focus-visible { outline: 3px solid rgba(37,99,235,.35); outline-offset: 1px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #1D4ED8; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #BE123C; }
.btn-dark { background: #334155; border-color: #334155; color: #fff; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-h); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--well); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-sm .ms { font-size: 17px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; text-decoration: none !important; }
.icon-btn:hover { background: var(--well); }

/* ---------------- Cards / grids ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: #FBFCFE; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.g-main-l { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh-1); display: block; color: var(--ink); text-decoration: none !important; transition: box-shadow .15s, border-color .15s; position: relative; }
a.kpi:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.kpi .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi .lbl .ms { font-size: 18px; color: var(--faint); }
.kpi .v { font: 800 1.6rem/1.2 var(--head); margin-top: 6px; letter-spacing: -.02em; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.alert { border-color: #FECDD3; background: var(--red-soft); }
.kpi.alert .v, .kpi.alert .lbl, .kpi.alert .lbl .ms { color: var(--red); }
.kpi.warn { border-color: #FDE68A; background: var(--amber-soft); }
.kpi.warn .v, .kpi.warn .lbl .ms { color: var(--amber); }
.kpi.good .v { color: var(--green); }
.kpi-sec { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }

/* Overdue alert banner */
.alert-banner { background: linear-gradient(0deg, #FFF1F2, #FFF1F2); border: 1px solid #FECDD3; border-radius: var(--r-lg); padding: 18px 20px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.alert-banner h2 { color: var(--red); display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.alert-banner p { margin: 4px 0 0; color: var(--ink-2); }
.alert-banner .people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.alert-banner .people a { background: #fff; border: 1px solid #FECDD3; border-radius: 20px; padding: 4px 10px 4px 4px; display: inline-flex; gap: 7px; align-items: center; color: var(--ink); font-size: 13px; font-weight: 600; }
.alert-banner .people a b { color: var(--red); }
.alert-banner.ok { background: var(--green-soft); border-color: #A7F3D0; }
.alert-banner.ok h2 { color: var(--green); }
.ping { position: relative; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
.ping::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--red); animation: ping 1.4s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
.big-ping { width: 12px; height: 12px; }

/* ---------------- Badges ---------------- */
.co-badge { --c: #0D9488; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px 2px 6px; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); white-space: nowrap; line-height: 1.5; }
.co-badge .ms { font-size: 14px; }
.stage-badge { --c: #64748B; display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; color: color-mix(in srgb, var(--c) 80%, #000); background: color-mix(in srgb, var(--c) 12%, #fff); white-space: nowrap; }
.pri { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.pri-hot { background: #FFF7ED; color: var(--orange); border: 1px solid #FED7AA; }
.pri-warm { background: #FEFCE8; color: #A16207; border: 1px solid #FEF08A; }
.pri-cold { background: #F0F9FF; color: #0369A1; border: 1px solid #BAE6FD; }
.due { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.due .ms { font-size: 16px; }
.due-over { color: var(--red); }
.due-today { color: var(--amber); }
.due-up { color: var(--muted); font-weight: 500; }
.due-none { color: var(--red); background: var(--red-soft); padding: 1px 8px; border-radius: 6px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--well); color: var(--ink-2); white-space: nowrap; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.blue { background: var(--accent-soft); color: var(--accent); }
.avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: #F8FAFC; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: #F8FAFC; }
.t tr.is-over { background: #FFF8F9; }
.t tr.is-over:hover { background: #FFF1F2; }
.t .strong { font-weight: 600; color: var(--ink); }
.t a.strong { color: var(--ink); }
.t .sub { color: var(--muted); font-size: 12px; }
.t td.right, .t th.right { text-align: right; }
.t tfoot td { font-weight: 700; background: #F8FAFC; border-top: 1px solid var(--line-2); }
.t input[type=checkbox] { width: 17px; height: 17px; }

/* ---------------- Forms ---------------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .req { font-style: normal; color: var(--red); font-size: 11px; font-weight: 600; margin-left: 4px; }
.field small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: 42px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; padding: 9px 12px; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 70px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%2364748B' stroke-width='1.6' d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
input[type=file] { font: inherit; width: 100%; padding: 10px; border: 1.5px dashed var(--line-2); border-radius: 8px; background: #FBFCFE; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; margin-bottom: 8px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-sec { padding: 20px; border-bottom: 1px solid var(--line); }
.form-sec:last-child { border-bottom: 0; }
.form-sec h3 { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.form-sec h3 .ms { color: var(--muted); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--line); background: #FBFCFE; border-radius: 0 0 var(--r-lg) var(--r-lg); position: sticky; bottom: 0; }
.seg { display: inline-flex; background: var(--well); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label, .seg a { padding: 7px 14px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px; }
.seg input { display: none; }
.seg label:has(input:checked), .seg a.on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.pri-seg label:has(input[value=hot]:checked) { background: #FFF7ED; color: var(--orange); }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.filters select, .filters input { width: auto; min-height: 36px; height: 36px; padding: 5px 30px 5px 10px; font-size: 13px; border-radius: 7px; }
.filters input { padding-right: 10px; }
.filters .grow { flex: 1; min-width: 180px; }
.filter-toggle { display: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tabs a { padding: 12px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none !important; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.on { color: var(--ink); border-color: var(--ink); }
.tabs a em { font-style: normal; font-size: 11px; background: var(--well); border-radius: 10px; padding: 1px 7px; color: var(--ink-2); }
.tabs a em.red { background: var(--red); color: #fff; }

/* ---------------- Quick actions ---------------- */
.qa { display: flex; gap: 6px; flex-wrap: wrap; }
.qa-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font: 600 13px/1 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.qa-btn .ms { font-size: 18px; }
.qa-btn:hover { background: var(--well); }
.qa-btn.call { color: var(--accent); border-color: #BFDBFE; background: var(--accent-soft); }
.qa-btn.wa { color: #fff; border-color: var(--wa); background: var(--wa); }
.qa-btn.wa:hover { background: var(--wa-h); }
.qa-btn.fu { color: #fff; background: var(--primary); border-color: var(--primary); }
.qa-compact .qa-btn span:not(.ms) { display: none; }
.qa-compact .qa-btn { width: 34px; padding: 0; justify-content: center; }
.qa-big .qa-btn { height: 44px; padding: 0 16px; font-size: 14px; flex: 1 1 auto; justify-content: center; }

/* ---------------- Lead rows (dashboard lists) ---------------- */
.lead-list { list-style: none; margin: 0; padding: 0; }
.lead-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.lead-row:last-child { border-bottom: 0; }
.lead-row.over { background: #FFFBFB; box-shadow: inset 3px 0 0 var(--red); }
.lead-row .info { flex: 1; min-width: 0; }
.lead-row .nm { font-weight: 700; color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lead-row .nm a { color: var(--ink); }
.lead-row .meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.lead-row .meta > span { display: inline-flex; align-items: center; gap: 4px; }
.lead-row .meta .ms { font-size: 15px; }
.lead-row .val { font-weight: 700; white-space: nowrap; text-align: right; }

.section-title { display: flex; align-items: center; gap: 10px; }
.section-title .n { font-style: normal; font-size: 12px; font-weight: 700; background: var(--well); color: var(--ink-2); border-radius: 10px; padding: 1px 8px; }
.section-title .n.red { background: var(--red); color: #fff; }
.section-title .n.amber { background: var(--amber); color: #fff; }

/* ---------------- Empty states ---------------- */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ms { font-size: 36px; color: var(--faint); display: block; margin: 0 auto 8px; }
.empty h2, .empty h3 { color: var(--ink-2); margin-bottom: 4px; }
.empty.big { padding: 80px 20px; }
.empty .btn { margin-top: 12px; }

/* ---------------- Toasts ---------------- */
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid; animation: slide .25s ease-out; }
.toast .x { margin-left: auto; background: none; border: 0; font-size: 20px; color: inherit; cursor: pointer; opacity: .6; }
.toast-success { background: var(--green-soft); border-color: #A7F3D0; color: #065F46; }
.toast-error { background: var(--red-soft); border-color: #FECDD3; color: #9F1239; }
.toast-warning { background: var(--amber-soft); border-color: #FDE68A; color: #92400E; }
.toast-info { background: var(--accent-soft); border-color: #BFDBFE; color: #1E40AF; }
@keyframes slide { from { transform: translateY(-6px); opacity: 0; } }
.float-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 200; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--sh-3); font-weight: 500; }

/* ---------------- Modals ---------------- */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.modal-card { background: #fff; border-radius: 16px; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--sh-3); border: 1px solid var(--line-2); }
.modal-card.sm { width: min(460px, calc(100vw - 24px)); }
.modal-card.lg { width: min(820px, calc(100vw - 24px)); }
.modal-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-card > header p { margin: 2px 0 0; font-size: 13px; }
.modal-card > header h3 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-card > footer { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #FBFCFE; border-radius: 0 0 16px 16px; }
.modal-card > footer .muted { margin-right: auto; }
.won-head { background: var(--green-soft); border-radius: 16px 16px 0 0; }
.won-head h3 { color: var(--green); }
.wa-head { background: #F0FDF4; border-radius: 16px 16px 0 0; }
.wa-head h3 { color: var(--wa); }
.step-label { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 4px 0 10px; }
.step-label b { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; display: grid; place-items: center; }
.step-label .req { font-style: normal; font-size: 11px; color: var(--red); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 20px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; user-select: none; }
.chip .ms { font-size: 17px; color: var(--muted); }
.chip input { display: none; }
.chip:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip:has(input:checked) .ms { color: #fff; }
.next-box { background: #F8FAFC; border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 2px; }
.next-box.need { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225,29,72,.1); }
.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.quick-dates button { border: 1px solid var(--line-2); background: #fff; border-radius: 7px; padding: 6px 10px; font: 600 12.5px var(--font); color: var(--ink-2); cursor: pointer; }
.quick-dates button:hover, .quick-dates button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); background: var(--well); border-radius: 8px; padding: 9px 11px; margin: 6px 0 0; }
.hint .ms { font-size: 18px; }
.calc-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 8px; background: var(--amber-soft); margin-bottom: 14px; font-weight: 600; }
.stage-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stage-pick label { --c: #64748B; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; }
.stage-pick label::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.stage-pick input { display: none; }
.stage-pick label:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); }
.stage-pick label.current { opacity: .5; }

/* Share dialog */
.share-body { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.share-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.mat-list { border: 1px solid var(--line); border-radius: 10px; max-height: 340px; overflow-y: auto; }
.mat-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 12px 4px; background: #F8FAFC; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.mat-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mat-item:last-child { border-bottom: 0; }
.mat-item:hover { background: #F8FAFC; }
.mat-item input { width: 18px; height: 18px; accent-color: var(--wa); flex-shrink: 0; }
.mat-item .ms { color: var(--muted); }
.mat-item b { display: block; font-size: 13px; font-weight: 600; }
.mat-item small { color: var(--muted); font-size: 12px; }
.mat-item:has(input:checked) { background: #F0FDF4; }
.share-body textarea { min-height: 220px; font-size: 13.5px; }
.loading { padding: 40px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* ---------------- Kanban ---------------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: 60vh; scroll-snap-type: x proximity; }
.col { flex: 0 0 290px; background: #EEF2F7; border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 210px); scroll-snap-align: start; }
.col-head { padding: 12px 12px 10px; border-top: 3px solid var(--c); border-radius: 12px 12px 0 0; }
.col-head b { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.col-head b em { font-style: normal; font-size: 11.5px; background: #fff; border-radius: 10px; padding: 1px 8px; color: var(--ink-2); }
.col-head small { color: var(--muted); font-weight: 600; }
.col-body { padding: 0 8px 8px; overflow-y: auto; flex: 1; min-height: 80px; }
.col.drop-on { background: #DBEAFE; outline: 2px dashed var(--accent); }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--sh-1); cursor: grab; }
.kcard:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.kcard.dragging { opacity: .5; }
.kcard.over { border-left: 3px solid var(--red); }
.kcard .top { display: flex; justify-content: space-between; gap: 6px; align-items: center; margin-bottom: 7px; }
.kcard .nm { font-weight: 700; color: var(--ink); display: block; line-height: 1.3; }
.kcard .svc { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.kcard .row2 { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kcard .amt { font-weight: 800; font-size: 14px; }
.kcard .bot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.kcard .move { display: none; }
.side-lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.side-lanes .col { flex: none; max-height: 320px; }

/* ---------------- Lead profile ---------------- */
.profile-head { padding: 20px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.profile-head .who-big { flex: 1; min-width: 240px; }
.profile-head h1 { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-head .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.next-card { border-radius: 12px; padding: 14px 16px; border: 1px solid var(--line); background: #F8FAFC; min-width: 260px; }
.next-card.over { background: var(--red-soft); border-color: #FECDD3; }
.next-card.today { background: var(--amber-soft); border-color: #FDE68A; }
.next-card.none { background: var(--red-soft); border-color: #FECDD3; }
.next-card .lbl { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.next-card .when { font: 700 1.05rem var(--head); margin: 3px 0; }
.next-card.over .when, .next-card.none .when { color: var(--red); }
.action-bar { padding: 12px 20px; border-top: 1px solid var(--line); background: #FBFCFE; }
.dl { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.stage-track { display: flex; gap: 3px; padding: 14px 20px; border-top: 1px solid var(--line); overflow-x: auto; }
.stage-track span { flex: 1; min-width: 70px; text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); padding-top: 8px; border-top: 4px solid var(--line); white-space: nowrap; }
.stage-track span.done { color: var(--ink-2); border-color: var(--green); }
.stage-track span.cur { color: var(--ink); border-color: var(--accent); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px 50px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .ti { position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--c, var(--line)); color: var(--c, var(--muted)); }
.timeline .ti .ms { font-size: 18px; }
.timeline .tm { font-weight: 600; color: var(--ink); }
.timeline .tt { color: var(--muted); font-size: 12px; margin-top: 2px; }
.timeline .tn { background: #F8FAFC; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 6px; font-size: 13px; white-space: pre-wrap; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.file-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.file-card .fi { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--well); color: var(--ink-2); flex-shrink: 0; }
.file-card .fn { font-weight: 600; word-break: break-word; line-height: 1.3; color: var(--ink); }
.file-card .fm { color: var(--muted); font-size: 12px; margin-top: 3px; }
.file-card .fa { display: flex; gap: 2px; margin-top: 6px; }

.pay-bar { height: 10px; background: var(--well); border-radius: 6px; overflow: hidden; }
.pay-bar i { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.money-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.money-grid div { background: #F8FAFC; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.money-grid small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.money-grid b { font: 800 1.05rem var(--head); }

/* bars (reports) */
.hbar { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.hbar .hl { width: 150px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .ht { flex: 1; height: 10px; background: var(--well); border-radius: 6px; overflow: hidden; }
.hbar .ht i { display: block; height: 100%; border-radius: 6px; background: var(--c, var(--accent)); }
.hbar .hv { width: 110px; text-align: right; font-weight: 700; font-size: 13px; }
.funnel { display: flex; gap: 6px; }
.funnel div { flex: 1; text-align: center; background: var(--well); border-radius: 10px; padding: 10px 6px; }
.funnel div small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.funnel div b { font: 800 1.3rem var(--head); }
.funnel div.win { background: var(--green-soft); color: var(--green); }

.company-split .row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.company-split .row:last-child { border-bottom: 0; }
.company-split .row .top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }

/* Settings */
.set-list { list-style: none; margin: 0; padding: 0; }
.set-list li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.set-list li:last-child { border-bottom: 0; }
.set-list li.off { opacity: .55; }
.set-list .grow { flex: 1; }
.inline-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #FBFCFE; flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1; min-width: 140px; width: auto; }
.perm-table td:first-child { width: 55%; }
.perm-table input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Library cards */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.lib-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh-1); }
.lib-card.off { opacity: .6; }
.lib-card .lt { display: flex; gap: 10px; align-items: flex-start; }
.lib-card .lt .fi { width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; background: var(--well); flex-shrink: 0; }
.lib-card .lt b { display: block; line-height: 1.3; }
.lib-card .desc { font-size: 13px; color: var(--muted); flex: 1; }
.lib-card .la { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl-body { white-space: pre-wrap; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 10px 10px 10px 2px; padding: 10px 12px; font-size: 13.5px; }
.var-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.var-chips button { border: 1px dashed var(--line-2); background: #fff; border-radius: 6px; font: 600 12px ui-monospace, monospace; padding: 4px 7px; cursor: pointer; color: var(--accent); }

/* Projects */
.proj-card { overflow: hidden; }
.proj-card .ph { height: 140px; background: linear-gradient(135deg, #065F46, #059669); color: #fff; display: flex; align-items: flex-end; padding: 16px; position: relative; background-size: cover; background-position: center; }
.proj-card .ph::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent 70%); }
.proj-card .ph div { position: relative; }
.proj-card .ph b { font: 800 1.15rem var(--head); display: block; }
.proj-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.proj-stats div { background: var(--well); border-radius: 8px; padding: 8px 10px; }
.proj-stats small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.proj-stats b { font-size: 14px; }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { background: radial-gradient(1200px 600px at 10% 10%, #1E3A8A 0, transparent 60%), radial-gradient(900px 600px at 90% 90%, #065F46 0, transparent 60%), #0F172A; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h1 { color: #fff; font-size: 2.1rem; line-height: 1.2; max-width: 480px; }
.auth-art p { color: #CBD5E1; max-width: 460px; font-size: 15px; }
.auth-art .cos { display: flex; flex-direction: column; gap: 10px; }
.auth-art .cos div { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.auth-art .cos i { width: 10px; height: 10px; border-radius: 50%; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: #fff; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 1.5rem; margin-bottom: 4px; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.install-wrap { max-width: 720px; margin: 40px auto; padding: 0 16px; }

.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.pager .muted { margin-right: auto; font-size: 13px; }
.bulk-bar { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--accent-soft); border-bottom: 1px solid #BFDBFE; flex-wrap: wrap; }
.bulk-bar.show { display: flex; }
.bulk-bar select, .bulk-bar input { width: auto; min-height: 36px; height: 36px; padding: 5px 30px 5px 10px; font-size: 13px; }
.bulk-bar input { padding-right: 10px; }

.search-hit { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--ink); }
.search-hit:hover { background: #F8FAFC; text-decoration: none; }
mark { background: #FEF08A; padding: 0 2px; border-radius: 3px; }

/* Print */
@media print {
  .sidebar, .topbar, .bottom-nav, .qa, .page-head .actions, .filters, .no-print { display: none !important; }
  .main { margin: 0; padding: 0; }
  .card { box-shadow: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1280px) {
  .co-switch a { padding: 6px 9px; }
  .g-main { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1100px) {
  .co-switch { display: none; }
  .co-select.only-mobile { display: block !important; width: 170px; min-height: 38px; height: 38px; font-size: 13px; }
  .g-main, .g-main-l { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --top: 58px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--sh-3); width: 280px; }
  body.side-open .sidebar { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 55; }
  .topbar { left: 0; padding: 0 10px; gap: 8px; }
  .only-mobile { display: inline-grid !important; }
  .hide-mobile { display: none !important; }
  .main { margin-left: 0; padding: calc(var(--top) + 14px) 14px 96px; }
  .search input { height: 38px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center; box-shadow: 0 -4px 16px rgba(15,23,42,.06); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 8px; position: relative; min-width: 58px; }
  .bottom-nav a.on { color: var(--ink); }
  .bottom-nav a.on .ms { font-variation-settings: 'FILL' 1; }
  .bottom-nav a em { position: absolute; top: 0; right: 10px; font-style: normal; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; border-radius: 9px; padding: 0 5px; min-width: 17px; text-align: center; }
  .bottom-nav .fab { width: 52px; height: 52px; min-width: 0; border-radius: 50%; background: var(--primary); color: #fff; justify-content: center; margin-top: -24px; box-shadow: 0 8px 20px rgba(15,23,42,.35); border: 4px solid #fff; }
  .bottom-nav .fab .ms { font-size: 26px; }
  h1 { font-size: 1.35rem; }
  .page-head { margin-bottom: 14px; align-items: flex-start; }
  .page-head .actions .btn { height: 38px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi .v { font-size: 1.3rem; }
  .card-head, .card-body, .form-sec { padding-left: 14px; padding-right: 14px; }
  .lead-row { padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
  .lead-row .info { flex: 1 1 0; }
  .lead-row .val { margin-left: auto; }
  .profile-head .who-big { min-width: 0; flex-basis: calc(100% - 70px); }
  .next-card { min-width: 0; width: 100%; }
  .lead-row .qa { width: 100%; }
  .lead-row .qa .qa-btn { flex: 1; justify-content: center; }
  .filters { display: none; }
  .filters.open { display: flex; }
  .filters select, .filters input { flex: 1 1 45%; }
  .filter-toggle { display: inline-flex; }
  .share-body { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 110px 1fr; }
  .money-grid { grid-template-columns: 1fr 1fr; }
  .side-lanes { grid-template-columns: 1fr; }
  .col { flex-basis: 84vw; max-height: none; }
  .kcard .move { display: block; margin-top: 8px; }
  .kcard .move select { min-height: 34px; height: 34px; font-size: 12.5px; padding: 4px 28px 4px 8px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 22px; }
  .auth-art .cos, .auth-art .foot { display: none; }
  .auth-art h1 { font-size: 1.5rem; }
  dialog.modal { margin: auto 0 0; width: 100%; }
  .modal-card, .modal-card.sm, .modal-card.lg { width: 100vw; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal-card > footer { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-card > footer .btn { flex: 1; }
  .modal-card > footer .muted { display: none; }
  .table-wrap .t th, .table-wrap .t td { padding: 10px 10px; }
  .t.cards thead { display: none; }
  .t.cards, .t.cards tbody, .t.cards tr, .t.cards td { display: block; width: 100%; }
  .t.cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .t.cards td { border: 0; padding: 3px 0; }
  .t.cards td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 110px; color: var(--muted); font-size: 12px; }
  .t.cards td.hide-m { display: none; }
  .t.cards td.right { text-align: left; }
  .toast { margin-bottom: 12px; }
  .hbar .hl { width: 100px; }
  .hbar .hv { width: 80px; }
}
@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stage-pick { grid-template-columns: 1fr; }
  .co-select.only-mobile { width: 118px; }
  .search input::placeholder { color: transparent; }
}
.t .qa { flex-wrap: nowrap; }

.grid > * { min-width: 0; }
