/* Industries.club CRM — calm teal theme.
   Layout: dark pine sidebar with tabs on the left, airy sage canvas, white cards. */
:root {
  --bg: #F2F6F5;
  --surface: #FFFFFF;
  --surface-2: #F7FAF9;
  --line: #DFE7E5;
  --line-2: #ECF1EF;
  --text: #1B2C2A;
  --muted: #5D6F6C;
  --faint: #98A8A4;
  --brand: #2B7A73;
  --brand-600: #22645E;
  --brand-soft: #E2F1EE;
  --mint: #7FD1C2;
  --sky: #4F8FB8;
  --sky-soft: #E5F0F7;
  --green: #3E9469;
  --green-soft: #E4F3EA;
  --amber: #C2862A;
  --amber-soft: #FBF0DC;
  --red: #C2564A;
  --red-soft: #F8E6E3;
  --lav: #8287CF;
  --lav-soft: #ECEDF9;
  --side: #15302D;
  --side-2: #1B3B37;
  --side-text: #B5CBC6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 48, 45, .04), 0 6px 20px rgba(22, 48, 45, .05);
  --shadow-lg: 0 18px 50px rgba(22, 48, 45, .18);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --side-w: 248px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 500px at 10% -10%, #D7ECE7 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #E3EEF6 0%, transparent 55%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 38px 34px; box-shadow: var(--shadow-lg); }
.login-card img { height: 58px; display: block; margin: 0 auto 22px; }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.login-card p { text-align: center; margin: 0 0 24px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.shell.collapsed { --side-w: 76px; }
.sidebar { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%); color: var(--side-text);
  display: flex; flex-direction: column; padding: 16px 12px; z-index: 30; overflow-y: auto; overflow-x: hidden; }
.brand-tile { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 8px 12px; margin-bottom: 20px; min-height: 52px; }
.brand-tile img { height: 40px; display: block; margin: 0 auto; }
.collapsed .brand-tile { padding: 8px 4px; justify-content: center; }
.collapsed .brand-tile img { height: 26px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav .grp { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #6F8D88; padding: 12px 12px 6px; white-space: nowrap; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-text); font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(127, 209, 194, .14); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mint); }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav .count { margin-left: auto; background: #E07A6B; color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.collapsed .nav a { justify-content: center; padding: 11px 0; }
.collapsed .nav .l, .collapsed .nav .grp, .collapsed .me-text, .collapsed .nav .count { display: none; }
.collapsed .nav a .count-dot { display: block; }
.count-dot { display: none; position: absolute; top: 7px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: #E07A6B; }
.sidebar .me { margin-top: auto; padding: 14px 6px 4px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.sidebar .me b { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .small { color: #7E9C97; white-space: nowrap; }
.me-text { min-width: 0; flex: 1; }
.side-actions { display: flex; gap: 6px; margin-top: 10px; }
.collapsed .side-actions { flex-direction: column; align-items: center; }
.side-btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: transparent; color: var(--side-text); cursor: pointer; font-size: 12.5px; }
.side-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-btn svg { width: 15px; height: 15px; }
.collapsed .side-btn .l { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 32px; background: rgba(242,246,245,.88); backdrop-filter: blur(10px); }
.topbar h1 { font-size: 21px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.btn.menu-btn { display: none; }
.content { padding: 6px 32px 56px; width: 100%; max-width: 1480px; }
.scrim { display: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; font-size: 13.5px; }
.btn:hover { border-color: #C9D6D3; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 4px 12px rgba(43,122,115,.22); }
.btn.primary:hover { background: var(--brand-600); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.green { background: #25A562; border-color: #25A562; color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.input, .select, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,122,115,.14); }
.input.upper { text-transform: uppercase; }
.input.upper::placeholder { text-transform: none; }
.input.err, .select.err { border-color: var(--red); box-shadow: 0 0 0 3px rgba(194,86,74,.12); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12px; color: var(--red); }
.req::after { content: ' *'; color: var(--red); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }
.phone { display: grid; grid-template-columns: 84px 1fr; gap: 6px; }
.name3 { display: grid; grid-template-columns: 96px 1fr 1fr; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters .input, .filters .select { width: auto; height: 36px; }
.filters .search { min-width: 280px; }
.toolbar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card > .hd h3 { font-size: 14.5px; }
.card > .bd { padding: 18px 20px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.cols { display: grid; gap: 18px; grid-template-columns: repeat(12, minmax(0,1fr)); }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 -4px; }
.section-title h3 { font-size: 15px; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 24px 26px; color: #fff; background:
  radial-gradient(600px 220px at 85% -20%, rgba(127,209,194,.35), transparent 70%), linear-gradient(120deg, #1F4F4A 0%, #2B7A73 55%, #3C8F86 100%); box-shadow: 0 12px 30px rgba(31,79,74,.25); }
.hero::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(255,255,255,.06); }
.hero .hello { font-size: 13px; opacity: .8; }
.hero h2 { font-size: 24px; margin: 2px 0 18px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; position: relative; z-index: 1; }
.hstat { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 14px 16px; display: flex; gap: 14px; align-items: center; min-width: 0; }
.hstat .lbl { font-size: 12px; opacity: .8; }
.hstat .val { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.hstat .sub { font-size: 12px; opacity: .75; }
.hring { --p: 0; width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--mint) calc(var(--p) * 1%), rgba(255,255,255,.18) 0); }
.hring > span { width: 46px; height: 46px; border-radius: 50%; background: #2A6C66; display: grid; place-items: center; font-weight: 700; font-size: 13px; }

/* KPI tiles with sparkline */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi .top { display: flex; align-items: center; gap: 10px; }
.kpi .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.kpi .ic svg { width: 17px; height: 17px; }
.kpi .ic.sky { background: var(--sky-soft); color: var(--sky); } .kpi .ic.lav { background: var(--lav-soft); color: var(--lav); } .kpi .ic.amber { background: var(--amber-soft); color: var(--amber); } .kpi .ic.green { background: var(--green-soft); color: var(--green); } .kpi .ic.red { background: var(--red-soft); color: var(--red); }
.kpi .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .val { font-size: 26px; font-weight: 700; margin-top: 8px; letter-spacing: -0.02em; line-height: 1.15; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .spark { display: block; width: 100%; height: 36px; margin-top: 10px; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }

/* meters */
.meter { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.meter .top { display: flex; justify-content: space-between; align-items: baseline; }
.meter .top .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.meter .top .pct { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 20px; background: var(--line-2); color: var(--muted); }
.meter .top .pct.good { background: var(--green-soft); color: var(--green); } .meter .top .pct.warn { background: var(--amber-soft); color: var(--amber); } .meter .top .pct.bad { background: var(--red-soft); color: var(--red); }
.meter .figure { font-size: 22px; font-weight: 700; margin: 6px 0 12px; letter-spacing: -0.02em; }
.meter .figure small { font-size: 13px; color: var(--muted); font-weight: 500; }
.bar { position: relative; height: 8px; background: var(--line-2); border-radius: 6px; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--brand); transition: width .6s ease; }
.bar > .pace { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .3; border-radius: 2px; }
.bar.good > i { background: linear-gradient(90deg, #67B48C, var(--green)); } .bar.warn > i { background: linear-gradient(90deg, #DDB063, var(--amber)); } .bar.bad > i { background: linear-gradient(90deg, #D98C80, var(--red)); }
.meter .foot { font-size: 12px; color: var(--muted); margin-top: 8px; }
.ring { --p: 0; --c: var(--brand); width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-2) 0); display: grid; place-items: center; flex: none; }
.ring > span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 15px; }

/* leaderboard */
.lb-row { display: grid; grid-template-columns: 28px minmax(0, 1.4fr) minmax(0, 2fr) 54px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.lb-row:last-child { border-bottom: none; }
.rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--muted); }
.rank.r1 { background: #F6E7C1; color: #8A6514; } .rank.r2 { background: #E5EAEC; color: #56656A; } .rank.r3 { background: #F2DCCB; color: #8A5532; }
.lb-stats { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.lb-stats b { color: var(--text); font-size: 13px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #F6FAF9; }
.t td.r, .t th.r { text-align: right; }
.t tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }

/* badges, tags */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; font-size: 11px; font-weight: 700; border-radius: 20px; background: var(--line-2); color: var(--muted); white-space: nowrap; letter-spacing: .02em; }
.badge.blue { background: var(--sky-soft); color: var(--sky); }
.badge.teal { background: var(--brand-soft); color: var(--brand); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.lav { background: var(--lav-soft); color: var(--lav); }
.tag { --tc: #5B8A8A; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; font-size: 11px; font-weight: 600; border-radius: 6px; white-space: nowrap;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, white); border: 1px solid color-mix(in srgb, var(--tc) 25%, white); }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tc); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-pick { cursor: pointer; opacity: .55; padding: 4px 10px 4px 8px; font-size: 12px; }
.tag-pick.on { opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 35%, white); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.from-mgmt { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--lav); background: var(--lav-soft); padding: 1px 8px; border-radius: 20px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button { background: none; border: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 13.5px; }
.tabs .active { color: var(--brand); border-bottom-color: var(--brand); }
.seg { display: inline-flex; background: #E6EEEC; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; white-space: nowrap; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 6px 13px; border-radius: 20px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.chip:hover { border-color: #C9D6D3; color: var(--text); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* pipeline */
.pipe-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.fstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.fbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); }
.fbox .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.fbox .val { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.fbox .sub { font-size: 11.5px; color: var(--faint); }
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: 60vh; scroll-behavior: auto; }
.col { flex: 0 0 286px; background: #E8EFED; border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 250px); border-top: 4px solid var(--sc, #8A9BA8); }
.col .ch { padding: 12px 14px 8px; }
.col .ch .t1 { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12.5px; letter-spacing: .02em; }
.col .ch .t1 .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col .ch .t2 { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.prob { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 20px; background: rgba(255,255,255,.7); color: var(--muted); }
.col .cards { padding: 4px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; min-height: 70px; }
.col.drop { background: #DCEBE7; box-shadow: inset 0 0 0 2px var(--brand); }
.col-add { flex: 0 0 220px; border: 2px dashed #C8D6D2; border-radius: 14px; min-height: 120px; display: grid; place-items: center; color: var(--muted); font-weight: 600; cursor: pointer; background: transparent; }
.col-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.dcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px 10px 14px; cursor: grab; box-shadow: 0 1px 2px rgba(22,48,45,.05); user-select: none; touch-action: pan-x pan-y; transition: box-shadow .15s, border-color .15s; }
.dcard:hover { border-color: #C3D3CF; box-shadow: 0 4px 14px rgba(22,48,45,.08); }
.dcard .grip { position: absolute; right: 6px; top: 8px; width: 26px; height: 26px; display: grid; place-items: center; color: var(--faint); border-radius: 6px; cursor: grab; touch-action: none; }
.dcard .grip:hover { background: var(--line-2); }
.dcard .co { font-weight: 700; font-size: 13px; padding-right: 26px; line-height: 1.35; }
.dcard .pp { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dcard .ft { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; gap: 8px; }
.dcard .ft .wt { color: var(--faint); font-size: 11px; }
.dcard.ghosted { opacity: .35; }
.drag-ghost { position: fixed; z-index: 200; pointer-events: none; width: 266px; transform: rotate(2.5deg); box-shadow: var(--shadow-lg) !important; opacity: .96; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal .dh { padding: 10px 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.cal .day { min-height: 112px; padding: 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: none; }
.cal .day:hover { background: #F7FBFA; }
.cal .day.out { background: #FAFCFB; color: var(--faint); }
.cal .day.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.cal .day .n { font-size: 12px; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .n { background: var(--brand); color: #fff; }
.cal .ev { font-size: 11px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface-2); border-left: 3px solid var(--muted); }
.cal .ev.done { opacity: .5; text-decoration: line-through; }
.cal .more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.tcolor-TASK { border-left-color: #8A9BA8 !important; } .tcolor-FOLLOW-UP { border-left-color: #D9A85B !important; }
.tcolor-DEMO { border-left-color: #8287CF !important; } .tcolor-MEETING { border-left-color: #2B7A73 !important; }
.tcolor-EVENT { border-left-color: #4F8FB8 !important; } .tcolor-ONBOARDING { border-left-color: #3E9469 !important; } .tcolor-REMINDER { border-left-color: #C2564A !important; }
.agenda-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 4px 11px 12px; border-left: 3px solid var(--muted); border-radius: 4px; margin-bottom: 6px; background: var(--surface-2); cursor: pointer; }
.agenda-item:hover { background: #EEF5F3; }
.agenda-item input[type=checkbox] { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; flex: none; }
.agenda-item .tt { font-weight: 600; font-size: 13px; }
.agenda-item.done .tt { text-decoration: line-through; color: var(--muted); }
.agenda-list { max-height: 440px; overflow-y: auto; padding-right: 4px; }

/* timeline */
.tl { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.tl:last-child { border-bottom: none; }
.tl .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.tl .ic svg { width: 15px; height: 15px; }
.tl .body { flex: 1; min-width: 0; }
.tl .meta { font-size: 12px; color: var(--muted); }
.tl .note { margin-top: 4px; white-space: pre-wrap; }
dl.kv { display: grid; grid-template-columns: 120px 1fr; gap: 9px 12px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; word-break: break-word; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(16, 36, 34, .38); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 80; overflow-y: auto; animation: fade .12s ease-out; }
.modal { width: 100%; max-width: 580px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.modal.wide { max-width: 840px; }
.modal .mh { display: flex; align-items: center; padding: 20px 24px 0; }
.modal .mh h2 { font-size: 18px; }
.modal .mb { padding: 18px 24px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(10px) scale(.99); opacity: 0; } }
.alert { padding: 10px 14px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 13px; margin-bottom: 12px; }
.alert.info { background: var(--sky-soft); color: var(--sky); }
.alert.ok { background: var(--green-soft); color: var(--green); }
.alert.warn { background: var(--amber-soft); color: #8A5E17; }
.codebox { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 26px; letter-spacing: .3em; text-align: center; padding: 16px; background: var(--brand-soft); color: var(--brand-600); border-radius: 12px; font-weight: 700; }
.timer { display: flex; align-items: center; gap: 8px; }
.timer .clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; min-width: 64px; }
.wa-bubble { background: #E3F7D6; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; font-size: 14px; border: 1px solid #CBEBB8; }
.assignees { display: flex; flex-wrap: wrap; gap: 6px; }

/* toast */
.toasts { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 300; align-items: center; }
.toast { background: var(--side); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow-lg); animation: pop .15s ease-out; max-width: min(520px, 90vw); }
.toast.err { background: var(--red); }

/* charts */
.hbar { display: grid; grid-template-columns: 150px 1fr 96px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--line-2); border-radius: 6px; position: relative; overflow: hidden; }
.hbar .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 5px 5px 0; background: var(--brand); }
.hbar .track i.w2 { background: var(--mint); }
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.vbars .vb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vbars .vb i { width: 100%; max-width: 38px; background: linear-gradient(180deg, #4C9C94, var(--brand)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.vbars .vb .v, .vbars .vb .d { font-size: 11px; color: var(--muted); }
.funnel .fr { display: grid; grid-template-columns: 120px 1fr 60px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.funnel .fr .fb { height: 22px; background: linear-gradient(90deg, var(--brand), #4C9C94); border-radius: 6px; }
.insight { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; align-items: flex-start; }
.insight:last-child { border-bottom: none; }
.score { display: inline-grid; place-items: center; min-width: 40px; height: 24px; border-radius: 7px; font-weight: 700; font-size: 12px; padding: 0 6px; }
.score.good { background: var(--green-soft); color: var(--green); } .score.warn { background: var(--amber-soft); color: var(--amber); } .score.bad { background: var(--red-soft); color: var(--red); }
.stackbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--line-2); gap: 2px; }
.stackbar i { display: block; height: 100%; }
.pcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.pcard + .pcard { margin-top: 10px; }
.pcard .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 12px; }
.pcard .nums .lbl { font-size: 11px; color: var(--muted); }
.pcard .nums b { font-size: 15px; }
.stage-row { display: grid; grid-template-columns: 24px minmax(120px, 1fr) 150px 84px 44px 76px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.stage-row .handle { cursor: grab; color: var(--faint); text-align: center; }
input[type=color] { width: 42px; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: #fff; cursor: pointer; }
.typeahead { position: relative; }
.typeahead .list { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; z-index: 10; }
.typeahead .opt { padding: 9px 12px; cursor: pointer; }
.typeahead .opt:hover, .typeahead .opt.hl { background: var(--line-2); }

@media print {
  .sidebar, .topbar .actions, .filters, .tabs, .no-print, .toasts { display: none !important; }
  .shell { display: block; } .content { padding: 0; } body { background: #fff; }
  .card, .kpi, .meter { break-inside: avoid; box-shadow: none; }
  .print-only { display: block; }
}
.print-only { display: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* responsive */
@media (max-width: 1200px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; } .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .fstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); --side-w: 264px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; height: auto; transform: translateX(-105%); transition: transform .22s ease; padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); padding-left: calc(12px + env(safe-area-inset-left, 0px)); }
  .shell.open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .shell.open .scrim { display: block; position: fixed; inset: 0; background: rgba(16,36,34,.4); z-index: 25; }
  .collapsed .nav .l, .collapsed .nav .grp, .collapsed .me-text { display: initial; }
  .collapsed .nav a { justify-content: flex-start; padding: 10px 12px; }
  .collapse-btn { display: none !important; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); flex-wrap: wrap; }
  .topbar h1 { font-size: 18px; }
  .content { padding: 4px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } .span2, .span3 { grid-column: auto; }
  .filters .search { min-width: 0; flex: 1; }
  .hbar { grid-template-columns: 96px 1fr 76px; }
  .hero { padding: 20px; } .hero h2 { font-size: 20px; }
  .col { flex-basis: 260px; max-height: none; }
  .lb-row { grid-template-columns: 26px minmax(0, 1fr) 50px; } .lb-row .lb-stats { display: none; }
}
@media (max-width: 520px) { .hero-stats { grid-template-columns: minmax(0, 1fr); } .fstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .fbox { padding: 10px 12px; } .fbox .val { font-size: 17px; } .fbox .sub { display: none; } .stage-row { grid-template-columns: 20px 1fr 70px 60px; } .stage-row .tagsel, .stage-row input[type=color] { display: none; } }
.from-mgmt svg { width: 12px; height: 12px; flex: none; }
