:root { --bg: #f5f5f9; --card: #fff; --ink: #15151c; --muted: #6b6b80; --line: #e6e6ee; --accent: #7c6cf2; --accent-ink: #fff;
  --ok: #1f9d55; --warn: #d97706; --bad: #dc2626; --soft: #efecff; --grid: #e1e0d9; --axis: #898781;
  --st-todo: #8a8aa0; --st-seq: #2a78d6; --st-rep: #1baf7a; --st-rdv: #eda100; --st-prop: #7c6cf2; --st-cli: #008300; --st-lost: #e34948; --st-nope: #b4687a; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
code { font-size: 12px; background: #eeeef4; padding: 1px 5px; border-radius: 5px; color: #44445a; }

/* header */
header { background: #0f0f14; color: #fff; padding: 0 14px; display: flex; align-items: center; gap: 14px; height: 56px; position: sticky; top: 0; z-index: 5; }
header .brand { color: #fff; font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 9px; white-space: nowrap; }
header .brand img { height: 30px; width: 30px; border-radius: 8px; }
header nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
header nav::-webkit-scrollbar { display: none; }
header nav a { color: #c9c9d6; padding: 7px 10px; border-radius: 9px; white-space: nowrap; font-size: 14px; display: flex; align-items: center; gap: 6px; position: relative; }
header nav a svg { width: 17px; height: 17px; opacity: .85; }
header nav a.on, header nav a:hover { background: #26263a; color: #fff; text-decoration: none; }
header nav a .badge { background: var(--bad); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; margin-left: 2px; }
header .right { display: flex; gap: 10px; align-items: center; }
header .quit { color: #9a9ab0; }
.btn.dark { background: #26263a; color: #fff; border-color: #3a3a52; }
@media (max-width: 720px) { header { gap: 8px; padding: 0 10px; } header .brand span { display: none; } header nav { gap: 0; } header nav a span { display: none; } header nav a svg { width: 21px; height: 21px; } header nav a { padding: 8px 7px; } header .quit { display: none; } header .right .btn span { display: none; } header .right .btn { padding: 6px 9px; } }

/* layout */
main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 70px; }
.pagehead { margin: 4px 0 16px; } .pagehead h1 { margin: 0; } .pagehead .sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.titlerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h1 { font-size: 24px; margin: 6px 0 14px; } h2 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }
.sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 0 8px; } .sechead h2 { margin: 0; }
section { margin-bottom: 16px; }
.help { color: var(--muted); font-size: 13px; margin: -2px 0 10px; }
.banner { background: #fff4e5; border: 1px solid #fcd9a8; color: #7c3d00; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.bad { background: #fee2e2; border-color: #fca5a5; color: #7f1d1d; }
.flash { background: var(--soft); border: 1px solid #d9d2ff; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }
.flash.big { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 16px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } @media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.grid2 > section { margin-bottom: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; }

/* tiles & meters */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--ink); }
a.tile:hover { border-color: #c9c2ff; text-decoration: none; }
.tile .v { font-size: 28px; font-weight: 700; line-height: 1.1; } .tile .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tile .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tiles.compact { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); margin: 10px 0; }
.tiles.compact .tile { padding: 8px 10px; border-radius: 10px; } .tiles.compact .v { font-size: 21px; } .tiles.compact .l { font-size: 12px; margin-top: 1px; }
.meter { margin: 10px 0 12px; } .meter .mh { display: flex; justify-content: space-between; font-size: 14px; } .meter .mh small { color: var(--muted); font-weight: 400; }
.meter .track { height: 8px; background: #e2ecfa; border-radius: 999px; overflow: hidden; margin-top: 5px; }
.meter .fill { height: 100%; background: #2a78d6; border-radius: 999px; } .meter .fill.high { background: #eda100; } .meter .fill.full { background: #e34948; }
.meter .d { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cards.big { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); } @media (max-width: 500px) { .cards.big { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--ink); }
a.card:hover { border-color: #c9c2ff; text-decoration: none; }
.card .ch { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.card .nums { display: flex; gap: 14px; margin: 10px 0 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; } .card .nums b { color: var(--ink); font-size: 16px; }

/* stage bars */
.stagebar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #ececf4; gap: 2px; }
.stagebar .seg { display: block; min-width: 4px; } .stagebar.mini { height: 8px; }
.stagelegend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.stagelegend a { color: var(--ink); display: inline-flex; align-items: center; gap: 6px; } .stagelegend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.stagelegend b { color: var(--muted); font-weight: 600; }
.st-todo { background: var(--st-todo); } .st-seq { background: var(--st-seq); } .st-rep { background: var(--st-rep); } .st-rdv { background: var(--st-rdv); }
.st-prop { background: var(--st-prop); } .st-cli { background: var(--st-cli); } .st-lost { background: var(--st-lost); } .st-nope { background: var(--st-nope); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #ececf4; color: #3c3c52; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.pill.st-todo { background: #efeff4; color: #52526a; } .pill.st-seq { background: #e4efff; color: #1b5fb3; } .pill.st-rep { background: #dcf7ec; color: #0f7a53; }
.pill.st-rdv { background: #fff1cc; color: #8a5a00; } .pill.st-prop { background: #ebe7ff; color: #4a3aa7; } .pill.st-cli { background: #d9f2d9; color: #0b5a0b; }
.pill.st-lost { background: #fde2e2; color: #a12b2b; } .pill.st-nope { background: #f6e4ea; color: #8c3b52; }
.pill.ct-seq { background: #e4efff; color: #1b5fb3; } .pill.ct-rep { background: #dcf7ec; color: #0f7a53; } .pill.ct-todo { background: #efeff4; color: #52526a; }
.pill.ct-off { background: #f3f3f6; color: #8a8aa0; text-decoration: line-through; text-decoration-color: #c5c5d2; } .pill.ct-done { background: #e8e8ee; color: #44445a; }
.pill.dk-ok { background: #dcf7ec; color: #0f7a53; } .pill.dk-warn { background: #fff1cc; color: #8a5a00; } .pill.dk-off { background: #f3f3f6; color: #8a8aa0; }
.pill.dk-bad { background: #fde2e2; color: #a12b2b; } .pill.dk-todo { background: #efeff4; color: #52526a; }
.pill.live { background: #e4efff; color: #1b5fb3; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; } .chip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); } .chip b { font-size: 13px; }

/* stage select (inline, saves by itself) */
.stage-form { display: inline-flex; align-items: center; gap: 6px; }
.stage-select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 26px 4px 12px; font: inherit; font-size: 13px; cursor: pointer;
  background: #ececf4 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%23555'/></svg>") no-repeat right 10px center; color: #3c3c52; width: auto; }
.stage-select.st-todo { background-color: #efeff4; color: #52526a; } .stage-select.st-seq { background-color: #e4efff; color: #1b5fb3; } .stage-select.st-rep { background-color: #dcf7ec; color: #0f7a53; }
.stage-select.st-rdv { background-color: #fff1cc; color: #8a5a00; } .stage-select.st-prop { background-color: #ebe7ff; color: #4a3aa7; } .stage-select.st-cli { background-color: #d9f2d9; color: #0b5a0b; }
.stage-select.st-lost { background-color: #fde2e2; color: #a12b2b; } .stage-select.st-nope { background-color: #f6e4ea; color: #8c3b52; }
.stage-select:disabled { opacity: .5; }
.stages { display: flex; flex-wrap: wrap; gap: 8px; }
.stagebtn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.stagebtn i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.stagebtn.st-todo i { background: var(--st-todo); } .stagebtn.st-seq i { background: var(--st-seq); } .stagebtn.st-rep i { background: var(--st-rep); } .stagebtn.st-rdv i { background: var(--st-rdv); }
.stagebtn.st-prop i { background: var(--st-prop); } .stagebtn.st-cli i { background: var(--st-cli); } .stagebtn.st-lost i { background: var(--st-lost); } .stagebtn.st-nope i { background: var(--st-nope); }
.stagebtn.on { background: #15151c; color: #fff; border-color: #15151c; } .stagebtn:hover { border-color: #15151c; }
.stagebtn { background-color: #fff; } .stagebtn.st-todo, .stagebtn.st-seq, .stagebtn.st-rep, .stagebtn.st-rdv, .stagebtn.st-prop, .stagebtn.st-cli, .stagebtn.st-lost, .stagebtn.st-nope { background: #fff; }
.stagebtn.on.st-todo, .stagebtn.on.st-seq, .stagebtn.on.st-rep, .stagebtn.on.st-rdv, .stagebtn.on.st-prop, .stagebtn.on.st-cli, .stagebtn.on.st-lost, .stagebtn.on.st-nope { background: #15151c; }

/* tracker */
.tracker { display: inline-flex; align-items: flex-start; gap: 0; }
.tracker .step { display: flex; flex-direction: column; align-items: center; width: 52px; position: relative; }
.tracker .step b { width: 12px; height: 12px; border-radius: 50%; background: #e2e2ea; border: 2px solid #fff; box-shadow: 0 0 0 1px #d4d4de; display: block; z-index: 1; }
.tracker .step.on b { background: var(--st-seq); box-shadow: 0 0 0 1px var(--st-seq); }
.tracker .step:last-child.on b { background: var(--st-rep); box-shadow: 0 0 0 1px var(--st-rep); }
.tracker .step::before { content: ""; position: absolute; top: 6px; left: 50%; width: 100%; height: 2px; background: #e2e2ea; }
.tracker .step:last-child::before { display: none; }
.tracker .step.on + .step.on::after, .tracker .step.on::after { content: ""; position: absolute; top: 6px; right: 50%; width: 0; height: 2px; }
.tracker .step em { font-style: normal; font-size: 10px; color: var(--muted); margin-top: 3px; white-space: nowrap; letter-spacing: -.2px; }
.tracker .step.on em { color: var(--ink); }
.tracker .step small { font-size: 10px; color: var(--muted); }
.ctline { display: flex; align-items: center; gap: 10px; padding: 4px 0; flex-wrap: wrap; } .ctline .who { min-width: 140px; font-size: 13px; }
td.cts { min-width: 320px; }

/* contact cards */
.ctcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; margin-bottom: 12px; } @media (max-width: 500px) { .ctcards { grid-template-columns: 1fr; } }
.ctcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cthead { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.ctfoot { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.ct-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; } th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.tbl { overflow-x: auto; } tr:hover td { background: #fafafe; }

/* forms */
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); } .btn.small { padding: 5px 11px; font-size: 13px; } .btn.tiny { padding: 3px 9px; font-size: 12px; border-radius: 8px; }
.btn.warn { background: var(--warn); } .btn.ok { background: var(--ok); color: #fff; } .btn:disabled { opacity: .5; }
input[type=text], input[type=password], input[type=url], select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfcfdd; border-radius: 10px; background: #fff; width: 100%; }
textarea { min-height: 90px; }
form.inline { display: inline; } form.row, .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
form.row input[type=text], form.row select, .row input[type=text] { width: auto; min-width: 150px; flex: 1 1 160px; max-width: 360px; }
form.filters { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.timeline .when { color: var(--muted); font-size: 12px; min-width: 82px; font-variant-numeric: tabular-nums; } .timeline .what { font-weight: 600; }
.timeline li .pre, .timeline li .quote { flex-basis: 100%; }
.quote { background: #f7f7fb; border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; white-space: pre-wrap; margin: 6px 0; }
.quote.ours { border-left-color: var(--ok); }
.login { max-width: 360px; margin: 80px auto; } .loginpage { background: #0f0f14; } .loginpage .login { background: #fff; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
img.og { width: 100%; max-width: 480px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.legendgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; } .legendgrid > div { display: flex; align-items: center; gap: 8px; }

/* charts */
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hrow { display: grid; grid-template-columns: minmax(96px, 150px) 1fr 48px; align-items: center; gap: 10px; font-size: 13px; }
.hrow .hl { text-align: right; color: #52514e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .ht { display: block; height: 16px; background: #f1f1f5; border-radius: 4px; overflow: hidden; }
.hrow .hf { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 0; }
.hrow .hv { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 500px) { .hrow { grid-template-columns: 96px 1fr 40px; font-size: 12px; } }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; font: 12px system-ui, sans-serif; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.chart .legend span { display: inline-flex; align-items: center; gap: 6px; } .chart .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart .tip { position: absolute; pointer-events: none; background: #15151c; color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; z-index: 3; min-width: 120px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.chart .tip b { font-size: 13px; } .chart .tip .r { display: flex; justify-content: space-between; gap: 12px; } .chart .tip .k { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart .tog { font-size: 12px; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 2px 0; margin-top: 4px; }
.chart table { font-size: 12px; margin-top: 6px; } .chart table td, .chart table th { padding: 4px 6px; }
.chart .empty { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }
.charts > div { min-width: 0; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #15151c; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; }
.toast.bad { background: var(--bad); }
