:root {
  --bg: #0b0b0f;
  --panel: #13131b;
  --card: #1a1a24;
  --line: #2a2a38;
  --text: #ecebf3;
  --muted: #9a99ab;
  --accent: #6c5ce7;
  --accent-2: #a855f7;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #818cf8;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 Poppins, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: #b9b0ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #22222e; padding: 1px 5px; border-radius: 5px; font-size: 12px; }
pre { white-space: pre-wrap; word-break: break-word; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 6px 0; }
h1 { font-size: 20px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 14px; margin: 18px 0 8px; font-weight: 600; color: #d6d4e6; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.pre { white-space: pre-wrap; }
.clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; padding: 4px 8px; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 600; color: #c9b8ff; }
.brand__mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.brand--lg { font-size: 18px; margin-bottom: 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #c9c8d6; }
.side nav a:hover { background: #1c1c27; text-decoration: none; }
.side nav a.on { background: #231f3d; color: #fff; }
.side nav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.side__out { margin-top: auto; padding: 0 10px; }
.main { padding: 20px 28px 48px; min-width: 0; }
.top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 4px 10px; font-size: 16px; }

/* cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.table-card { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; }
.grid > .card { margin-bottom: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.wide-left { grid-template-columns: 3fr 2fr; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid + .card, .grid + section, .stats { margin-bottom: 16px; }
.stats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stat { display: block; color: inherit; }
a.stat:hover { text-decoration: none; border-color: #3d3760; }
.stat__label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-size: 26px; font-weight: 600; margin: 4px 0 2px; }
.stat__value small { font-size: 14px; color: var(--muted); font-weight: 400; }
.stat__sub { font-size: 12px; color: var(--muted); }
.callout { border-color: #3d3570; background: linear-gradient(180deg, #1d1a33, var(--card)); }
.warnbox { border-color: #6b4b16; }
.okbox { border-color: #1f5b44; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.narrow { max-width: 640px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 500; color: var(--muted); background: #16161f; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #1e1e2a; }
table.compact td, table.compact th { padding: 6px 8px; background: none; }
.num { text-align: right; white-space: nowrap; }
td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
tr.unread td { font-weight: 500; }
.bulk { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* forms */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #cfcdde; }
label.check, label.inline { flex-direction: row; align-items: center; gap: 8px; }
.form > label, .form > .grid, .form > .row, .form > fieldset, .form > div { margin-bottom: 12px; }
input, select, textarea {
  font: inherit; color: var(--text); background: #111119; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input[type=checkbox] { width: auto; accent-color: var(--accent); }
label.inline input { width: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #4d42b3; border-color: transparent; }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; }
.filters.card { padding: 12px 18px; }
fieldset.step { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
fieldset.step > .btn { align-self: flex-start; }
fieldset.step legend { padding: 0 6px; color: #c9b8ff; font-weight: 500; }
.weekdays { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; color: var(--text); background: #262636; border: 1px solid #343448; border-radius: 8px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #2f2f43; text-decoration: none; }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.btn--primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn--ghost { background: transparent; }
.btn--danger { background: #3a1a1f; border-color: #5c2530; color: #ffb4b4; }
.btn--sm { padding: 4px 10px; font-size: 12px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.link:hover { color: var(--text); }

/* pills & flash */
.pill { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; border: 1px solid; margin: 1px 2px 1px 0; white-space: nowrap; }
.pill--good { color: var(--good); border-color: #1f5b44; background: #0f2a20; }
.pill--warn { color: var(--warn); border-color: #6b4b16; background: #2a1f0b; }
.pill--bad { color: var(--bad); border-color: #6b2830; background: #2a1215; }
.pill--info { color: var(--info); border-color: #3a3f7a; background: #161a33; }
.pill--muted { color: var(--muted); border-color: #34344a; background: #1b1b26; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.flash--ok { border-color: #1f5b44; background: #0f2a20; color: #b7f3d9; }
.flash--warn { border-color: #6b4b16; background: #2a1f0b; color: #fde6a8; }
.flash--bad { border-color: #6b2830; background: #2a1215; color: #ffd0d0; }

/* misc */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kvlist { padding-left: 18px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 12px 0; color: var(--muted); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 8px; color: #c9c8d6; border: 1px solid transparent; }
.tabs a.on { background: #231f3d; border-color: #3d3570; color: #fff; }
.tabs small { color: var(--muted); margin-left: 4px; }
.progress { height: 6px; background: #24243a; border-radius: 6px; overflow: hidden; margin: 6px 0 2px; min-width: 90px; }
.progress i { display: block; height: 100%; width: calc(var(--p) * 1%); background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 8px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bars__col span { font-size: 10px; color: var(--muted); }
.bars__bar { width: 100%; max-width: 26px; height: calc(var(--h) * 1%); min-height: 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 4px 4px 2px 2px; position: relative; overflow: hidden; }
.bars__bar i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--h) * 1%); background: var(--bad); }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; }
.timeline li.out { border-color: var(--accent); }
.timeline li.in { border-color: var(--good); }
.mailtext { background: #111119; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-family: Poppins, system-ui, sans-serif; font-size: 14px; }
.mailframe { width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.checks { display: grid; gap: 10px; }
.check-row { border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 10px 14px; display: grid; gap: 4px; }
.check-row--ok { border-left-color: var(--good); }
.check-row--warn { border-left-color: var(--warn); }
.check-row--fail { border-left-color: var(--bad); }
.check-row--unknown { border-left-color: var(--muted); }
.check-row__val { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #cfcdde; overflow-wrap: anywhere; }
.fix { color: #d9d3ff; }
details summary { cursor: pointer; color: var(--muted); margin: 6px 0; }

/* login & public */
.bare { min-height: 100vh; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(800px 400px at 50% -10%, #2a1f5e55, transparent); }
.login__card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.public h1 { font-size: 20px; }

@media (max-width: 1100px) {
  .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 10; left: 0; top: 0; width: 240px; transform: translateX(-100%); transition: transform .15s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax #0009; }
  .menu-btn { display: inline-block; }
  .main { padding: 14px 16px 40px; }
  .grid.two, .grid.three, .grid.four, .grid.wide-left { grid-template-columns: 1fr; }
  .clip { max-width: 200px; }
}

/* report kampane */
.tabs--line { border-bottom: 1px solid var(--line); margin: 4px 0 16px; gap: 2px; }
.tabs--line a { border-radius: 8px 8px 0 0; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; }
.tabs--line a.on { background: transparent; border-bottom-color: var(--accent-2); color: #fff; }
.funnel { width: 100%; height: auto; display: block; margin: 4px 0 8px; }
.fn-val { font-size: 34px; font-weight: 600; fill: var(--text); }
.fn-val--in { fill: #fff; }
.fn-sub { font-size: 17px; fill: #ffffffcc; }
.fn-label { font-size: 17px; fill: #cfcdde; }
.fn-rate { font-size: 17px; fill: var(--text); font-weight: 600; }
.fn-rate__l { font-weight: 400; fill: var(--muted); font-size: 14px; text-transform: uppercase; }
.fn-axis { stroke: var(--line); }
.srows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 8px 0 12px; }
.srow { display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.srow__ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.srow__ic--info { color: var(--info); } .srow__ic--accent { color: var(--accent-2); } .srow__ic--good { color: var(--good); }
.srow__ic--warn { color: var(--warn); } .srow__ic--bad { color: var(--bad); } .srow__ic--muted { color: var(--muted); }
.srow__p { color: var(--muted); min-width: 70px; text-align: right; }
.srow__v { font-weight: 600; min-width: 40px; text-align: right; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg a { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; color: #c9c8d6; font-size: 13px; }
.seg a.on { background: #fff; color: #111; border-color: #fff; }
.seg a:hover { text-decoration: none; border-color: #4d4d66; }
.timechart { width: 100%; height: auto; display: block; }
.tc-grid { stroke: #2a2a38; }
.tc-axis { font-size: 12px; fill: var(--muted); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend__item i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: grid; grid-template-columns: 1fr 170px; gap: 20px; align-items: center; }
.donut { width: 100%; max-width: 170px; }
.donut__n { font-size: 30px; font-weight: 600; fill: var(--text); }
.donut__l { font-size: 13px; fill: var(--muted); }
.plist { list-style: none; padding: 0; margin: 0; }
.plist li { display: grid; grid-template-columns: 12px 1fr auto 36px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.plist i { width: 10px; height: 10px; border-radius: 50%; }
.plist b { text-align: right; }
@media (max-width: 820px) {
  .srows { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; }
}
.ramp { display: flex; gap: 6px; align-items: flex-end; height: 120px; margin: 6px 0 8px; }
.ramp__d { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; min-width: 0; font-size: 11px; color: var(--muted); }
.ramp__d b { color: var(--text); font-weight: 600; font-size: 12px; }
.ramp__d i { display: block; width: 100%; max-width: 28px; height: calc(var(--h) * .8%); min-height: 3px; border-radius: 4px 4px 2px 2px; background: #3a3360; }
.ramp__d.now i { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }

/* štatistika kampane – karty fáz */
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 6px 0 16px; }
.stage { position: relative; background: #15151e; border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 12px; border-top: 3px solid var(--c); }
.stage + .stage::before { content: '›'; position: absolute; left: -10px; top: 50%; transform: translate(-50%, -50%); color: #55556b; font-size: 20px; }
.stage--blue { --c: #60a5fa; } .stage--indigo { --c: #818cf8; } .stage--violet { --c: #a78bfa; } .stage--purple { --c: #c084fc; } .stage--green { --c: #34d399; }
.stage__label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stage__n { font-size: 32px; font-weight: 600; line-height: 1.1; margin: 6px 0 8px; }
.stage__bar { height: 5px; background: #24243a; border-radius: 4px; overflow: hidden; }
.stage__bar i { display: block; height: 100%; width: calc(var(--p) * 1%); background: var(--c); }
.stage__p { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stage__p b { color: var(--text); font-size: 14px; }
.stage__hint { font-size: 11px; color: #7d7c90; margin-top: 4px; }
.kvgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.kvgrid > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.kvgrid > div:nth-child(4n) { border-right: 0; }
.kvgrid > div:nth-last-child(-n+4) { border-bottom: 0; }
.kvgrid span { color: var(--muted); font-size: 13px; }
.kvgrid b { font-weight: 600; white-space: nowrap; }
.kvgrid small { color: var(--muted); font-weight: 400; font-size: 11px; }
@media (max-width: 1100px) { .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stage:nth-child(4)::before { display: none; } .kvgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kvgrid > div:nth-child(2n) { border-right: 0; } .kvgrid > div:nth-child(4n) { border-right: 0; } .kvgrid > div:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); } .kvgrid > div:nth-last-child(-n+2) { border-bottom: 0; } }
@media (max-width: 600px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stage::before { display: none; } .kvgrid { grid-template-columns: 1fr; } .kvgrid > div { border-right: 0; border-bottom: 1px solid var(--line) !important; } }
