/* CRM-style admin (sidebar + top bar + content), blue accent. */
:root {
  --bg: #f2f4f7; --panel: #fff; --ink: #101828; --ink2: #344054; --muted: #667085; --line: #eaecf0; --line2: #d0d5dd;
  --side: #0f1729; --side-ink: #c7cfdc; --side-hover: #1d2840; --side-on: #24314f;
  --pri: #155eef; --pri-d: #0040c1; --pri-soft: #eff4ff; --pri-ring: #c7d7fe;
  --danger: #d92d20; --danger-soft: #fef3f2; --ok: #079455; --ok-soft: #ecfdf3; --warn: #dc6803; --warn-soft: #fffaeb;
  --purple: #6938ef; --purple-soft: #f4f3ff;
  --r: 8px; --sh: 0 1px 2px rgba(16, 24, 40, .05); --sh2: 0 12px 16px -4px rgba(16, 24, 40, .08), 0 4px 6px -2px rgba(16, 24, 40, .03);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
a { color: var(--pri); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
.boot { padding: 40px; color: var(--muted); }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; min-height: 0; }
.acct { margin: 14px 12px 10px; padding: 9px 10px; border-radius: 8px; background: #1a2438; display: flex; align-items: center; gap: 10px; }
.acct .lg { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #2e90fa, #155eef); color: #fff; display: grid; place-items: center; font-weight: 800; }
.acct b { color: #fff; font-size: 13px; display: block; }
.acct small { color: #98a2b3; font-size: 11px; }
.snav { padding: 6px 10px; display: grid; gap: 2px; overflow-y: auto; }
.snav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #667085; padding: 12px 10px 4px; }
.snav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 6px; color: var(--side-ink); font-weight: 500; }
.snav a:hover { background: var(--side-hover); color: #fff; }
.snav a.on { background: var(--side-on); color: #fff; }
.snav a.on .ic { color: #84adff; }
.snav .cnt { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid #1f2a40; font-size: 12px; display: grid; gap: 6px; }
.mode { display: inline-flex; align-items: center; gap: 6px; color: #fdb022; }
.mode.live { color: #47cd89; }
.ic { width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center; }
.ic svg { width: 18px; height: 18px; }

.work { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 20px; flex: none; }
.top h1 { font-size: 17px; margin: 0; font-weight: 600; white-space: nowrap; }
.tabs-top { display: flex; gap: 2px; align-self: stretch; }
.tabs-top a { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tabs-top a:hover { color: var(--ink); }
.tabs-top a.on { color: var(--pri); border-bottom-color: var(--pri); }
.top .sp { flex: 1; }
.gsearch { position: relative; }
.gsearch input[type=search] { width: 240px; padding-left: 34px; background: #f9fafb; }
.gsearch .ic { position: absolute; left: 9px; top: 8px; color: var(--muted); }
.bell { position: relative; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--ink2); cursor: pointer; border: 1px solid var(--line); background: #fff; }
.bell:hover { background: #f9fafb; }
.bell .dotn { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }
.me { width: 34px; height: 34px; border-radius: 50%; background: #f4ebff; color: #6941c6; display: grid; place-items: center; font-weight: 700; cursor: pointer; border: 0; }
.menu { position: absolute; right: 16px; top: 52px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--sh2); min-width: 180px; z-index: 40; padding: 4px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: #f9fafb; }
.content { flex: 1; overflow: auto; padding: 20px; min-height: 0; }
.content.flush { padding: 0; overflow: hidden; display: flex; }
.banner { background: var(--warn-soft); color: #93370d; border-bottom: 1px solid #fedf89; padding: 7px 20px; font-size: 13px; flex: none; }

/* ---------- basics ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: #fff; color: var(--ink2); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; box-shadow: var(--sh); }
.btn:hover { background: #f9fafb; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pri:hover { background: var(--pri-d); }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; }
.btn.ghost:hover { background: #f2f4f7; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.xs { padding: 3px 7px; font-size: 12px; box-shadow: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn .ic, .btn .ic svg { width: 16px; height: 16px; }
input[type=text], input[type=number], input[type=password], input[type=time], input[type=search], select, textarea {
  border: 1px solid var(--line2); border-radius: 8px; padding: 8px 11px; background: #fff; min-width: 0; box-shadow: var(--sh);
}
textarea { width: 100%; resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #84adff; box-shadow: 0 0 0 4px var(--pri-soft); }
label.f { display: grid; gap: 6px; font-size: 13px; color: var(--ink2); font-weight: 500; }
label.f > input, label.f > select, label.f > textarea { width: 100%; font-weight: 400; color: var(--ink); }
label.ck { display: flex; gap: 8px; align-items: center; cursor: pointer; color: var(--ink2); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--pri); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted, .sub { color: var(--muted); font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh); }
.card-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-b { padding: 16px 20px; }
.form { display: grid; gap: 14px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: #f2f4f7; color: var(--ink2); white-space: nowrap; border: 1px solid transparent; }
.chip.red { background: var(--danger-soft); color: #b42318; }
.chip.green { background: var(--ok-soft); color: #067647; }
.chip.blue { background: var(--pri-soft); color: #004eeb; }
.chip.amber { background: var(--warn-soft); color: #b54708; }
.chip.purple { background: var(--purple-soft); color: #5925dc; }
.chip.out { background: #fff; border-color: var(--line2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; color: #fff; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.lg { width: 56px; height: 56px; font-size: 20px; }
.empty { color: var(--muted); padding: 40px; text-align: center; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; box-shadow: var(--sh); }
.seg button { border: 0; background: #fff; padding: 7px 12px; cursor: pointer; color: var(--ink2); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: #f2f4f7; color: var(--ink); }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px 20px; display: grid; gap: 6px; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.kpi .ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; margin-left: auto; }
.dgrid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.dgrid .wide { grid-column: 1 / -1; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 34px; background: var(--pri); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.donut { width: 160px; height: 160px; border-radius: 50%; margin: 6px auto 14px; position: relative; }
.donut::after { content: ""; position: absolute; inset: 26px; background: #fff; border-radius: 50%; }
.donut .c { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; font-size: 12px; color: var(--muted); }
.donut .c b { display: block; font-size: 22px; color: var(--ink); }
.legend { display: grid; gap: 6px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend b { margin-left: auto; }
.funnel .fr { display: grid; grid-template-columns: 120px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.funnel .track { background: #f2f4f7; border-radius: 6px; height: 24px; overflow: hidden; }
.funnel .track i { display: block; height: 100%; border-radius: 6px; }

/* ---------- opportunities board ---------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; height: 100%; }
.col { width: 290px; flex: none; display: flex; flex-direction: column; max-height: 100%; background: #eaecf0; border-radius: 10px; }
.col-h { padding: 12px 12px 10px; display: grid; gap: 4px; border-top: 3px solid transparent; border-radius: 10px 10px 0 0; }
.col-h .nm { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.col-h .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.col-b { padding: 0 8px 10px; overflow-y: auto; display: grid; gap: 8px; min-height: 80px; align-content: start; }
.col.over { outline: 2px dashed var(--pri); outline-offset: -2px; }
.oc { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; cursor: grab; box-shadow: var(--sh); display: grid; gap: 7px; }
.oc:hover { border-color: var(--line2); box-shadow: var(--sh2); }
.oc.drag { opacity: .4; }
.oc.alert { box-shadow: inset 3px 0 0 var(--danger), var(--sh); }
.oc .t { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.oc .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc .kv2 { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 12px; }
.oc .kv2 dt { color: var(--muted); }
.oc .kv2 dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc .m { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.oc .ft { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 7px; }
.oc .ft .ic { color: var(--muted); width: 16px; height: 16px; }
.oc .ft .ic svg { width: 15px; height: 15px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: #f9fafb; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #f9fafb; }
.tbl .who { display: flex; align-items: center; gap: 10px; }
.tbl .who b { display: block; font-weight: 600; }

/* ---------- conversations ---------- */
.cv { display: grid; grid-template-columns: 340px 1fr 320px; height: 100%; width: 100%; min-height: 0; }
.cv-list { border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.cv-list .hd { padding: 14px 14px 8px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.cv-tabs { display: flex; gap: 14px; }
.cv-tabs button { border: 0; background: none; padding: 6px 0; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.cv-tabs button.on { color: var(--pri); border-bottom-color: var(--pri); }
.cv-items { overflow-y: auto; flex: 1; }
.ci { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid #f2f4f7; cursor: pointer; align-items: center; }
.ci:hover { background: #f9fafb; }
.ci.on { background: var(--pri-soft); }
.ci .av { grid-row: span 2; }
.ci .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.ci .tm { font-size: 12px; color: var(--muted); }
.ci .sn { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci .un { width: 9px; height: 9px; border-radius: 50%; background: var(--pri); justify-self: end; }
.cv-chat { display: flex; flex-direction: column; min-height: 0; background: #fff; }
.cv-chat .hd { height: 64px; padding: 0 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex: none; }
.msgs { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; background: #f9fafb; }
.daysep { align-self: center; font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.bub { max-width: 68%; padding: 9px 12px 6px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.bub.in { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-top-left-radius: 4px; }
.bub.out { background: var(--pri); color: #fff; align-self: flex-end; border-top-right-radius: 4px; }
.bub.out.auto { background: #3e4784; }
.bub.out.phone { background: #079455; }
.bub.fail { background: var(--danger-soft) !important; color: #b42318 !important; border: 1px solid #fecdca; }
.bub .meta { font-size: 11px; opacity: .75; margin-top: 4px; text-align: right; }
.bub .tag { font-size: 11px; opacity: .85; margin-bottom: 3px; font-weight: 600; }
.bub video { max-width: 280px; border-radius: 8px; display: block; margin-bottom: 6px; background: #000; }
.composer { border-top: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 10px; flex: none; }
.composer .ctabs { display: flex; gap: 14px; font-size: 13px; }
.composer .ctabs button { border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; padding: 0 0 4px; border-bottom: 2px solid transparent; }
.composer .ctabs button.on { color: var(--pri); border-bottom-color: var(--pri); }
.composer textarea { min-height: 60px; box-shadow: none; }
.warnbar { background: var(--warn-soft); color: #93370d; font-size: 12px; padding: 7px 10px; border-radius: 6px; }
.cv-side { border-left: 1px solid var(--line); background: #fff; overflow-y: auto; min-height: 0; }
.cv-side .sec { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.cv-side .sec h4 { margin: 0; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.prof { text-align: center; display: grid; justify-items: center; gap: 6px; }
.prof b { font-size: 16px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.timeline { display: grid; gap: 10px; font-size: 12px; max-height: 300px; overflow-y: auto; }
.timeline .ev { display: grid; grid-template-columns: 10px 1fr; gap: 8px; }
.timeline .ev i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); margin-top: 4px; }
.timeline .ev small { color: var(--muted); display: block; }
.run { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 12px; display: grid; gap: 4px; }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tagbox .chip button { border: 0; background: none; cursor: pointer; padding: 0; color: inherit; font-size: 13px; line-height: 1; }
.tagbox input { border: 0; box-shadow: none; padding: 3px; min-width: 80px; flex: 1; }
.tagbox input:focus { box-shadow: none; }

/* ---------- automation ---------- */
.wtop { height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 16px; flex: none; }
.wtop input.wname { border: 1px solid transparent; box-shadow: none; font-weight: 600; font-size: 15px; width: 300px; }
.wtop input.wname:hover { border-color: var(--line2); }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--ink2); }
.toggle .sw { width: 36px; height: 20px; border-radius: 999px; background: #d0d5dd; position: relative; transition: background .15s; }
.toggle .sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--sh); transition: left .15s; }
.toggle.on .sw { background: var(--pri); }
.toggle.on .sw::after { left: 18px; }
.canvas { flex: 1; overflow: auto; background-color: #f2f4f7; background-image: radial-gradient(#d0d5dd 1px, transparent 1px); background-size: 18px 18px; padding: 36px 20px 120px; min-height: 0; }
.flow { display: grid; justify-items: center; max-width: 440px; margin: 0 auto; }
.node { width: 360px; background: #fff; border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--sh); padding: 12px 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; position: relative; }
.node:hover { border-color: #84adff; box-shadow: 0 0 0 4px var(--pri-soft); }
.node.sel { border-color: var(--pri); box-shadow: 0 0 0 4px var(--pri-ring); }
.node .ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.node .ico svg { width: 18px; height: 18px; }
.node .tx { min-width: 0; flex: 1; }
.node .tx b { display: block; font-size: 13px; }
.node .tx span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .del { position: absolute; right: -10px; top: -10px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line2); background: #fff; color: var(--danger); display: none; place-items: center; cursor: pointer; font-size: 12px; }
.node:hover .del { display: grid; }
.trig-wrap { display: flex; gap: 12px; }
.node.trig { border-style: solid; border-color: #84adff; }
.node.trig .ico { background: var(--pri-soft); color: var(--pri); }
.addtrig { width: 360px; border: 1px dashed var(--line2); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); background: rgba(255, 255, 255, .6); }
.lnk { width: 2px; height: 22px; background: #98a2b3; }
.plus { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #98a2b3; background: #fff; color: var(--ink2); cursor: pointer; display: grid; place-items: center; font-size: 16px; line-height: 1; }
.plus:hover { border-color: var(--pri); color: var(--pri); }
.endpill { font-size: 12px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line2); border-radius: 999px; padding: 4px 14px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw; background: #fff; box-shadow: -12px 0 24px rgba(16, 24, 40, .12); z-index: 30; display: flex; flex-direction: column; }
.drawer .dh { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer .dh h3 { margin: 0; font-size: 16px; }
.drawer .db { padding: 20px; overflow-y: auto; flex: 1; display: grid; gap: 16px; align-content: start; }
.drawer .df { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.acts { display: grid; gap: 6px; }
.acts .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 8px; }
.acts button { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 9px 11px; cursor: pointer; }
.acts button:hover { border-color: #84adff; background: var(--pri-soft); }
.acts .ico { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; }
.acts .ico svg { width: 16px; height: 16px; }
.scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 29; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(16, 24, 40, .45); padding: 20px; }
.modal .box { background: #fff; border-radius: 12px; box-shadow: var(--sh2); width: 520px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; }
.modal .mh { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal .mh h3 { margin: 0; font-size: 17px; flex: 1; }
.modal .mb { padding: 20px 22px; overflow-y: auto; display: grid; gap: 14px; }
.modal .mf { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- settings ---------- */
.set { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; max-width: 1100px; }
.set-nav { display: grid; gap: 2px; }
.set-nav a { padding: 8px 12px; border-radius: 6px; color: var(--ink2); font-weight: 500; }
.set-nav a:hover { background: #fff; }
.set-nav a.on { background: #fff; color: var(--pri); box-shadow: var(--sh); }
.stg { display: grid; grid-template-columns: 36px 1fr 110px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.stg input[type=color] { width: 36px; height: 36px; border: 1px solid var(--line2); border-radius: 8px; padding: 3px; background: #fff; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.login .l { display: grid; place-items: center; padding: 30px; }
.login form { width: 360px; display: grid; gap: 18px; }
.login h2 { margin: 0; font-size: 26px; }
.login .r { background: var(--side); color: #c7cfdc; display: grid; place-items: center; padding: 40px; }
.login .r div { max-width: 380px; display: grid; gap: 12px; }
.login .r b { color: #fff; font-size: 22px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; box-shadow: var(--sh2); z-index: 60; max-width: 90vw; font-weight: 500; }
.toast.err { background: var(--danger); }

@media (max-width: 1250px) {
  .cv { grid-template-columns: 300px 1fr; }
  .cv-side { display: none; }
  .dgrid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .acct { margin: 8px; }
  .snav { display: flex; flex-wrap: wrap; padding: 4px 8px; }
  .snav .sec, .side-foot { display: none; }
  .top { flex-wrap: wrap; height: auto; padding: 10px 14px; }
  .gsearch { display: none; }
  .content.flush { height: 80vh; }
  .cv { grid-template-columns: 1fr; }
  .cv-list { max-height: 40vh; }
  .login { grid-template-columns: 1fr; }
  .login .r { display: none; }
  .set { grid-template-columns: 1fr; }
  .node, .addtrig { width: 300px; }
}

/* ---------- tasks, snippets, setup ---------- */
.snav a .cnt.amber { background: #f79009; }
.sec .task { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.sec .task input { margin-top: 3px; }
.sec .task small { color: var(--muted); font-size: 11px; }
.sec .task small.late { color: var(--danger); font-weight: 600; }
.sec .task.done .tt { text-decoration: line-through; color: var(--muted); }
select.snip { width: auto; max-width: 170px; padding: 5px 8px; font-size: 12px; }
.tplprev:not(:empty) { white-space: pre-wrap; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 9px 11px; font-size: 13px; color: var(--ink2); }
.chk { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chk:last-child { border-bottom: 0; }
.chk b { font-weight: 600; }
.mk { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.mk.ok { background: var(--ok-soft); color: var(--ok); }
.mk.no { background: var(--danger-soft); color: var(--danger); }
.mk.opt { background: #f2f4f7; color: var(--muted); }
.copyrow { display: flex; align-items: center; gap: 8px; background: #f9fafb; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.copyrow code { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; word-break: break-all; color: var(--ink2); }
.snipedit { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; align-items: start; }
.snipedit textarea { min-height: 60px; }
