:root {
  --ink: #0f1720; --ink2: #3d4a58; --mute: #6b7785; --line: #e3e8ee; --bg: #f5f7fa; --card: #fff;
  --cyan: #0cb2fe; --cyan-d: #0682b8; --cyan-bg: #eaf7ff; --side: #0f1720;
  --ok: #12805c; --ok-bg: #e6f6ef; --warn: #9a6400; --warn-bg: #fff4d6; --bad: #b3261e; --bad-bg: #fdecea;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 "Segoe UI", Arial, Helvetica, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--cyan-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 650; }
h3 { font-size: 12px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); font-weight: 600; }
p { margin: 0 0 10px; }
.mute { color: var(--mute); } .small { font-size: 12.5px; } .right { text-align: right; } .nowrap { white-space: nowrap; }

.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #c9d3dd; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { background: #fff; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.brand img { display: block; width: 100%; max-width: 150px; height: auto; margin: 0 auto; }
.brand-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #8fa0b1; padding: 4px 8px 14px; }
.side a { display: flex; justify-content: space-between; align-items: center; color: #c9d3dd; padding: 8px 10px; border-radius: 7px; margin-bottom: 2px; }
.side a:hover { background: #1b2733; text-decoration: none; color: #fff; }
.side a.on { background: var(--cyan); color: #04202e; font-weight: 600; }
.side .sep { height: 1px; background: #243240; margin: 10px 4px; }
.count { background: #243240; color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.side a.on .count { background: #04202e; }
.main { padding: 22px 28px 60px; min-width: 0; }
.modebar { font-size: 12.5px; padding: 7px 12px; border-radius: 7px; margin-bottom: 14px; }
.modebar.practice { background: var(--warn-bg); color: var(--warn); }
.modebar.manual { background: var(--cyan-bg); color: #05587d; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.head .sub { color: var(--mute); margin-top: 3px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.err { background: var(--bad-bg); color: var(--bad); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.card.tight { padding: 0; overflow: hidden; }
.card.note { background: var(--cyan-bg); border-color: #bfe6fb; }
.card.caution { background: var(--warn-bg); border-color: #f0d68a; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .g-main, .g2, .g4 { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } .main { padding: 16px; } }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.kpi .n { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.kpi .l { color: var(--mute); font-size: 12.5px; margin-top: 4px; }
.kpi .n small { font-size: 14px; color: var(--mute); font-weight: 500; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfe; }
.tablewrap { overflow-x: auto; }

.btn { display: inline-block; font: inherit; font-weight: 600; padding: 7px 13px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c5ced8; text-decoration: none; }
.btn.primary { background: var(--cyan); border-color: var(--cyan); color: #04202e; }
.btn.primary:hover { background: #2bbcff; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--cyan-d); padding-left: 4px; padding-right: 4px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
.starbtn { border: 0; background: none; cursor: pointer; font-size: 17px; line-height: 1; color: #c3ccd6; padding: 0 2px; }
.starbtn.on { color: #f0a800; }

input[type=text], input[type=email], input[type=date], input[type=search], input[type=number], select, textarea {
  font: inherit; color: var(--ink); border: 1px solid #cfd7e0; border-radius: 7px; padding: 7px 10px; background: #fff; width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9adcff; outline-offset: 0; border-color: var(--cyan); }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--mute); margin-top: 4px; font-weight: 400; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto; } .filters input[type=search] { min-width: 230px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 140px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: #eef1f5; color: var(--ink2); white-space: nowrap; }
.pill.cyan { background: var(--cyan-bg); color: #05587d; } .pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.dark { background: var(--ink); color: #fff; }
.grade { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 6px; font-weight: 700; font-size: 12px; }
.grade.A { background: var(--ok-bg); color: var(--ok); } .grade.B { background: var(--cyan-bg); color: #05587d; } .grade.C { background: #eef1f5; color: var(--mute); }
.scorebar { display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: start; margin-bottom: 8px; font-size: 13px; }
.scorebar b { font-variant-numeric: tabular-nums; }
.tl li.click::before { background: #f0a800; }

.funnel { display: grid; gap: 6px; }
.funnel .step { display: grid; grid-template-columns: 170px 1fr 46px; gap: 10px; align-items: center; font-size: 13px; }
.funnel .bar { height: 10px; background: #eef1f5; border-radius: 6px; overflow: hidden; }
.funnel .bar i { display: block; height: 100%; background: var(--cyan); border-radius: 6px; min-width: 2px; }

.tl { list-style: none; margin: 0; padding: 0; }
.tl li { padding: 9px 0 9px 16px; border-left: 2px solid var(--line); position: relative; margin-left: 5px; }
.tl li::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: #cfd7e0; }
.tl li.email::before { background: var(--cyan); } .tl li.outcome::before { background: var(--ok); } .tl li.stage::before { background: #7b61ff; }
.tl .when { font-size: 12px; color: var(--mute); }
.tl .detail { color: var(--ink2); margin-top: 3px; white-space: pre-wrap; }

.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #b9c3ce; background: #fff; cursor: pointer; flex: none; margin-top: 1px; }
.task .tick:hover { border-color: var(--ok); background: var(--ok-bg); }
.task .tick.done { background: var(--ok); border-color: var(--ok); }
.task .body { flex: 1; min-width: 0; }
.due.over { color: var(--bad); font-weight: 600; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: 232px; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: #eef1f5; border-radius: 10px; padding: 10px; }
.col h3 { display: flex; justify-content: space-between; margin-bottom: 8px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; }
.tile .name { font-weight: 600; display: block; margin-bottom: 2px; }
.tile select { font-size: 12px; padding: 3px 6px; margin-top: 6px; }

.compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1200px) { .compose { grid-template-columns: 1fr; } }
.picklist { max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; background: #fafbfc; }
.picklist label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; margin: 3px 0; font-size: 13px; color: var(--ink); }
.picklist input { margin-top: 3px; }
.picklist .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin: 8px 0 2px; font-weight: 600; }
.preview { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preview .meta { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; background: #fafbfc; border-radius: 8px 8px 0 0; }
.preview .meta b { display: inline-block; width: 58px; color: var(--mute); font-weight: 600; }
.preview .bodyhtml { padding: 16px 16px 6px; overflow-wrap: anywhere; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { padding: 8px 10px; border-radius: 7px; margin-bottom: 6px; font-size: 13px; }
.checks .BLOCK { background: var(--bad-bg); color: #7c1a14; } .checks .WARN { background: var(--warn-bg); color: #6b4600; }
.checks .NOTE { background: #eef1f5; color: var(--ink2); } .checks .OK { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.checks b { margin-right: 6px; } .checks code { background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.sticky { position: sticky; top: 14px; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--mute); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--cyan); } .tabs a:hover { text-decoration: none; color: var(--ink); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 14px; }
.empty { padding: 26px; text-align: center; color: var(--mute); }
dl.facts { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; }
dl.facts dt { color: var(--mute); } dl.facts dd { margin: 0; }
details summary { cursor: pointer; font-weight: 600; }
pre.plain { white-space: pre-wrap; font: 13px/1.5 Consolas, monospace; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 10px 0 0; }
