/* Idantiti Sales — Notion-like look: quiet surfaces, soft pills, everything editable in place. */
:root {
  --bg: #ffffff; --side: #f7f7f5; --hover: rgba(55, 53, 47, .06); --hover-2: rgba(55, 53, 47, .1);
  --line: rgba(55, 53, 47, .09); --line-2: rgba(55, 53, 47, .16);
  --ink: #37352f; --ink-2: rgba(55, 53, 47, .75); --ink-3: rgba(55, 53, 47, .5); --ink-4: rgba(55, 53, 47, .35);
  --blue: #2383e2; --blue-hover: #0077d4; --card: #ffffff; --pop: #ffffff;
  --shadow-card: rgba(15, 15, 15, .1) 0 0 0 1px, rgba(15, 15, 15, .1) 0 2px 4px;
  --shadow-pop: rgba(15, 15, 15, .05) 0 0 0 1px, rgba(15, 15, 15, .1) 0 3px 6px, rgba(15, 15, 15, .2) 0 9px 24px;
  /* Notion select colours: text / background */
  --c-gray: #787774; --b-gray: #f1f1ef;
  --c-brown: #9f6b53; --b-brown: #f4eeee;
  --c-orange: #d9730d; --b-orange: #fbecdd;
  --c-yellow: #cb912f; --b-yellow: #fbf3db;
  --c-green: #448361; --b-green: #edf3ec;
  --c-blue: #337ea9; --b-blue: #e7f3f8;
  --c-purple: #9065b0; --b-purple: #f6f3f9;
  --c-pink: #c14c8a; --b-pink: #faf1f5;
  --c-red: #d44c47; --b-red: #fdebec;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --tab-h: 0px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191919; --side: #202020; --hover: rgba(255, 255, 255, .055); --hover-2: rgba(255, 255, 255, .09);
    --line: rgba(255, 255, 255, .094); --line-2: rgba(255, 255, 255, .16);
    --ink: rgba(255, 255, 255, .81); --ink-2: rgba(255, 255, 255, .64); --ink-3: rgba(255, 255, 255, .46); --ink-4: rgba(255, 255, 255, .28);
    --card: #252525; --pop: #252525;
    --shadow-card: rgba(255, 255, 255, .094) 0 0 0 1px;
    --shadow-pop: rgba(255, 255, 255, .094) 0 0 0 1px, rgba(0, 0, 0, .4) 0 9px 24px;
    --c-gray: #9b9b9b; --b-gray: #2f2f2f; --c-brown: #ba856f; --b-brown: #4a3228;
    --c-orange: #c77d48; --b-orange: #5c3b23; --c-yellow: #ca9849; --b-yellow: #564328;
    --c-green: #529e72; --b-green: #243d30; --c-blue: #5e87c9; --b-blue: #143a4e;
    --c-purple: #9d68d3; --b-purple: #3c2d49; --c-pink: #d15796; --b-pink: #4e2c3c;
    --c-red: #df5452; --b-red: #522e2a;
  }
}
:root[data-theme="dark"] {
  --bg: #191919; --side: #202020; --hover: rgba(255, 255, 255, .055); --hover-2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .094); --line-2: rgba(255, 255, 255, .16);
  --ink: rgba(255, 255, 255, .81); --ink-2: rgba(255, 255, 255, .64); --ink-3: rgba(255, 255, 255, .46); --ink-4: rgba(255, 255, 255, .28);
  --card: #252525; --pop: #252525; --shadow-card: rgba(255, 255, 255, .094) 0 0 0 1px;
  --shadow-pop: rgba(255, 255, 255, .094) 0 0 0 1px, rgba(0, 0, 0, .4) 0 9px 24px;
  --c-gray: #9b9b9b; --b-gray: #2f2f2f; --c-brown: #ba856f; --b-brown: #4a3228; --c-orange: #c77d48; --b-orange: #5c3b23;
  --c-yellow: #ca9849; --b-yellow: #564328; --c-green: #529e72; --b-green: #243d30; --c-blue: #5e87c9; --b-blue: #143a4e;
  --c-purple: #9d68d3; --b-purple: #3c2d49; --c-pink: #d15796; --b-pink: #4e2c3c; --c-red: #df5452; --b-red: #522e2a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: inherit; }
.muted { color: var(--ink-3); } .small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 240px; flex: none; background: var(--side); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 8px 6px; }
.ws { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; }
.ws-ic { width: 22px; height: 22px; border-radius: 5px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 12px; display: grid; place-items: center; flex: none; }
.ws b { display: block; font-size: 14px; font-weight: 600; }
.ws span#ws-who { display: block; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.side-new { width: 100%; text-align: left; border: 0; background: none; padding: 5px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; cursor: pointer; margin-bottom: 6px; }
.side-new span { display: inline-block; width: 20px; color: var(--ink-3); }
.side-new:hover, .side-nav a:hover { background: var(--hover); }
.side-nav a { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; cursor: pointer; font-size: 14px; min-height: 30px; }
.side-nav a.on { background: var(--hover-2); color: var(--ink); font-weight: 500; }
.side-nav .e { width: 20px; text-align: center; font-size: 15px; }
.side-sec { font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 16px 10px 4px; }
.badge { margin-left: auto; font-style: normal; font-size: 11px; background: var(--b-red); color: var(--c-red); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.badge:empty { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 4; height: 45px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--bg); }
.crumb { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-state { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.ic-btn { border: 0; background: none; width: 32px; height: 32px; border-radius: 6px; font-size: 18px; cursor: pointer; color: var(--ink-2); }
.ic-btn:hover { background: var(--hover); }
.only-mob { display: none; }

.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 56px 120px; }
.page.wide { max-width: none; }
.p-icon { font-size: 54px; line-height: 1; margin: 8px 0 6px; }
h1.p-title { font-size: 36px; line-height: 1.2; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
.p-desc { color: var(--ink-3); margin-bottom: 18px; }

/* view tabs + toolbar (Notion database header) */
.dbbar { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; flex-wrap: wrap; }
.vtabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.vtabs button { border: 0; background: none; padding: 6px 8px 8px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.vtabs button:hover { color: var(--ink); }
.vtabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 2px; padding-bottom: 4px; }
.tbtn { border: 0; background: none; color: var(--ink-3); padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.tbtn:hover { background: var(--hover); }
.tbtn.on { color: var(--blue); }
.search { border: 0; background: var(--hover); border-radius: 6px; padding: 4px 8px; width: 160px; outline: none; }
.btn-new { background: var(--blue); color: #fff; border: 0; border-radius: 6px; padding: 5px 12px; font-weight: 500; cursor: pointer; margin-left: 6px; white-space: nowrap; }
.btn-new:hover { background: var(--blue-hover); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 12px; }
.chip { border: 1px solid var(--line-2); background: none; border-radius: 99px; padding: 2px 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--b-blue); color: var(--c-blue); border-color: transparent; }

/* pills */
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 3px; font-size: 13px; line-height: 20px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pill.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; flex: none; }
.pill.round { border-radius: 10px; }
.k-gray { color: var(--c-gray); background: var(--b-gray); } .k-brown { color: var(--c-brown); background: var(--b-brown); }
.k-orange { color: var(--c-orange); background: var(--b-orange); } .k-yellow { color: var(--c-yellow); background: var(--b-yellow); }
.k-green { color: var(--c-green); background: var(--b-green); } .k-blue { color: var(--c-blue); background: var(--b-blue); }
.k-purple { color: var(--c-purple); background: var(--b-purple); } .k-pink { color: var(--c-pink); background: var(--b-pink); }
.k-red { color: var(--c-red); background: var(--b-red); }
.av { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 600; flex: none; }
.person { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.warn-txt { color: var(--c-red); }
.amber-txt { color: var(--c-orange); }

/* ---------- board ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; min-height: 300px; }
.bcol { flex: 0 0 260px; border-radius: 8px; padding: 4px; transition: background .12s; }
.bcol.drop { background: var(--hover); }
.bcol-h { display: flex; align-items: center; gap: 8px; padding: 6px 4px 10px; }
.bcol-h .cnt { color: var(--ink-3); font-size: 13px; }
.bcol-h .sum { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.bcard { background: var(--card); border-radius: 6px; box-shadow: var(--shadow-card); padding: 9px 10px; margin-bottom: 8px; cursor: pointer; user-select: none; }
.bcard:hover { background: var(--hover); }
.bcard[draggable="true"] { cursor: grab; }
.bcard.dragging { opacity: .4; }
.bcard .t { font-weight: 500; font-size: 14px; line-height: 1.35; }
.bcard .prop { font-size: 12px; color: var(--ink-2); margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bcard .nx { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.35; }
.add-row { border: 0; background: none; color: var(--ink-3); width: 100%; text-align: left; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.add-row:hover { background: var(--hover); }

/* ---------- table ---------- */
.tbl-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table.db { border-collapse: collapse; min-width: 100%; font-size: 14px; }
table.db th { font-weight: 400; color: var(--ink-3); text-align: left; padding: 0 8px; height: 33px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
table.db th:last-child, table.db td:last-child { border-right: 0; }
table.db th:hover { background: var(--hover); }
table.db th .ti { opacity: .6; margin-right: 6px; font-size: 12px; }
table.db td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0 8px; height: 37px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
table.db td:hover { background: var(--hover); }
table.db td.name { font-weight: 500; position: relative; min-width: 200px; }
table.db td.name .open { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 500; color: var(--ink-2); background: var(--bg); box-shadow: var(--shadow-card); border-radius: 4px; padding: 1px 6px; display: none; letter-spacing: .03em; }
table.db tr:hover td.name .open { display: block; }
table.db td.r, table.db th.r { text-align: right; }
table.db td.empty-cell { color: var(--ink-4); }
.tbl-foot { color: var(--ink-3); font-size: 12px; padding: 8px; display: flex; justify-content: space-between; }

/* list (phone version of the table) */
.list .li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .li:active { background: var(--hover); }
.list .li .ic { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.list .li .body { flex: 1; min-width: 0; }
.list .li .t { font-weight: 500; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.list .li .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .li .m { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; font-size: 12px; }

/* ---------- peek (account page) ---------- */
.peek-scrim { position: fixed; inset: 0; z-index: 20; background: rgba(15, 15, 15, .2); }
.peek { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 92vw); background: var(--bg); z-index: 21; box-shadow: var(--shadow-pop); overflow-y: auto; display: flex; flex-direction: column; }
.peek-top { position: sticky; top: 0; background: var(--bg); z-index: 2; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; }
.peek-top .grow { flex: 1; }
.peek-body { padding: 18px 48px 60px; }
.acc-ic { width: 64px; height: 64px; border-radius: 10px; display: grid; place-items: center; font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.acc-title { font-size: 32px; font-weight: 700; line-height: 1.2; outline: none; border-radius: 4px; margin: 0 0 14px; word-break: break-word; }
.acc-title:empty::before { content: "Untitled"; color: var(--ink-4); }
.props { display: grid; grid-template-columns: 170px 1fr; row-gap: 1px; margin-bottom: 14px; }
.props .pl { display: flex; align-items: center; gap: 8px; color: var(--ink-3); padding: 0 6px; min-height: 34px; border-radius: 4px; font-size: 14px; }
.props .pl svg { width: 15px; height: 15px; flex: none; opacity: .75; }
.props .pv { min-height: 34px; display: flex; align-items: center; padding: 4px 8px; border-radius: 4px; cursor: pointer; min-width: 0; word-break: break-word; }
.props .pv:hover { background: var(--hover); }
.props .pv.empty { color: var(--ink-4); }
.props .pv.ro { cursor: default; } .props .pv.ro:hover { background: none; }
.callout { display: flex; gap: 10px; padding: 14px 16px; border-radius: 6px; background: var(--b-gray); margin: 6px 0 18px; align-items: flex-start; }
.callout .ce { font-size: 18px; line-height: 1.3; }
.callout.red { background: var(--b-red); } .callout.yellow { background: var(--b-yellow); } .callout.green { background: var(--b-green); }
.hr { height: 1px; background: var(--line); margin: 18px 0; }
h2.sec { font-size: 18px; font-weight: 600; margin: 22px 0 8px; }
.composer { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; margin-bottom: 14px; }
.composer textarea { width: 100%; border: 0; outline: none; resize: none; background: none; min-height: 44px; font-size: 15px; padding: 4px 0; }
.composer .kinds { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.composer .kinds button { border: 0; border-radius: 99px; padding: 3px 10px; font-size: 13px; cursor: pointer; background: var(--hover); color: var(--ink-2); }
.composer .kinds button.on { background: var(--ink); color: var(--bg); }
.composer .foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.composer .foot input { border: 1px solid var(--line-2); background: none; border-radius: 6px; padding: 4px 8px; font-size: 13px; min-width: 0; }
.composer .foot .ns { flex: 1 1 180px; }
.composer .foot .send { margin-left: auto; }
.act { display: flex; gap: 10px; padding: 10px 0; }
.act .body { flex: 1; min-width: 0; }
.act .h { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.act .h b { color: var(--ink); font-weight: 500; }
.act .note { white-space: pre-wrap; margin-top: 2px; word-break: break-word; }
.act .x { border: 0; background: none; color: var(--ink-4); cursor: pointer; margin-left: auto; padding: 0 4px; }
.act .x:hover { color: var(--c-red); }
.act.sys .note { color: var(--ink-2); }

/* ---------- popover editor ---------- */
.pop { position: fixed; z-index: 40; background: var(--pop); border-radius: 6px; box-shadow: var(--shadow-pop); min-width: 240px; max-width: 320px; max-height: 360px; overflow-y: auto; padding: 6px; }
.pop input, .pop textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 8px; background: var(--hover); outline: none; }
.pop input:focus, .pop textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(35, 131, 226, .25); }
.pop .hint { font-size: 12px; color: var(--ink-3); padding: 6px 4px 2px; }
.pop .opt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 4px; cursor: pointer; min-height: 32px; }
.pop .opt:hover, .pop .opt.kb { background: var(--hover); }
.pop .opt .chk { margin-left: auto; color: var(--ink-3); }
.pop .row { display: flex; gap: 6px; margin-top: 6px; }
.pop .row button { flex: 1; }
.pop .lnk { border: 0; background: none; color: var(--ink-3); padding: 6px; cursor: pointer; font-size: 13px; text-align: left; border-radius: 4px; }
.pop .lnk:hover { background: var(--hover); }
.pop .quick { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.pop .quick button { border: 1px solid var(--line-2); background: none; border-radius: 4px; font-size: 12px; padding: 3px 7px; cursor: pointer; }

/* ---------- quick add modal ---------- */
.modal-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(15, 15, 15, .45); }
.modal { position: fixed; z-index: 31; top: 12vh; left: 50%; transform: translateX(-50%); width: min(520px, 94vw); background: var(--bg); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 22px 24px 20px; max-height: 80vh; overflow-y: auto; }
.modal h2 { margin: 0 0 4px; font-size: 20px; }
.modal .sub { color: var(--ink-3); margin-bottom: 16px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.field label i { font-style: normal; font-weight: 400; color: var(--ink-3); }
.field input { width: 100%; border: 1px solid var(--line-2); border-radius: 6px; padding: 9px 10px; background: var(--hover); outline: none; font-size: 15px; }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(35, 131, 226, .25); background: var(--bg); }
.field .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.field .pills button { border: 1px solid transparent; cursor: pointer; height: 28px; font-size: 13px; padding: 0 10px; border-radius: 4px; opacity: .55; }
.field .pills button.on { opacity: 1; outline: 2px solid currentColor; outline-offset: 1px; }
.field .two { display: flex; gap: 8px; } .field .two > * { flex: 1; min-width: 0; }
.field .quick { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.field .quick button { border: 1px solid var(--line-2); background: none; border-radius: 99px; font-size: 12px; padding: 3px 10px; cursor: pointer; color: var(--ink-2); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn { border: 1px solid var(--line-2); background: none; border-radius: 6px; padding: 7px 14px; cursor: pointer; font-weight: 500; }
.btn:hover { background: var(--hover); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-hover); }
.btn.danger { color: var(--c-red); }

/* ---------- clients / admin / activity ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.stat { padding: 12px 14px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .l { font-size: 12px; color: var(--ink-3); }
.stat .v { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .s { font-size: 12px; color: var(--ink-3); }
.stat.bad .v { color: var(--c-red); }
.chartbox { position: relative; margin-bottom: 18px; }
.chartbox svg text { fill: var(--ink-3); font: 11px var(--font); }
.tip { position: absolute; pointer-events: none; background: var(--pop); box-shadow: var(--shadow-pop); color: var(--ink); font-size: 12px; padding: 5px 8px; border-radius: 4px; white-space: nowrap; transform: translate(-50%, -115%); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gcard { border-radius: 6px; box-shadow: var(--shadow-card); background: var(--card); padding: 14px; cursor: pointer; }
.gcard:hover { background: var(--hover); }
.gcard.sel { box-shadow: 0 0 0 2px var(--blue); }
.gcard .h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gcard .h b { font-weight: 600; font-size: 15px; }
.gcard .big { font-size: 22px; font-weight: 600; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.gcard .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.gcard .kv b { display: block; color: var(--ink); font-weight: 500; font-size: 13px; font-variant-numeric: tabular-nums; }
.up { color: var(--c-green); } .down { color: var(--c-red); }
.mix { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 12px; background: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.meter { margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.meter .track { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.meter .fill { height: 100%; background: var(--c-green); }
.day-h { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 22px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.feed .act { border-bottom: 1px solid var(--line); }
.feed .act a { font-weight: 600; text-decoration: none; cursor: pointer; }
.feed .act a:hover { text-decoration: underline; }
.empty { color: var(--ink-3); padding: 40px 10px; text-align: center; }
.empty b { color: var(--ink); }
.admin-sec { margin-bottom: 30px; }
.admin-sec p { color: var(--ink-2); margin: 4px 0 10px; }
table.plain { border-collapse: collapse; width: 100%; font-size: 13px; }
table.plain th { text-align: left; font-weight: 400; color: var(--ink-3); border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; }
table.plain td { border-bottom: 1px solid var(--line); padding: 7px 8px; }
table.plain td.r, table.plain th.r { text-align: right; }
table.plain select { border: 1px solid var(--line-2); background: var(--bg); border-radius: 4px; padding: 3px 6px; max-width: 200px; }
.file-drop { border: 1px dashed var(--line-2); border-radius: 8px; padding: 22px; text-align: center; color: var(--ink-3); cursor: pointer; display: block; }
.file-drop:hover { background: var(--hover); }
.help { max-width: 680px; }
.help h2 { font-size: 20px; margin: 26px 0 6px; }
.help ol, .help ul { padding-left: 22px; } .help li { margin: 6px 0; }
.kbd { font-family: var(--mono); font-size: 12px; background: var(--hover-2); border-radius: 3px; padding: 1px 5px; }

.toast { position: fixed; bottom: calc(24px + var(--tab-h)); left: 50%; transform: translateX(-50%); background: #2f2f2f; color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 50; font-size: 14px; box-shadow: var(--shadow-pop); display: flex; gap: 12px; align-items: center; max-width: 92vw; }
.toast.bad { background: var(--c-red); }
.toast button { border: 0; background: none; color: #8ec5ff; cursor: pointer; font-weight: 500; padding: 0; }
.tabbar { display: none; }

/* ---------- v3: client file tabs, editable notes, contacts, history, ops view, audit ---------- */
.page.xwide { max-width: 1500px; }
.grow { flex: 1; }
.acc-ic.sm { width: 40px; height: 40px; font-size: 16px; border-radius: 8px; margin-bottom: 6px; }
.lnk-btn { border: 0; background: none; color: var(--ink-3); text-align: left; padding: 6px 8px; cursor: pointer; border-radius: 4px; font-size: 13px; }
.lnk-btn:hover { background: var(--hover); color: var(--ink); }
.lnk-in { border: 0; background: none; padding: 0; color: var(--ink-3); text-decoration: underline; text-decoration-color: var(--line-2); cursor: pointer; font-size: inherit; }
.lnk-in:hover { color: var(--ink); }
.ftabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 14px; overflow-x: auto; scrollbar-width: none; }
.ftabs button { border: 0; background: none; padding: 6px 10px 9px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; white-space: nowrap; }
.ftabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.ftabs button i { font-style: normal; font-size: 11px; background: var(--hover-2); border-radius: 8px; padding: 0 6px; margin-left: 4px; color: var(--ink-2); }
.composer .foot.sub { border-top: 0; padding-top: 2px; margin-top: 0; font-size: 13px; color: var(--ink-3); }
.composer .foot.sub label, .edit-note .foot.sub label { display: inline-flex; gap: 6px; align-items: center; }
.composer select, .edit-note select { border: 1px solid var(--line-2); background: var(--bg); border-radius: 6px; padding: 4px 6px; font-size: 13px; }
.act .h .t { color: var(--ink-4); }
.act .acts, .contact .acts { margin-left: auto; display: inline-flex; gap: 2px; opacity: 0; transition: opacity .1s; }
.act:hover .acts, .contact:hover .acts { opacity: 1; }
.act .x, .contact .x { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.act .x:hover, .contact .x:hover { background: var(--hover); color: var(--ink); }
.versions { margin-top: 8px; border-left: 2px solid var(--line-2); padding-left: 10px; }
.ver { margin-bottom: 8px; }
.vh { font-size: 12px; color: var(--ink-3); }
.vt { white-space: pre-wrap; color: var(--ink-2); font-size: 13px; background: var(--hover); border-radius: 4px; padding: 6px 8px; margin-top: 2px; word-break: break-word; }
.edit-note { border: 1px solid var(--blue); border-radius: 8px; padding: 10px; margin: 8px 0; display: grid; gap: 8px; box-shadow: 0 0 0 2px rgba(35, 131, 226, .15); }
.edit-note textarea { width: 100%; border: 0; outline: none; resize: none; background: none; font-size: 15px; min-height: 80px; }
.edit-note .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.edit-note input[type=date] { border: 1px solid var(--line-2); background: var(--bg); border-radius: 6px; padding: 4px 6px; font-size: 13px; }
.contact { display: flex; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.contact .body { flex: 1; min-width: 0; }
.contact .h { display: flex; align-items: center; gap: 4px; }
.contact .links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; }
.contact .links a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.contact .links a:hover { color: var(--blue); border-color: var(--blue); }
.contact .note { font-size: 13px; margin-top: 4px; }
.cform { border: 1px solid var(--line-2); border-radius: 8px; padding: 12px; margin: 10px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cform label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-3); }
.cform input { border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 9px; background: var(--hover); outline: none; }
.cform input:focus { border-color: var(--blue); background: var(--bg); }
.cform .row { grid-column: 1 / -1; justify-content: flex-end; }
.hrow { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hrow .body { flex: 1; min-width: 0; }
.hrow .h { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hrow .h b { color: var(--ink); font-weight: 500; }
.hrow .h a { color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none; }
.hrow .h a:hover { text-decoration: underline; }
.hrow .what { margin-top: 2px; line-height: 1.6; word-break: break-word; }
.hrow .full { margin-top: 6px; }
.tag-act { margin-left: auto; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-4); }
.hrow.delete .tag-act { color: var(--c-red); } .hrow.create .tag-act { color: var(--c-green); } .hrow.restore .tag-act { color: var(--c-blue); }
.ops { display: grid; grid-template-columns: 340px 1fr; gap: 0; border-top: 1px solid var(--line); min-height: 70vh; }
.ops-list { border-right: 1px solid var(--line); padding: 10px 10px 10px 0; position: sticky; top: 45px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; }
.ops-list .search { width: 100%; margin-bottom: 8px; height: 32px; }
.ops-list .chips { margin-bottom: 6px; }
.oi { padding: 10px; border-radius: 6px; cursor: pointer; margin-bottom: 2px; }
.oi:hover { background: var(--hover); }
.oi.on { background: var(--hover-2); }
.oi .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 500; }
.oi .m { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.oi .s { font-size: 13px; color: var(--ink-3); margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ops-pane { padding: 14px 0 40px 32px; min-width: 0; }
.ops-pane .acc-title { font-size: 26px; }
.audit-list { margin-bottom: 10px; }
@media (hover: none) { .act .acts, .contact .acts { opacity: 1; } }
@media (max-width: 760px) {
  .ops { display: block; border-top: 0; }
  .ops-list { border: 0; padding: 0; position: static; max-height: none; }
  .ops-list .search { height: 38px; font-size: 16px; }
  .oi { padding: 12px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .ops-pane { display: none; }
  .cform { grid-template-columns: 1fr; }
  .cform input { font-size: 16px; padding: 10px; }
  .edit-note textarea { font-size: 16px; }
  .composer .foot.sub label { flex: 1 1 45%; }
  .composer .foot.sub select, .composer .foot.sub input { flex: 1; font-size: 15px; padding: 6px; }
  .composer .foot.sub .send { flex: 1 1 100%; padding: 10px; font-size: 16px; }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  :root { --tab-h: calc(58px + env(safe-area-inset-bottom)); }
  body { font-size: 15px; }
  .only-mob { display: inline-block; }
  .side { position: fixed; z-index: 35; left: 0; top: 0; bottom: 0; height: auto; width: 82vw; max-width: 300px; transform: translateX(-100%); transition: transform .2s ease; padding-top: calc(8px + env(safe-area-inset-top)); }
  .side.open { transform: none; box-shadow: var(--shadow-pop); }
  .scrim { position: fixed; inset: 0; z-index: 34; background: rgba(15, 15, 15, .35); }
  .side-nav a, .side-new { min-height: 42px; font-size: 15px; }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(48px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
  .page { padding: 16px 16px calc(40px + var(--tab-h)); }
  .p-icon { font-size: 38px; margin: 4px 0; }
  h1.p-title { font-size: 26px; }
  .p-desc { font-size: 14px; margin-bottom: 12px; }
  .tools { width: 100%; margin-left: 0; padding: 6px 0; }
  .search { flex: 1; width: auto; height: 34px; font-size: 15px; }
  .btn-new { display: none; }
  .tbtn { min-height: 34px; }
  .chip { padding: 5px 12px; font-size: 14px; }
  .board { scroll-snap-type: x mandatory; gap: 10px; margin: 0 -16px; padding: 0 16px 16px; }
  .bcol { flex: 0 0 82vw; scroll-snap-align: center; }
  .bcard { padding: 12px; }
  .bcard .t { font-size: 15px; }
  .peek { width: 100vw; box-shadow: none; padding-bottom: env(safe-area-inset-bottom); }
  .peek-top { padding-top: env(safe-area-inset-top); height: calc(50px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
  .peek-body { padding: 16px 16px 60px; }
  .acc-ic { width: 48px; height: 48px; font-size: 20px; }
  .acc-title { font-size: 26px; }
  .props { grid-template-columns: 132px 1fr; }
  .props .pl, .props .pv { min-height: 42px; font-size: 15px; }
  .props .pl { font-size: 13.5px; line-height: 1.25; }
  .composer textarea { font-size: 16px; }
  .composer .kinds button { padding: 6px 12px; font-size: 14px; }
  .composer .foot input { font-size: 16px; padding: 7px 8px; }
  .pop { left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)) !important; top: auto !important; max-width: none; max-height: 60vh; padding: 10px; border-radius: 12px; }
  .pop input, .pop textarea { font-size: 16px; padding: 10px; }
  .pop .opt { min-height: 44px; font-size: 15px; }
  .modal { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%; border-radius: 14px 14px 0 0; max-height: 92vh; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }
  .field input { font-size: 16px; padding: 11px 12px; }
  .field .pills button { height: 34px; font-size: 14px; }
  .modal .actions .btn { flex: 1; padding: 12px; font-size: 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .gallery { grid-template-columns: 1fr; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--bg); border-top: 1px solid var(--line); height: var(--tab-h); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; color: var(--ink-3); text-decoration: none; cursor: pointer; }
  .tabbar a span { font-size: 19px; line-height: 1.1; filter: grayscale(1); opacity: .7; }
  .tabbar a.on { color: var(--ink); font-weight: 600; }
  .tabbar a.on span { filter: none; opacity: 1; }
  .tabbar .tab-add span { width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 24px; filter: none; opacity: 1; }
}

.who-gate { max-width: 420px; margin: 8vh auto 0; }
.who-gate .btn { width: 100%; padding: 10px; font-size: 15px; }

/* ---------- v6: pipeline blotter ---------- */
.side-nav a.sub { padding-left: 26px; font-size: 13.5px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 6px 0 14px; }
.kpi { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.kpi[data-f] { cursor: pointer; } .kpi[data-f]:hover { background: var(--hover); }
.kpi .l { font-size: 12px; color: var(--ink-3); }
.kpi .v { font-size: 24px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.bad .v { color: var(--c-red); } .kpi.good .v { color: var(--c-green); }
.stagebar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; padding-bottom: 2px; }
.stagebar button { border: 1px solid var(--line); background: none; border-radius: 6px; padding: 4px 8px 4px 4px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; }
.stagebar button b { font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stagebar button:hover { background: var(--hover); }
.stagebar button.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.stagebar button.zero { opacity: .5; }
.stagebar .clear { padding: 4px 10px; color: var(--ink-3); }
table.blotter td { height: auto; padding: 9px 8px; white-space: normal; vertical-align: top; max-width: none; }
table.blotter td.name { min-width: 150px; cursor: pointer; }
table.blotter td.name:hover b { text-decoration: underline; }
table.blotter td.lucell { min-width: 260px; max-width: 380px; cursor: default; }
table.blotter td.lucell:hover { background: none; }
table.blotter td.nx { min-width: 180px; max-width: 260px; }
table.blotter tr.red td.ckc { box-shadow: inset 3px 0 0 var(--c-red); }
table.blotter tr.sel td { background: var(--b-blue); }
table.blotter tr.inl td { background: var(--hover); cursor: default; }
table.blotter .ckc { width: 34px; text-align: center; padding: 9px 4px; }
.ck { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); }
.lu { display: flex; flex-direction: column; gap: 2px; }
.lu-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lu-m { font-size: 12px; color: var(--ink-3); }
.btn.sm { padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.btn.ghost { border-color: transparent; color: var(--ink-3); }
.inl-form { display: grid; gap: 8px; padding: 4px 0; }
.inl-form textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; background: var(--bg); outline: none; resize: vertical; font-size: 14px; }
.inl-form textarea:focus, .inl-form input:focus { border-color: var(--blue); }
.inl-form .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inl-form input, .inl-form select { border: 1px solid var(--line-2); background: var(--bg); border-radius: 6px; padding: 5px 8px; font-size: 13px; outline: none; }
.inl-form .ns { flex: 1 1 200px; }
.inl-form .quick button, .quick button.on { border: 1px solid var(--line-2); background: none; border-radius: 99px; font-size: 12px; padding: 3px 9px; cursor: pointer; color: var(--ink-2); }
.quick button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.inl-form .kinds { display: flex; gap: 4px; flex-wrap: wrap; }
.inl-form .kinds button { border: 0; border-radius: 99px; padding: 3px 10px; font-size: 13px; cursor: pointer; background: var(--bg); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line-2); }
.inl-form .kinds button.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.bulkbar { position: sticky; bottom: 16px; z-index: 6; margin: 12px auto 0; width: fit-content; max-width: 100%; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--pop); box-shadow: var(--shadow-pop); border-radius: 10px; padding: 8px 12px; }
.bulkbar b { margin-right: 6px; }
.hint-line { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.field.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 6px; padding: 9px 10px; background: var(--hover); outline: none; font-size: 15px; resize: vertical; }
.field textarea:focus { border-color: var(--blue); background: var(--bg); }
.field .quick input[type=date] { border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; background: var(--bg); font-size: 12px; }
details.more { margin: 2px 0 6px; } details.more summary { cursor: pointer; color: var(--ink-2); font-size: 13px; margin-bottom: 10px; }
.bl-cards .blc { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.bl-cards .blc.red { border-left: 3px solid var(--c-red); }
.bl-cards .blc.sel { background: var(--b-blue); }
.blc-h { display: flex; align-items: center; gap: 8px; } .blc-h b { font-size: 16px; }
.blc-u { margin-top: 6px; font-size: 14px; }
.blc-n { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.blc-f { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.blc .inl-form { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .kpis { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; scroll-snap-type: x proximity; }
  .kpi { flex: 0 0 132px; padding: 8px 10px; scroll-snap-align: start; }
  .kpi .v { font-size: 20px; }
  .p-desc { display: none; }
  .field.two-col { grid-template-columns: 1fr; }
  .inl-form textarea, .inl-form input, .inl-form select { font-size: 16px; }
  .inl-form .row > * { flex: 1 1 auto; }
  .bulkbar { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tab-h) + 8px); width: auto; }
  .btn.sm { padding: 7px 12px; font-size: 14px; }
}
