:root { --bg:#f6f7f9; --panel:#fff; --ink:#1a1d23; --muted:#6b7280; --line:#e5e7eb; --accent:#0f766e; --accent-soft:#dcefec;
        --accent-ink:#fff; --warn:#b45309; --hot:#dc2626; --ok:#166534; }
* { box-sizing:border-box; }
html, body { height:100%; }
body { margin:0; font:14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; color:var(--ink); background:var(--bg); }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
.muted { color:var(--muted); }
.small { font-size:12px; }
.grow { flex:1; }
[hidden] { display:none !important; }

/* login */
#login { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:16px; }
#login .card { width:380px; background:var(--panel); padding:28px; border-radius:12px; border:1px solid var(--line); text-align:center; }
#login h2 { margin:0 0 6px; }
#login .btn { display:block; margin:14px 0 0; }

/* header */
header { display:flex; gap:14px; align-items:center; padding:8px 16px; background:var(--panel); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; flex-wrap:wrap; }
header h1 { font-size:16px; margin:0 8px 0 0; }
header .stat { color:var(--muted); font-size:12px; }
header .stat b { color:var(--ink); }
.tabs { display:flex; gap:2px; }
.tabs a { padding:6px 10px; border-bottom:2px solid transparent; font-weight:600; color:var(--muted); }
.tabs a:hover { text-decoration:none; color:var(--ink); }
.tabs a.on { color:var(--accent); border-color:var(--accent); }

main { display:grid; grid-template-columns:minmax(0,1fr) 460px; height:calc(100vh - 46px); }
#page { overflow:auto; }
#detail { border-left:1px solid var(--line); background:var(--panel); overflow:auto; padding:14px 16px; }
#detail.empty-state { color:var(--muted); display:flex; align-items:center; justify-content:center; }

/* buttons + inputs */
.btn { display:inline-block; border-radius:6px; padding:7px 12px; font:inherit; font-weight:600; cursor:pointer; border:1px solid var(--line); background:#fff; color:var(--ink); line-height:1.2; }
.btn:hover { text-decoration:none; background:#f3f4f6; }
.btn.primary { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.btn.primary:hover { background:#0b5f58; }
.btn.small { padding:4px 9px; font-size:12px; }
.btn.danger { color:var(--hot); }
.btn:disabled { opacity:.5; cursor:default; }
select, input, textarea { padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:#fff; font:inherit; color:var(--ink); }
textarea { width:100%; resize:vertical; }
label.chk { font-size:12px; color:var(--muted); display:inline-flex; gap:4px; align-items:center; }

/* toolbar + tables */
.bar { display:flex; gap:8px; flex-wrap:wrap; padding:10px 16px; align-items:center; border-bottom:1px solid var(--line); background:var(--panel); }
.bar h2 { font-size:15px; margin:0 8px 0 0; }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:7px 10px; border-bottom:1px solid var(--line); white-space:nowrap; vertical-align:top; }
th { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); position:sticky; top:0; background:var(--bg); z-index:1; }
tr.row { cursor:pointer; }
tr.row:hover { background:#eef6f5; }
tr.row.sel { background:var(--accent-soft); }
td.chk { width:28px; }
.score { font-weight:700; }
.pill { display:inline-block; padding:1px 7px; border-radius:999px; font-size:11px; background:#eef0f3; color:#374151; white-space:nowrap; }
.pill.shopify { background:#dcfce7; color:var(--ok); }
.pill.mobile { background:#fef3c7; color:#92400e; }
.pill.status { background:#e0e7ff; color:#3730a3; }
.pill.admin { background:#fde68a; color:#78350f; }
a.li { display:inline-block; min-width:20px; padding:0 5px; border-radius:4px; background:#0a66c2; color:#fff; font-weight:700; font-size:11px; text-align:center; line-height:18px; }
a.li:hover { text-decoration:none; background:#004182; }
a.li.find { background:#e5e7eb; color:#6b7280; }
.pill.due { background:#fee2e2; color:#991b1b; }
.pill.soon { background:#fef3c7; color:#92400e; }
.empty { padding:30px; color:var(--muted); text-align:center; }
h3.sec { font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin:16px 16px 6px; }
#detail h3.sec { margin:18px 0 6px; }
.section-note { padding:0 16px 8px; color:var(--muted); font-size:13px; }

/* today */
.today-head { display:flex; gap:18px; padding:14px 16px; align-items:center; flex-wrap:wrap; }
.today-head .num { font-size:26px; font-weight:700; line-height:1; }
.today-head .lbl { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }

/* pipeline */
.kanban { display:flex; gap:10px; padding:12px 16px; overflow-x:auto; min-height:calc(100vh - 110px); align-items:flex-start; }
.col { flex:0 0 230px; background:#eceef2; border-radius:10px; padding:8px; }
.col h4 { margin:2px 4px 8px; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); display:flex; justify-content:space-between; }
.cardp { background:#fff; border:1px solid var(--line); border-radius:8px; padding:8px 10px; margin-bottom:8px; cursor:pointer; font-size:13px; }
.cardp:hover { border-color:var(--accent); }
.cardp.sel { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
.cardp .nm { font-weight:600; }
.cardp .sub { color:var(--muted); font-size:12px; margin-top:2px; display:flex; justify-content:space-between; gap:6px; }

/* detail */
#detail h2 { font-size:18px; margin:0 0 2px; }
.kv { display:grid; grid-template-columns:110px 1fr; gap:3px 10px; font-size:13px; }
.kv div:nth-child(odd) { color:var(--muted); }
.kv input, .kv select { width:100%; padding:4px 6px; font-size:13px; }
.blocked { background:#fee2e2; color:#991b1b; padding:8px; border-radius:6px; margin:8px 0; font-weight:600; }
.outcomes { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:6px 0; }
.outcomes .btn { text-align:left; font-weight:500; }
.outcomes .btn.good { border-color:#86efac; }
.outcomes .btn.bad { border-color:#fecaca; }
.callform { display:grid; gap:6px; margin-bottom:6px; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.contact { padding:8px 0; border-bottom:1px dashed var(--line); }
.contact .nm { font-weight:600; }
.contact .ph a { font-family:ui-monospace,Consolas,monospace; }
.contact .dm { color:var(--ok); font-size:11px; font-weight:700; }
.mv { color:var(--warn); font-weight:600; }
.act { padding:6px 0; border-bottom:1px solid var(--line); font-size:13px; }
.act .when { color:var(--muted); font-size:12px; }
.inline-form { display:grid; gap:6px; background:#f9fafb; padding:8px; border-radius:8px; margin:6px 0; }
.inline-form input, .inline-form select { width:100%; }

/* feed/stats */
.stats { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:10px; padding:12px 16px; }
.statbox { background:#fff; border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.statbox .nm { font-weight:700; }
.statbox .nums { display:flex; gap:14px; margin-top:6px; }
.statbox .nums div { text-align:center; }
.statbox .nums b { display:block; font-size:20px; }
.statbox .nums span { font-size:11px; color:var(--muted); text-transform:uppercase; }
.feed .act { padding:7px 16px; }

/* users */
.users-form { display:flex; gap:6px; padding:10px 16px; flex-wrap:wrap; }

#toast { position:fixed; bottom:18px; left:50%; transform:translateX(-50%); background:var(--ink); color:#fff; padding:8px 14px; border-radius:8px; font-size:13px; z-index:20; }

@media (max-width: 960px) {
  main { grid-template-columns:1fr; height:auto; }
  #detail { border-left:0; border-top:1px solid var(--line); }
  #detail.empty-state { display:none; }
  th, td { white-space:normal; }
}
