:root {
  --bg: #f5f4ef; --panel: #fff; --ink: #1b2420; --muted: #66716c; --line: #e2dfd6;
  --side: #16201c; --side-ink: #c9d3ce; --accent: #1d6f5a; --accent-soft: #e3f1ec;
  --good: #17794f; --bad: #b23a2a; --warn: #a86a08; --bad-soft: #fbe9e5; --warn-soft: #fdf2d8;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .87rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { color: #fff; font-weight: 700; font-size: 1.05rem; padding: 4px 8px 14px; display: flex; align-items: center; gap: 8px; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: #4fd1a5; display: inline-block; }
.side a { color: var(--side-ink); padding: 7px 10px; border-radius: 7px; display: block; }
.side a:hover { background: #22302a; text-decoration: none; color: #fff; }
.side a.on { background: #26463b; color: #fff; }
.side .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #7d8a84; padding: 14px 10px 4px; }
.side select { width: 100%; background: #22302a; color: #fff; border: 1px solid #33443d; border-radius: 7px; padding: 8px; font: inherit; }
.side .foot { margin-top: auto; padding-top: 14px; font-size: .87rem; }
.side .foot button { background: none; border: 0; color: var(--side-ink); cursor: pointer; padding: 7px 10px; font: inherit; }
.main { padding: 26px 32px 60px; min-width: 0; max-width: 1280px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin-top: 3px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 18px; } .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: 2fr 1fr; }
.grid > .card { margin-bottom: 0; } .grid { margin-bottom: 18px; }
.kpi .v { font-size: 1.75rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k { color: var(--muted); font-size: .85rem; }
.delta { font-size: .85rem; font-weight: 600; } .delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #efede6; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.clip, .clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll { overflow-x: auto; }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px;
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.danger { background: #fff; color: var(--bad); border-color: #e7c5be; }
.btn.sm { padding: 4px 10px; font-size: .86rem; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: default; }
form.inline { display: inline; }
label { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=datetime-local],
select, textarea { width: 100%; padding: 9px 11px; border: 1px solid #cfcbbf; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 150px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd0c1; border-color: var(--accent); }
.field { margin-bottom: 14px; } .row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .row > * { flex: 1; min-width: 160px; } .row > .fit { flex: 0 0 auto; min-width: 0; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; margin-bottom: 8px; cursor: pointer; }
.check input { margin-top: 3px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #eceae3; color: #4b5651; white-space: nowrap; }
.pill.high, .pill.failed, .pill.error { background: var(--bad-soft); color: var(--bad); }
.pill.medium, .pill.partial, .pill.running, .pill.publishing { background: var(--warn-soft); color: var(--warn); }
.pill.ok, .pill.published, .pill.done { background: var(--accent-soft); color: var(--good); }
.pill.scheduled { background: #e5ecfa; color: #2a4c94; }
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 12px; background: var(--accent-soft); color: #14513f; border: 1px solid #c5e2d8; }
.flash.error { background: var(--bad-soft); color: #7e2a1e; border-color: #efc9c1; }
.flash.warn { background: var(--warn-soft); color: #6f4705; border-color: #efdca6; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); }
.tabs { display: flex; gap: 4px; background: #e9e6dd; padding: 3px; border-radius: 9px; }
.tabs a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .88rem; }
.tabs a.on { background: #fff; color: var(--ink); } .tabs a:hover { text-decoration: none; }

.score { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e9e6dd 0); position: relative; flex: 0 0 auto; }
.score::before { content: ""; position: absolute; inset: 8px; background: #fff; border-radius: 50%; }
.score span { position: relative; }
.flex { display: flex; gap: 16px; align-items: center; }
.biz { display: block; color: inherit; } .biz:hover { text-decoration: none; border-color: #b9cdc4; }
.biz h2 { margin-bottom: 2px; font-size: 1.15rem; }
.stat-row { display: flex; gap: 22px; margin-top: 14px; flex-wrap: wrap; } .stat-row b { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.stat-row span { color: var(--muted); font-size: .8rem; }
details.issue { border-bottom: 1px solid #efede6; padding: 11px 0; } details.issue:last-child { border-bottom: 0; }
details.issue summary { cursor: pointer; display: flex; gap: 10px; align-items: center; list-style: none; }
details.issue summary::-webkit-details-marker { display: none; }
details.issue summary b { flex: 1; font-weight: 600; }
details.issue .fix { background: var(--accent-soft); border-radius: 8px; padding: 9px 12px; margin: 10px 0; font-size: .92rem; }
details.issue ul { margin: 0; padding-left: 18px; font-size: .9rem; } details.issue li { margin-bottom: 4px; word-break: break-all; }
.opp { border-bottom: 1px solid #efede6; padding: 13px 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; } .opp:last-child { border-bottom: 0; }
.opp .q { font-weight: 650; } .opp .gain { text-align: right; font-weight: 650; color: var(--good); white-space: nowrap; }
.opp .d { grid-column: 1 / -1; color: #48524d; font-size: .92rem; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 4px; }
.cal .day { background: #faf9f5; border: 1px solid #ebe8df; border-radius: 8px; min-height: 76px; padding: 5px 6px; font-size: .8rem; }
.cal .day.today { border-color: var(--accent); background: #fff; } .cal .day.past { opacity: .6; }
.cal .day .n { color: var(--muted); font-weight: 600; }
.cal .ev { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 5px; background: #e5ecfa; color: #24427f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.published { background: var(--accent-soft); color: var(--good); } .cal .ev.failed, .cal .ev.partial { background: var(--bad-soft); color: var(--bad); }
.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.auth { max-width: 400px; margin: 9vh auto; padding: 0 16px; } .auth .brand { color: var(--ink); padding-left: 0; }
.spark { vertical-align: middle; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding: 9px 0 9px 38px; position: relative; border-bottom: 1px solid #efede6; } .steps li:last-child { border: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 25px; height: 25px; border-radius: 50%; background: #e9e6dd; display: grid; place-items: center; font-weight: 700; font-size: .82rem; }
.steps li.done::before { content: "✓"; background: var(--accent); color: #fff; }
pre.out { background: #f3f1ea; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font-size: .87rem; margin: 10px 0 0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .label, .side .foot { display: none; } .main { padding: 18px 14px 40px; }
  .g2, .g3, .g4, .g-main { grid-template-columns: 1fr; }
}
