/* Transfomind CRM: one stylesheet. Tokens first, then layout, components and pages. */
:root {
  --brand: #00A19C; --brand-ink: #fff; --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --bg: #F4F7F7; --panel: #FFFFFF; --panel-2: #F8FAFA; --line: #E2E9E9; --line-2: #EDF2F2;
  --text: #14201F; --muted: #5E6E6D; --faint: #8A9897;
  --good: #1A9A55; --good-soft: #E5F6EC; --warn: #B76E00; --warn-soft: #FFF3DD; --bad: #C8372D; --bad-soft: #FDEBEA; --info: #2F6FD0; --info-soft: #E8F0FC;
  --r: 12px; --r-sm: 8px; --shadow: 0 1px 2px rgba(16,32,32,.06), 0 4px 16px -8px rgba(16,32,32,.14); --shadow-lg: 0 20px 50px -20px rgba(16,32,32,.35);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --side: 236px; color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0D1515; --panel: #142020; --panel-2: #182626; --line: #24393A; --line-2: #1D2E2E;
  --text: #E7F0EF; --muted: #9AAEAD; --faint: #6F8483; --good-soft: #10301F; --warn-soft: #33270C; --bad-soft: #3A1714; --info-soft: #112540;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px -10px rgba(0,0,0,.6); color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0D1515; --panel: #142020; --panel-2: #182626; --line: #24393A; --line-2: #1D2E2E;
  --text: #E7F0EF; --muted: #9AAEAD; --faint: #6F8483; --good-soft: #10301F; --warn-soft: #33270C; --bad-soft: #3A1714; --info-soft: #112540;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px -10px rgba(0,0,0,.6); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; }
.ico { flex: none; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-top { padding: 14px 14px 8px; }
.org-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.org-btn:hover { border-color: var(--brand); }
.org-logo { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; flex: none; }
.org-logo img { width: 100%; height: 100%; object-fit: cover; }
.org-btn b { display: block; font-size: 13.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-btn small { color: var(--muted); font-size: 11.5px; }
.nav { padding: 6px 10px; overflow-y: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; margin: 1px 0; text-decoration: none; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav .cnt { margin-left: auto; background: var(--brand); color: var(--brand-ink); border-radius: 99px; font-size: 11px; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center; }
.nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 4px; font-weight: 700; }
.side-foot { padding: 10px 14px 14px; border-top: 1px solid var(--line-2); }
.usage { font-size: 12px; color: var(--muted); }
.usage .bar { margin-top: 5px; }
.wrap-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.top .menu-btn { display: none; }
.search-btn { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; max-width: 420px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--faint); cursor: pointer; font: inherit; }
.search-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-btn kbd { margin-left: auto; font: 11px var(--font); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--faint); }
.top .sp { flex: 1; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px; font-weight: 700; }
#main { flex: 1; overflow-y: auto; min-height: 0; }
.page { padding: 22px 26px 60px; max-width: 1680px; }
.set-grid > :last-child { max-width: 1080px; } /* forms stay readable on wide screens */
.page.full { max-width: none; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin-right: auto; }
.banner { padding: 10px 18px; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.banner.warn { background: var(--warn-soft); color: var(--warn); } .banner.bad { background: var(--bad-soft); color: var(--bad); } .banner.info { background: var(--info-soft); color: var(--info); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.inp, select.inp, textarea.inp { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: 14px var(--font); }
textarea.inp { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.inp.sm { height: 32px; font-size: 13px; }
.field { display: block; margin-bottom: 14px; }
.field > span, .lbl-t { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; margin-bottom: 8px; }
.check input { margin-top: 3px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand); } .switch input:checked::after { left: 19px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; }
.seg button, .seg a { border: 0; background: transparent; color: var(--muted); font: 600 12.5px var(--font); padding: 5px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.seg .on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.seg .n { color: var(--faint); font-weight: 500; margin-left: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--text); border-color: var(--brand); }

/* ---------- dropdowns (js/dropdown.js) ---------- */
/* the closed box, on every device (phones keep their own picker when it opens) */
select.inp { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A9897' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px; }
select.inp:disabled { opacity: .6; cursor: default; }
select.inp option { background: var(--panel); color: var(--text); }
/* on computers: a styled button and list in place of the browser's */
.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0 0 0 0); }
.dd-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; color: var(--text); font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.dd-btn > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn > svg { width: 15px; height: 15px; flex: none; color: var(--faint); transition: transform .15s; }
.dd-btn:hover:not(:disabled) { border-color: var(--brand); }
.dd-btn:disabled { opacity: .6; cursor: default; }
.dd-btn[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dd-btn[aria-expanded="true"] > svg { transform: rotate(180deg); color: var(--brand); }
.dd-menu { position: fixed; z-index: 95; overflow: auto; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: ddIn .12s ease-out; }
.dd-menu.up { animation-name: ddUp; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } }
@keyframes ddUp { from { opacity: 0; transform: translateY(4px); } }
.dd-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text); cursor: pointer; user-select: none; }
.dd-opt > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-opt > svg { width: 15px; height: 15px; flex: none; color: var(--brand); }
.dd-opt.blank { color: var(--muted); }
.dd-opt.act { background: var(--panel-2); }
.dd-opt[aria-selected="true"] { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.dd-opt[aria-selected="true"].act { box-shadow: inset 0 0 0 1px var(--brand); }
.dd-opt[aria-disabled="true"] { color: var(--faint); cursor: default; }
.dd-grp { padding: 9px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
@media (prefers-reduced-motion: reduce) { .dd-menu { animation: none; } .dd-btn, .dd-btn > svg { transition: none; } }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { margin-right: auto; }
.card-body { padding: 16px 18px; }
.cards { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi small { display: block; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.kpi b { display: block; font-size: 24px; letter-spacing: -.02em; margin-top: 4px; }
.kpi .delta { font-size: 12px; font-weight: 600; } .delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.bar { height: 7px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.warn i { background: var(--warn); } .bar.bad i { background: var(--bad); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); position: sticky; top: 0; z-index: 1; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: var(--panel-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; } .badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; } .badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.stage { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--info-soft); color: var(--info); white-space: nowrap; }
.stage.k-won { background: var(--good-soft); color: var(--good); } .stage.k-lost { background: var(--bad-soft); color: var(--bad); }
.lbl { display: inline-block; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 700; line-height: 18px; margin: 1px 3px 1px 0; }
.c-teal { background: #D9F3F1; color: #00716D; } .c-blue { background: #E0ECFC; color: #2457A6; } .c-violet { background: #ECE6FC; color: #5B3BB3; } .c-pink { background: #FCE4EF; color: #A8326A; }
.c-red { background: #FCE5E3; color: #B0342B; } .c-amber { background: #FFF0D4; color: #965A00; } .c-green { background: #DFF4E6; color: #1C7A45; } .c-grey { background: #E9EEEE; color: #556565; }
:root[data-theme="dark"] .lbl { filter: brightness(.85) saturate(1.2); }
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800; flex: none; background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 45% 32%); }
.av.lg { width: 46px; height: 46px; font-size: 16px; } .av.sm { width: 24px; height: 24px; font-size: 10px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty .ico { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }
.skel { background: linear-gradient(90deg, var(--line-2), var(--panel-2), var(--line-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }
.pill-note { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.locked { border: 1px dashed var(--line); border-radius: var(--r); padding: 16px; color: var(--muted); background: var(--panel-2); }
.locked b { color: var(--text); }

/* ---------- toasts, dialogs, menus ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: #14201F; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13.5px; max-width: 90vw; animation: up .2s ease-out; }
.toast.bad { background: var(--bad); } .toast.out { opacity: 0; transition: opacity .3s; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.dlg-wrap { position: fixed; inset: 0; background: rgba(10,20,20,.45); display: grid; place-items: center; z-index: 90; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.dlg { background: var(--panel); border-radius: 16px; width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.dlg.wide { width: min(760px, 100%); }
.dlg-head { display: flex; align-items: center; padding: 16px 18px 6px; } .dlg-head h2 { margin-right: auto; }
.dlg-body { padding: 10px 18px; overflow-y: auto; } .dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.menu { position: fixed; z-index: 80; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; max-height: 70vh; overflow-y: auto; }
.menu button, .menu a { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: transparent; color: var(--text); font: 500 13.5px var(--font); border-radius: 8px; cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--panel-2); }
.menu .sep { height: 1px; background: var(--line-2); margin: 5px 0; }
.menu .h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 6px 10px 2px; font-weight: 700; }

/* ---------- search (Ctrl+K) ---------- */
.cmdk { width: min(620px, 100%); align-self: start; margin-top: 10vh; }
.cmdk input { border: 0; border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0; height: 54px; font-size: 16px; padding: 0 18px; }
.cmdk .res { max-height: 60vh; overflow-y: auto; padding: 6px; }
.cmdk .res a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.cmdk .res a.on, .cmdk .res a:hover { background: var(--brand-soft); }
.cmdk .res small { color: var(--muted); margin-left: auto; }
.cmdk .grp { font-size: 11px; text-transform: uppercase; color: var(--faint); padding: 8px 12px 2px; font-weight: 700; letter-spacing: .06em; }

/* ---------- sign-in pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, var(--brand-soft), transparent), var(--bg); }
.auth-card { width: min(420px, 100%); padding: 30px 28px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 800; font-size: 17px; }
.auth-logo .org-logo { background: #0D1A1A; }
.auth h1 { font-size: 21px; margin-bottom: 6px; }
.auth .err { color: var(--bad); font-size: 13px; margin: -4px 0 12px; }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
/* dashboard top: briefing and pipeline | tasks and replies | newest leads; three columns on wide screens */
.dash-top { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-areas: "a b" "a c"; align-items: start; }
.dash-top .da { grid-area: a; } .dash-top .db { grid-area: b; } .dash-top .dc { grid-area: c; }
@media (min-width: 1500px) { .dash-top { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "a b c"; } }
.brief .pt { display: flex; gap: 10px; padding: 7px 0; }
.brief .pt i { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--info); }
.brief .pt.good i { background: var(--good); } .brief .pt.warn i { background: var(--warn); }
.funnel .st { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.funnel .st .bar { height: 10px; }
.mini-list a { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none; }
.mini-list a:last-child { border: 0; }
.mini-list .t { flex: 1; min-width: 0; } .mini-list .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ---------- pipeline board ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: calc(100vh - 210px); }
.col { flex: 0 0 272px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.col-head { padding: 11px 12px 8px; display: flex; align-items: center; gap: 8px; }
.col-head b { font-size: 13.5px; } .col-head small { color: var(--muted); margin-left: auto; font-weight: 600; }
.col-body { padding: 4px 8px 10px; overflow-y: auto; min-height: 60px; flex: 1; }
.col.drop { outline: 2px dashed var(--brand); outline-offset: -2px; }
.col.k-won { border-top: 3px solid var(--good); } .col.k-lost { border-top: 3px solid var(--bad); } .col.k-open { border-top: 3px solid var(--brand); }
.deal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.deal-card:hover { border-color: var(--brand); }
.deal-card.dragging { opacity: .5; }
.deal-card b { display: block; font-size: 13.5px; line-height: 1.3; }
.deal-card .meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.deal-card .meta .v { color: var(--text); font-weight: 700; margin-right: auto; }
.deal-card.rot { border-left: 3px solid var(--warn); }

/* ---------- record pages ---------- */
.rec { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.rec-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.rec-head h1 { line-height: 1.2; }
.rec-head .sub { color: var(--muted); font-size: 13px; }
.rec-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stage-path { display: flex; gap: 3px; margin-bottom: 16px; overflow-x: auto; }
.stage-path button { flex: 1; min-width: 92px; border: 0; padding: 8px 6px; font: 600 12px var(--font); background: var(--panel-2); color: var(--muted); cursor: pointer; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); }
.stage-path button:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.stage-path button.done { background: var(--brand-soft); color: var(--brand); }
.stage-path button.on { background: var(--brand); color: var(--brand-ink); }
.stage-path button.won.on { background: var(--good); } .stage-path button.lost.on { background: var(--bad); }
.timeline { position: relative; }
.tl { display: flex; gap: 12px; padding: 10px 0; }
.tl .ic { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; color: var(--muted); }
.tl .bd { flex: 1; min-width: 0; }
.tl .bd .h { font-size: 12.5px; color: var(--muted); } .tl .bd .h b { color: var(--text); }
.tl .bd .tx { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.composer textarea { min-height: 70px; }
.ai-box { border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: linear-gradient(180deg, var(--brand-soft), transparent); border-radius: var(--r); padding: 14px 16px; }
.ai-box h3 { display: flex; align-items: center; gap: 7px; color: var(--brand); font-size: 13.5px; margin-bottom: 8px; }

/* ---------- inbox ---------- */
.ibx { display: grid; grid-template-columns: 340px 1fr 300px; height: 100%; min-height: 0; }
.ibx-list { min-width: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.ibx-tools { padding: 12px; border-bottom: 1px solid var(--line-2); display: grid; gap: 8px; }
.ibx-items { overflow-y: auto; overflow-x: hidden; flex: 1; }
.cv { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; color: var(--text); text-decoration: none; position: relative; }
.cv:hover { background: var(--panel-2); text-decoration: none; }
.cv.on { background: var(--brand-soft); }
.cv .chn { position: absolute; left: 32px; top: 31px; width: 18px; height: 18px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; color: var(--muted); box-shadow: 0 0 0 2px var(--panel); }
.cv .chn .ico { width: 12px; height: 12px; }
.cv .bd { display: block; flex: 1; min-width: 0; }
.cv .l1 { display: flex; gap: 6px; align-items: baseline; }
.cv .l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cv.unread .l1 b { font-weight: 800; } .cv.unread .pv { color: var(--text); }
.cv .l1 small { margin-left: auto; color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.cv .pv { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv .tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.cv .udot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); position: absolute; right: 10px; bottom: 14px; }
.ibx-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.ibx-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.ibx-bar h2 { font-size: 15px; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.thread { flex: 1; overflow-y: auto; padding: 18px 20px; }
.msg { display: flex; gap: 10px; margin-bottom: 14px; max-width: 760px; }
.msg.out { margin-left: auto; flex-direction: row-reverse; }
.msg .bub { background: var(--panel); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 10px 13px; min-width: 0; box-shadow: var(--shadow); }
.msg.out .bub { background: color-mix(in srgb, var(--brand) 12%, var(--panel)); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); border-radius: 14px 14px 4px 14px; }
.msg.agent .bub { background: color-mix(in srgb, #7C5BD8 10%, var(--panel)); border-color: color-mix(in srgb, #7C5BD8 30%, var(--line)); }
.msg.note .bub { background: var(--warn-soft); border-color: transparent; border-radius: 10px; }
.msg .meta { font-size: 11.5px; color: var(--faint); margin-top: 5px; display: flex; gap: 6px; flex-wrap: wrap; }
.msg .tx { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .quoted { margin-top: 6px; } .msg .quoted summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.msg .att { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg .att a { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.day-sep { text-align: center; font-size: 11.5px; color: var(--faint); margin: 14px 0; font-weight: 600; }
.reply { border-top: 1px solid var(--line); background: var(--panel); padding: 12px 16px; flex: none; max-height: 62%; overflow-y: auto; }
.reply textarea { min-height: 86px; max-height: 260px; }
.reply .tools { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.draft { border: 1px solid color-mix(in srgb, #7C5BD8 35%, var(--line)); background: color-mix(in srgb, #7C5BD8 7%, var(--panel)); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.draft .h { display: flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 700; color: #6A4BC7; }
.draft .tx { white-space: pre-wrap; margin: 6px 0 8px; max-height: 96px; overflow-y: auto; }
.ibx-side { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 16px; min-height: 0; }
.ibx-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 16px 0 8px; }
.ibx-side h3:first-child { margin-top: 0; }
.window-note { font-size: 12.5px; padding: 8px 10px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); margin-bottom: 8px; }

/* ---------- Ask AI ---------- */
.ask { max-width: 860px; margin: 0 auto; }
.ask-box { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line); border-radius: 18px; padding: 8px 8px 8px 16px; background: var(--panel); box-shadow: var(--shadow); }
.ask-box textarea { flex: 1; border: 0; resize: none; background: transparent; color: var(--text); font: 15px var(--font); min-height: 26px; max-height: 200px; padding: 6px 0; outline: none; }
.qa { margin-top: 18px; }
.qa .q { font-weight: 700; margin-bottom: 8px; }
.qa .a { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; line-height: 1.65; }
.qa .a ul { margin: 6px 0; padding-left: 20px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- settings ---------- */
.set-grid { display: grid; grid-template-columns: 210px 1fr; gap: 22px; align-items: start; }
.set-nav { position: sticky; top: 0; display: grid; gap: 2px; }
.set-nav a { padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; text-decoration: none; }
.set-nav a.on { background: var(--brand-soft); color: var(--brand); }
.set-nav a:hover { background: var(--panel-2); text-decoration: none; }
.sortable li { list-style: none; display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--panel); }
.sortable { padding: 0; margin: 0; }
.code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.test-chat { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); height: 360px; display: flex; flex-direction: column; }
.test-chat .thread { padding: 12px; }

/* ---------- console ---------- */
.org-row td:first-child b { display: block; }
.check-list label { display: flex; gap: 8px; align-items: center; padding: 5px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .ibx { grid-template-columns: 320px 1fr; } .ibx-side { display: none; } .ibx.side-open .ibx-side { display: block; position: fixed; right: 0; top: 56px; bottom: 0; width: 320px; z-index: 30; box-shadow: var(--shadow-lg); } }
@media (max-width: 1100px) { .rec { grid-template-columns: 1fr; } .dash { grid-template-columns: 1fr; } .dash-top { grid-template-columns: 1fr; grid-template-areas: "a" "b" "c"; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 60; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.menu-open .side { transform: none; }
  .app.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .top .menu-btn { display: inline-grid; }
  .top { padding: 0 10px; }
  .search-btn kbd { display: none; }
  .page { padding: 16px 14px 70px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .ibx { grid-template-columns: 1fr; }
  .ibx.has-open .ibx-list { display: none; } .ibx:not(.has-open) .ibx-main { display: none; }
  .set-grid { grid-template-columns: 1fr; } .set-nav { position: static; display: flex; overflow-x: auto; }
  .kv { grid-template-columns: 110px 1fr; }
  .col { flex-basis: 250px; }
  .hide-sm { display: none !important; }
}

/* ---------- Settings > Channels: Gmail sending ---------- */
.gm { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel-2); font-size: 13.5px; }
.gm > svg, .gm > .ico { flex: none; }
.gm.ok { border-style: solid; border-color: color-mix(in srgb, var(--good) 35%, var(--line)); background: var(--good-soft); }
.gm.ok > .ico { color: var(--good); }
.gm.bad { border-style: solid; border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: var(--bad-soft); color: var(--bad); }
