/* ==========================================================================
   صفقة (Safqa) — Minimal monochrome design system
   أبيض نقي · رمادي محايد · لون واحد بنفسجي (#6d4aff) للتركيز والاختيار فقط.
   يُحمَّل بعد shared/css/base.css ويعيد تعريف ما يلزم.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600&display=swap");

:root {
  --brand: #6d4aff;
  --brand-600: #5a37f0;
  --brand-soft: #f3f0ff;
  --accent: #6d4aff;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --hover: #f5f5f5;
  --active: #efefef;
  --border: #ececec;
  --border-2: #e2e2e2;
  --line: #f2f2f2;
  --text: #111111;
  --text-2: #6b6b6b;
  --muted: #9a9a9a;

  --green: #16a34a; --amber: #d97706; --red: #dc2626; --blue: #2563eb; --violet: #6d4aff;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-pop: 0 0 0 1px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);

  --sb-w: 232px;
  --peek-w: 520px;
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); font-size: 13.5px; line-height: 1.55; color: var(--text); background: #fff;
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased;
}
body.app { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0; line-height: 1.35; margin: 0; }
p { margin: 0 0 .6em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
::selection { background: #e6e0ff; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; border-radius: 4px; }
svg.lucide { width: 15px; height: 15px; stroke-width: 1.75; flex: none; }

/* utilities */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; letter-spacing: -.01em; direction: ltr; unicode-bidi: embed; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.muted { color: var(--text-2); }
.faint { color: var(--muted); }
.txt-red { color: var(--red); } .txt-green { color: var(--green); } .txt-violet { color: var(--violet); }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fw-5 { font-weight: 500; } .fw-6 { font-weight: 600; }
.grow { flex: 1 1 auto; min-width: 0; }
.ms-auto { margin-inline-start: auto; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-gap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hide { display: none !important; }
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px;
  font: 500 11px/1 var(--font); color: var(--text-2); background: #fff; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 4px;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 11px;
  font: 500 13px/1 var(--font); color: var(--text); background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s, border-color .12s, color .12s; white-space: nowrap; box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.btn svg.lucide, .btn svg { width: 14px; height: 14px; }
.btn:hover { background: var(--hover); border-color: #d6d6d6; color: var(--text); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-dark { background: #111; border-color: #111; color: #fff; }
.btn-dark:hover { background: #2a2a2a; border-color: #2a2a2a; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.btn-danger { color: var(--red); }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12.5px; }
.btn-lg { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon {
  position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); cursor: pointer; flex: none;
}
.btn-icon:hover { background: var(--hover); color: var(--text); }
.btn-icon.on { color: var(--violet); }
.btn-icon.on svg { fill: currentColor; }
.is-locked { opacity: .45; cursor: not-allowed !important; }

/* ---------------------------------------------------------------- Forms */
.input, .select, .textarea {
  width: 100%; height: 32px; padding: 0 10px; font: 400 13.5px var(--font); color: var(--text); background: #fff;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); outline: 0; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.6; }
select.input { padding-inline-end: 6px; }
.input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(109, 74, 255, .14); }
.input::placeholder { color: #b0b0b0; }
.input-sm { height: 28px; font-size: 13px; padding: 0 8px; }
.input.num, input[type=number] { font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 500; color: var(--text-2); }
.form { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--violet); width: 14px; height: 14px; }
.search-in { position: relative; display: flex; align-items: center; }
.search-in svg { position: absolute; inset-inline-start: 9px; color: var(--muted); pointer-events: none; }
.search-in .input { padding-inline-start: 30px; height: 30px; }

/* segmented */
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; }
.seg button { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; font: 500 12.5px var(--font); color: var(--text-2); background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 0 0 1px var(--border-2), 0 1px 2px rgba(0,0,0,.04); }
.seg-full { display: flex; } .seg-full button { flex: 1; justify-content: center; }

/* ---------------------------------------------------------------- Status primitives */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.st > i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.st-green > i { background: var(--green); } .st-amber > i { background: var(--amber); } .st-red > i { background: var(--red); }
.st-blue > i { background: var(--blue); } .st-violet > i { background: var(--violet); } .st-gray > i { background: #b5b5b5; }
.stage { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; }
.sg { flex: none; display: block; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; font-size: 12px; color: var(--text-2);
  background: #fff; border: 1px solid var(--border); border-radius: 5px; white-space: nowrap;
}
.chip svg.lucide { width: 12px; height: 12px; }
.chip.on { color: var(--violet); border-color: #d9d0ff; background: var(--brand-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.prob { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.prob > i { position: relative; width: 28px; height: 3px; border-radius: 3px; background: var(--active); overflow: hidden; }
.prob > i::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--p); background: #111; border-radius: 3px; }
.delta { font-size: 12px; font-weight: 500; white-space: nowrap; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.badge { background: transparent; padding: 0; } /* neutralise base badge blocks */

/* avatars & favicons */
.av {
  --h: 250; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: hsl(var(--h) 30% 93%); color: hsl(var(--h) 25% 32%); font-size: 11px; font-weight: 600; line-height: 1; letter-spacing: -.02em;
}
.av-xs { width: 18px; height: 18px; font-size: 9px; }
.av-sm { width: 22px; height: 22px; font-size: 10px; }
.av-md { width: 32px; height: 32px; font-size: 12px; }
.av-lg { width: 44px; height: 44px; font-size: 15px; }
.fav {
  --h: 250; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; flex: none;
  background: hsl(var(--h) 48% 44%); color: #fff; font-size: 10px; font-weight: 600; line-height: 1;
}
.fav-xs { width: 16px; height: 16px; font-size: 9px; border-radius: 4px; }
.fav-sm { width: 20px; height: 20px; font-size: 10.5px; }
.fav-lg { width: 40px; height: 40px; font-size: 17px; border-radius: 8px; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person-t b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-t small { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--text); }
.rec span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.rec:hover span, .tbl a.lnk:hover { text-decoration: underline; text-decoration-color: #c4c4c4; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- Shell: sidebar */
.sb {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sb-w); z-index: 40;
  display: flex; flex-direction: column; background: var(--surface-2); border-inline-end: 1px solid var(--border);
}
.sb-top { padding: 10px 10px 6px; display: grid; gap: 6px; }
.ws-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px; border: 0; background: transparent; border-radius: var(--radius-sm);
  font: 600 13.5px var(--font); color: var(--text); cursor: pointer; text-align: start;
}
.ws-btn:hover { background: var(--active); }
.ws-btn .ws-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-btn svg { color: var(--muted); }
.ws-logo { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #111; color: #fff; font-size: 12px; font-weight: 600; flex: none; }
.ws-logo.sm { width: 20px; height: 20px; font-size: 11px; }
.brand-logo { display: block; object-fit: contain; flex: none; }
.ws-btn .ws-logo-img { width: 30px; height: 30px; }
.ws-btn:has(.ws-logo-img) { height: auto; min-height: 42px; padding: 5px 6px; }
.ws-logo-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ws-logo-txt .ws-prod { font-size: 11px; font-weight: 500; color: var(--muted); }
.ws-logo-img.sm { width: 22px; height: 22px; }
.cmdk-brand { display: inline-flex; align-items: center; gap: 6px; }
.cmdk-brand .brand-logo { width: 18px; height: 18px; }
.sb-search {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; width: 100%; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius-sm); font: 400 13px var(--font); color: var(--muted); cursor: pointer; text-align: start;
}
.sb-search span { flex: 1; }
.sb-search:hover { border-color: #d6d6d6; color: var(--text-2); }
.sb-nav { padding: 4px 8px; overflow-y: auto; }
.sb-favs { padding: 0 8px 8px; overflow-y: auto; }
.sb-sec { padding: 14px 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.sb-link {
  display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--radius-sm);
  color: #3d3d3d; font-weight: 500; font-size: 13.5px; transition: background .1s;
}
.sb-link svg.lucide { color: #8f8f8f; width: 15px; height: 15px; }
.sb-link > span:not(.fav):not(.av) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-link:hover { background: var(--active); color: var(--text); }
.sb-link.active { background: #fff; color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0,0,0,.03); }
.sb-link.active svg.lucide { color: var(--violet); }
.sb-n { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.sb-fav { font-weight: 400; color: var(--text-2); }
.sb-foot { margin-top: auto; padding: 8px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.sb-user {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px; border: 0; background: transparent; border-radius: var(--radius-sm);
  font: inherit; color: var(--text); text-align: start; cursor: pointer;
}
.sb-user:hover { background: var(--active); }
.sb-user b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user small { display: block; font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user > svg { color: var(--muted); }
.sb-by { display: flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 11px; color: var(--muted); }
.sb-by img { width: 14px; height: 14px; object-fit: contain; filter: grayscale(1); opacity: .7; }
.sb-by:hover { color: var(--text-2); }

/* dropdowns */
.dd { position: relative; }
.dd-menu {
  position: absolute; top: calc(100% + 4px); inset-inline-start: 0; min-width: 220px; z-index: 60; padding: 4px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-pop); display: none;
}
.dd.open > .dd-menu { display: block; animation: pop .12s ease-out; }
.dd-up .dd-menu { top: auto; bottom: calc(100% + 4px); width: 100%; }
.ph .dd-menu { inset-inline-start: auto; inset-inline-end: 0; }
.dd-wide { width: 360px; max-width: calc(100vw - 24px); }
.dd-label { padding: 6px 8px 4px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.dd-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; }
.dd-item {
  width: 100%; display: flex; align-items: center; gap: 9px; min-height: 30px; padding: 4px 8px; border: 0; background: transparent; border-radius: 5px;
  font: 400 13px var(--font); color: var(--text); cursor: pointer; text-align: start;
}
.dd-item:hover { background: var(--hover); }
.dd-item svg.lucide { color: var(--text-2); }
.dd-item b { display: block; font-weight: 500; } .dd-item small { display: block; color: var(--text-2); font-size: 11.5px; }
.nt-list { max-height: 360px; overflow-y: auto; }
.nt { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 6px; }
.nt:hover { background: var(--hover); }
.nt > svg { margin-top: 2px; color: var(--text-2); }
.nt b { display: block; font-weight: 500; font-size: 13px; } .nt small { display: block; color: var(--text-2); font-size: 12px; }
.nt time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.nt.unread b::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 6px; border-radius: 50%; background: var(--violet); vertical-align: middle; }
@keyframes pop { from { opacity: 0; transform: translateY(-3px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Shell: main + page header */
.main { margin-inline-start: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.ph { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.ph-row { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 20px; }
.ph-menu, .ph-cmdk { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.crumbs a:hover { color: var(--text); }
.crumbs b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { font-style: normal; color: #cfcfcf; }
.ph-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.ph-slot, .ph-slot > [data-slot] { display: flex; align-items: center; gap: 6px; }
.dot-n { position: absolute; top: 5px; inset-inline-end: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); border: 1.5px solid #fff; }
.ph-tabs { display: flex; align-items: center; gap: 8px; padding: 0 20px; height: 40px; overflow-x: auto; scrollbar-width: none; }
.ph-tabs::-webkit-scrollbar { display: none; }
.ph-tabs > [data-slot] { display: flex; align-items: center; gap: 8px; flex: 1; min-width: max-content; }
/* view tabs (inside header row 2 or anywhere) */
.vtabs { display: flex; align-items: center; gap: 2px; }
.vt, .tab {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm);
  font: 500 13px var(--font); color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.vt:hover, .tab:hover { color: var(--text); background: var(--hover); }
.vt.active, .tab.active { color: var(--text); background: #fff; border-color: var(--border-2); box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.vt .n, .tab .n { font-size: 11.5px; color: var(--muted); }
.tab-panel { display: none; } .tab-panel.active { display: block; }
.ph-tabs .spacer { flex: 1; }

.content { padding: 20px 24px 48px; width: 100%; max-width: 1440px; min-width: 0; }
.content.flush { padding: 0; max-width: none; }
.sb-scrim, .peek-scrim { display: none; }

/* page title block (optional, inside content) */
.pt { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.pt h1 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.pt p { margin: 2px 0 0; color: var(--text-2); }
.pt .row-gap { margin-inline-start: auto; }

/* ---------------------------------------------------------------- Blocks, KPIs & lists */
.blk { margin-bottom: 28px; min-width: 0; }
.blk-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-height: 26px; }
.blk-h h3 { font-size: 13.5px; font-weight: 600; }
.blk-h .muted { font-size: 12.5px; }
.blk-h .act { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; }
.blk-h a.more { margin-inline-start: auto; font-size: 12.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.blk-h a.more:hover { color: var(--text); }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; min-width: 0; }
.panel-b { padding: 14px 16px; }
.panel > .blk-h { padding: 10px 14px 0; margin-bottom: 6px; }
.cols { display: grid; gap: 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kpi { padding: 14px 16px; border-inline-start: 1px solid var(--border); min-width: 0; display: block; }
.kpi:first-child { border-inline-start: 0; }
a.kpi:hover { background: var(--surface-2); }
.kpi small { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b { display: block; font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi b .u { font-size: 13px; color: var(--text-2); font-weight: 400; margin-inline-start: 3px; letter-spacing: 0; }
.kpi .kpi-f { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* horizontal minimal bars */
.hbars { display: grid; gap: 2px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 4px; border-radius: 6px; }
a.hbar:hover, button.hbar:hover { background: var(--surface-2); }
.hbar-l { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; }
.hbar-l span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { position: relative; height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.hbar-t > i { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); background: #111; border-radius: 6px; }
.hbar-t > i.w2 { background: #bdbdbd; }
.hbar-t.violet > i { background: var(--violet); }
.hbar-v { font-size: 12.5px; color: var(--text-2); text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar-v b { color: var(--text); font-weight: 500; }

/* forecast bar */
.fc { display: grid; gap: 14px; }
.fc-nums { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.fc-nums div small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.fc-nums div b { display: block; font-size: 18px; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.fc-nums .sw { width: 8px; height: 8px; border-radius: 2px; background: #111; }
.fc-bar { position: relative; height: 12px; border-radius: 4px; background: var(--line); margin-top: 18px; }
.fc-bar > i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 4px; }
.fc-bar .seg-best { background: #d4d4d4; } .fc-bar .seg-commit { background: #6b6b6b; } .fc-bar .seg-won { background: #111; }
.fc-target { position: absolute; top: -18px; bottom: -4px; width: 0; border-inline-start: 1.5px solid var(--violet); }
.fc-target span { position: absolute; top: 0; inset-inline-end: 4px; font-size: 11px; color: var(--violet); font-weight: 500; white-space: nowrap; }
.fc-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* attainment bar in tables */
.att { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.att > i { position: relative; flex: 1; height: 4px; border-radius: 4px; background: var(--active); overflow: hidden; }
.att > i::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: min(var(--w), 100%); background: #111; border-radius: 4px; }
.att.hit > i::after { background: var(--violet); }
.att b { font-weight: 500; font-size: 12.5px; min-width: 38px; text-align: end; font-variant-numeric: tabular-nums; }

/* feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: flex-start; min-width: 0; }
.feed li:last-child { border-bottom: 0; }
.feed .f-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); flex: none; }
.feed .f-ic svg.lucide { width: 12px; height: 12px; }
.feed .f-b { flex: 1; min-width: 0; font-size: 13px; }
.feed .f-b b { font-weight: 500; }
.feed .f-b a:hover { text-decoration: underline; text-underline-offset: 3px; }
.feed .f-b small { display: block; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------------- Dense tables */
.tbl-wrap { width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.tbl-wrap.flat { border: 0; border-radius: 0; border-top: 1px solid var(--border); }
.tbl-wrap.tall { max-height: calc(100vh - 210px); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; z-index: 2; height: 32px; padding: 0 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-weight: 500; font-size: 12px; color: var(--text-2); text-align: start; white-space: nowrap; user-select: none;
}
.tbl th[data-sort] { cursor: pointer; }
.tbl th[data-sort]:hover { color: var(--text); }
.tbl th[data-sort]::after { content: "↕"; margin-inline-start: 4px; color: #cfcfcf; font-size: 10px; }
.tbl th.sorted { color: var(--text); }
.tbl th.sorted[data-dir="asc"]::after { content: "↑"; color: var(--text); }
.tbl th.sorted[data-dir="desc"]::after { content: "↓"; color: var(--text); }
.tbl td { height: 38px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fbfbfb; }
.tbl tbody tr[data-id], .tbl tbody tr[data-peek] { cursor: pointer; }
.tbl tr.sel td { background: var(--brand-soft) !important; }
.tbl .num, .tbl td.r { text-align: end; }
.tbl th.r { text-align: end; }
.tbl td.t { font-weight: 500; }
.tbl td.wrap { white-space: normal; }
.tbl .sub { display: block; font-size: 12px; color: var(--text-2); font-weight: 400; }
.tbl tr.empty-row td { height: auto; white-space: normal; }
.tbl tr.empty-row:hover td { background: #fff; }
.tbl-foot { display: flex; align-items: center; gap: 8px; padding: 8px 2px; font-size: 12px; color: var(--text-2); }
.tbl-foot .pager { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search-in { width: 240px; max-width: 100%; }
.toolbar select.input { width: auto; height: 30px; font-size: 13px; }
.toolbar .sp { flex: 1; }

/* ---------------------------------------------------------------- Property lists (inline edit) */
.props { display: grid; gap: 1px; }
.prop { display: grid; grid-template-columns: 136px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 32px; }
.prop-k { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; }
.prop-k svg.lucide { width: 14px; height: 14px; color: var(--muted); }
.prop-v { min-width: 0; padding: 4px 8px; margin-inline-start: -8px; border-radius: 5px; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; transition: background .12s; }
.prop-v.is-edit { cursor: text; }
.prop-v.is-edit:hover { background: var(--hover); }
.prop-v .input { margin: -4px 0; }
.prop-v.flash { background: var(--brand-soft); }
.ph-empty { color: #b5b5b5; }

/* ---------------------------------------------------------------- Peek panel */
.peek {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--peek-w); max-width: 100vw; z-index: 50; background: #fff;
  border-right: 1px solid var(--border); box-shadow: 8px 0 32px rgba(0,0,0,.06); display: flex; flex-direction: column;
  transform: translateX(-104%); transition: transform .2s cubic-bezier(.2,.8,.2,1); visibility: hidden;
}
body.peek-open .peek { transform: none; visibility: visible; }
.peek-h { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); flex: none; }
.peek-k { font-size: 12.5px; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek-tools { display: flex; gap: 2px; }
.peek-scroll { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.peek-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.peek-title h2 { font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; }
.peek-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.peek-actions { display: grid; gap: 10px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.sec-t { display: flex; align-items: center; gap: 8px; margin: 20px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.sec-t .muted { font-weight: 400; }
.note-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.note-line.red svg { color: var(--red); } .note-line.green svg { color: var(--green); }
.mini-list { display: grid; }
.mini-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px; margin: 0 -6px; border-radius: 6px; font-size: 13px; min-width: 0; }
a.mini-row:hover { background: var(--hover); }
.mini-row svg.lucide { color: var(--muted); }
.mini-lines { display: grid; border: 1px solid var(--border); border-radius: var(--radius); }
.mini-lines > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.mini-lines > div:last-child { border-bottom: 0; }
.mini-lines b { font-weight: 500; min-width: 70px; text-align: end; }

/* stage bar (deal) */
.stagebar { display: flex; gap: 3px; }
.sb-step {
  flex: 1; min-width: 0; height: 26px; padding: 0 4px; border: 0; border-radius: 4px; background: var(--active); color: var(--text-2);
  font: 500 11.5px var(--font); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .12s;
}
.sb-step span { overflow: hidden; text-overflow: ellipsis; }
.sb-step:hover { background: #e2e2e2; color: var(--text); }
.sb-step.on { background: #111; color: #fff; }
.sb-step.cur { background: var(--violet); color: #fff; }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; top: 8px; bottom: 8px; inset-inline-start: 10.5px; border-inline-start: 1px solid var(--border); }
.tl-i { position: relative; display: flex; gap: 10px; padding: 6px 0; }
.tl-ic { position: relative; z-index: 1; width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--border); color: var(--text-2); }
.tl-ic svg.lucide { width: 12px; height: 12px; }
.tl-stage .tl-ic { border-style: dashed; color: var(--muted); }
.tl-b { flex: 1; min-width: 0; padding-top: 1px; }
.tl-t { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.tl-t b { font-weight: 500; }
.tl-b p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-2); }
.tl-m { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.tl-m a { color: var(--text-2); } .tl-m a:hover { color: var(--text); }
.tl-stage .tl-t b { font-weight: 400; color: var(--text-2); }
.tl-i.is-done .tl-t b { color: var(--muted); text-decoration: line-through; }
.chk {
  width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #c4c4c4; background: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; color: transparent;
}
.chk svg.lucide { width: 10px; height: 10px; stroke-width: 3; }
.chk:hover { border-color: var(--violet); color: var(--violet); }
.chk.done { background: var(--violet); border-color: var(--violet); color: #fff; }
.tl-task .tl-ic { border: 0; background: transparent; }

/* task list rows (pages) */
.tasks { display: grid; grid-template-columns: minmax(0, 1fr); }
.tasks > * { min-width: 0; }
.task { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .t-b { flex: 1; min-width: 0; }
.task .t-b b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .t-b small { display: block; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.is-done b { color: var(--muted); text-decoration: line-through; }
.task .due { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.task .due.late { color: var(--red); }

/* lead score & factors */
.score { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.score b { font-weight: 600; min-width: 20px; }
.score i { position: relative; width: 44px; height: 4px; border-radius: 4px; background: var(--active); overflow: hidden; }
.score i::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--s); background: #111; }
.score em { font-style: normal; font-size: 11px; font-weight: 600; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; border: 1px solid var(--border-2); color: var(--text-2); }
.score-A i::after { background: var(--violet); } .score-A em { color: var(--violet); border-color: #d9d0ff; background: var(--brand-soft); }
.factors { display: grid; gap: 6px; margin-bottom: 14px; }
.factors > div { display: grid; grid-template-columns: minmax(0, 1fr) 90px 44px; align-items: center; gap: 10px; font-size: 12.5px; }
.factors i { position: relative; height: 4px; border-radius: 4px; background: var(--active); overflow: hidden; }
.factors i::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); background: #111; }
.factors b { font-weight: 500; text-align: end; color: var(--text-2); }

/* ---------------------------------------------------------------- Kanban */
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 420px; scroll-snap-type: x proximity; }
.col { flex: 0 0 272px; display: flex; flex-direction: column; max-height: calc(100vh - 170px); border-radius: var(--radius); background: var(--surface-2); border: 1px solid transparent; scroll-snap-align: start; }
.col.over { border-color: var(--violet); background: var(--brand-soft); }
.col-h { display: flex; align-items: center; gap: 7px; padding: 10px 10px 8px; font-size: 13px; position: sticky; top: 0; }
.col-h b { font-weight: 500; white-space: nowrap; }
.col-n { color: var(--muted); font-size: 12px; }
.col-sum { margin-inline-start: auto; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.col-b { display: grid; gap: 6px; padding: 0 6px 8px; overflow-y: auto; }
.col-empty { padding: 18px 8px; text-align: center; font-size: 12px; color: var(--muted); border: 1px dashed var(--border-2); border-radius: 6px; }
.kcard {
  display: grid; gap: 4px; padding: 10px 10px 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  cursor: grab; transition: border-color .12s, box-shadow .12s; user-select: none;
}
.kcard:hover { border-color: #d6d6d6; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.kcard.dragging { opacity: .4; }
.kc-co { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); min-width: 0; }
.kc-co span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-pri { width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-inline-start: auto; flex: none; }
.kc-t { font-weight: 500; font-size: 13px; line-height: 1.4; }
.kc-amt { font-size: 13px; color: var(--text); }
.kc-f { display: flex; align-items: center; gap: 10px; margin-top: 2px; font-size: 11.5px; color: var(--text-2); }
.kc-f > span { display: inline-flex; align-items: center; gap: 4px; }
.kc-f svg.lucide { width: 12px; height: 12px; }
.kc-f .late { color: var(--red); }
.kc-f .av { margin-inline-start: auto; }

/* ---------------------------------------------------------------- Empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 16px; color: var(--text-2); }
.empty-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); margin-bottom: 4px; }
.empty b { color: var(--text); font-weight: 500; }
.empty p { margin: 0; font-size: 12.5px; max-width: 320px; }
.empty .btn { margin-top: 8px; }

/* ---------------------------------------------------------------- Modal */
.modal-bd { position: fixed; inset: 0; z-index: 80; display: grid; place-items: start center; padding: 10vh 16px 16px; background: rgba(17,17,17,.18); opacity: 0; transition: opacity .14s; overflow-y: auto; }
.modal-bd.show { opacity: 1; }
.modal { width: 100%; max-width: 520px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); transform: translateY(6px) scale(.99); transition: transform .14s; }
.modal-bd.show .modal { transform: none; }
.modal.sm { max-width: 420px; } .modal.md { max-width: 580px; } .modal.lg { max-width: 760px; }
.modal-h { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 6px; }
.modal-h > div { flex: 1; min-width: 0; }
.modal-h h3 { font-size: 15px; font-weight: 600; }
.modal-h small { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.modal-b { padding: 10px 18px 16px; }
.modal-f { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
body.modal-open { overflow: hidden; }
.profile { display: flex; align-items: center; gap: 12px; }
.profile b { display: block; font-weight: 600; } .profile small { color: var(--text-2); }

/* ---------------------------------------------------------------- Toast */
.toasts { position: fixed; bottom: 18px; left: 18px; z-index: 120; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; background: #111; color: #f5f5f5; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: tin .18s ease-out; }
.toast b { color: #fff; font-weight: 600; }
.toast.hide { opacity: 0; transform: translateY(6px); transition: .2s; }
.t-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: #4ade80; flex: none; }
.t-info .t-dot { background: #a78bfa; } .t-warning .t-dot { background: #fbbf24; } .t-error .t-dot { background: #f87171; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Command palette */
.cmdk-bd { position: fixed; inset: 0; z-index: 100; display: none; place-items: start center; padding: 12vh 16px 16px; background: rgba(17,17,17,.14); }
.cmdk-bd.show { display: grid; animation: fadein .1s ease-out; }
.cmdk { width: 100%; max-width: 640px; background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 24px 64px rgba(0,0,0,.18); overflow: hidden; animation: pop .14s ease-out; }
.cmdk-in { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cmdk-in svg.lucide { color: var(--muted); width: 17px; height: 17px; }
.cmdk-in input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; font: 400 15px var(--font); color: var(--text); background: transparent; }
.cmdk-in input::placeholder { color: #a8a8a8; }
.cmdk-list { max-height: min(420px, 56vh); overflow-y: auto; padding: 6px; }
.cmdk-g { padding: 10px 10px 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.cmdk-it { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.cmdk-it.sel { background: var(--hover); box-shadow: inset 2px 0 0 var(--violet); }
[dir=rtl] .cmdk-it.sel { box-shadow: inset -2px 0 0 var(--violet); }
.cmdk-ic { width: 20px; display: grid; place-items: center; flex: none; color: var(--text-2); }
.cmdk-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-t small { color: var(--muted); font-size: 12px; margin-inline-start: 8px; }
.cmdk-m { font-size: 12px; color: var(--text-2); }
.cmdk-empty { padding: 28px 16px; text-align: center; color: var(--text-2); font-size: 13px; }
.cmdk-foot { display: flex; align-items: center; gap: 14px; height: 38px; padding: 0 14px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text-2); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }
.cmdk-brand { margin-inline-start: auto; font-weight: 600; color: var(--text); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- Mobile tab bar (rep) */
.tabbar { display: none; }

/* ---------------------------------------------------------------- Quote document (screen + print) */
.qdoc { max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 40px; }
.qdoc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #111; }
.qdoc-head h1 { font-size: 22px; font-weight: 600; }
.qdoc-brand { display: flex; align-items: center; gap: 10px; }
.qdoc-brand b { display: block; font-size: 15px; } .qdoc-brand small { color: var(--text-2); font-size: 12px; }
.qdoc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.qdoc-meta small { display: block; color: var(--text-2); margin-bottom: 2px; }
.qdoc-meta b { font-weight: 500; }
.qdoc-lines { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 13px; }
.qdoc-lines th { text-align: start; font-weight: 500; font-size: 12px; color: var(--text-2); padding: 8px 6px; border-bottom: 1px solid #111; }
.qdoc-lines td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.qdoc-lines .r { text-align: end; font-variant-numeric: tabular-nums; }
.qdoc-totals { margin-inline-start: auto; width: min(320px, 100%); display: grid; gap: 6px; font-size: 13px; }
.qdoc-totals > div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.qdoc-totals .grand { padding-top: 8px; border-top: 1px solid #111; font-size: 15px; font-weight: 600; }
.qdoc-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); display: grid; gap: 6px; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1200px) {
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .cols, .cols-3, .cols-21, .cols-12 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --peek-w: 100vw; }
  .sb { transform: translateX(105%); transition: transform .2s ease; box-shadow: none; width: min(280px, 86vw); }
  body.nav-open .sb { transform: none; box-shadow: -12px 0 32px rgba(0,0,0,.12); }
  body.nav-open .sb-scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(17,17,17,.2); }
  .main { margin-inline-start: 0; }
  .ph-menu, .ph-cmdk { display: inline-grid; }
  .ph-row { padding: 0 12px; gap: 6px; }
  .ph-tabs { padding: 0 12px; }
  .content { padding: 16px 16px 40px; }
  .peek { border-right: 0; }
  body.peek-open .peek-scrim { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-inline-start: 0; border-top: 1px solid var(--border); }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:nth-child(even) { border-inline-start: 1px solid var(--border); }
  .kpi b { font-size: 19px; }
  .prop { grid-template-columns: 112px minmax(0, 1fr); }
  .hbar { grid-template-columns: minmax(84px, 110px) minmax(0, 1fr) auto; gap: 8px; }
  .ph-slot .btn .lbl { display: none; }
  .col { flex-basis: 82vw; max-height: none; }
  .toolbar .search-in { width: 100%; }
  .modal-bd { padding: 16px 10px; place-items: end center; }
  .modal { max-width: none !important; }
  .peek-scroll { padding: 16px 16px 40px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  body.has-tabbar .toasts { bottom: 72px; }
  .qdoc { padding: 20px 16px; }
  /* phone tab bar */
  body.has-tabbar .content { padding-bottom: 88px; }
  .tabbar {
    display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 35; height: 60px; padding: 0 4px env(safe-area-inset-bottom);
    background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; font: 500 11px var(--font); color: var(--muted); cursor: pointer; }
  .tabbar svg.lucide { width: 19px; height: 19px; }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active svg { color: var(--violet); }
}

/* ---------------------------------------------------------------- Print (quotes & reports) */
@media print {
  @page { size: A4; margin: 14mm; }
  body { font-size: 12px; background: #fff; }
  .sb, .ph, .tabbar, .peek, .peek-scrim, .toasts, .cmdk-bd, .no-print, .sb-scrim { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  .qdoc { border: 0; padding: 0; max-width: none; }
  .tbl-wrap { overflow: visible; border: 0; max-height: none !important; }
  .tbl th { position: static; }
  a { color: inherit; }
}
