/* Design tokens převzaté 1:1 z akcelerator-ambici.vercel.app (stejně jako faktury) */
:root {
  --canvas: #07090f;
  --sunken: #0a0d16;
  --panel: #0f1320;
  --panel-hi: #141a2b;
  --ink: #f4f6fb;
  --ink-2: #a6adc3;
  --ink-3: #6b7390;
  --accent: #2f5bff;
  --accent-hi: #5b7fff;
  --accent-soft: #2f5bff24;
  --accent-line: #2f5bff73;
  --line: #ffffff14;
  --line-strong: #ffffff29;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #ff8a8a;
  --bad-line: #ff5b5b55;

  --cta: #2f5bff;
  --cta-hi: #5b7fff;
  --cta-ring: #5b7fff73;
  --cta-rgb: 47, 91, 255;

  --font-sans: Montserrat, ui-sans-serif, system-ui, sans-serif;
  --font-display: "Special Gothic Expanded One", Montserrat, sans-serif;
  --shadow-card: 0 1px 0 #ffffff0f inset, 0 20px 50px -20px #000c;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

/* ---------- Pozadí ---------- */

.stage { position: absolute; inset: 0 0 auto; height: 720px; pointer-events: none; z-index: 0; }
.stage-light {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 45% at 50% -8%, #2f5bff6b, #0000 70%),
    radial-gradient(35% 30% at 8% 10%, #2f5bff29, #0000 70%),
    radial-gradient(35% 30% at 92% 12%, #2f5bff24, #0000 70%);
}
.stage-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(#ffffff09 1px, #0000 1px),
    linear-gradient(90deg, #ffffff09 1px, #0000 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0, #000 20%, #0000 100%);
  mask-image: radial-gradient(70% 60% at 50% 0, #000 20%, #0000 100%);
}

.app {
  position: relative; z-index: 1;
  max-width: 760px; margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(48px + env(safe-area-inset-bottom));
}
.loading { text-align: center; color: var(--ink-3); margin-top: 30vh; }

/* ---------- Typografie ---------- */

.display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.005em;
  text-wrap: balance;
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
}
.display mark, .hl {
  background: var(--accent);
  color: #fff;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  border-radius: 0.12em;
  padding: 0.02em 0.18em;
}
.eyebrow {
  display: inline-block;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-hi);
  font-size: 0.72rem;
  font-weight: 700;
}
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Tlačítka ---------- */

.btn {
  position: relative;
  display: inline-flex; justify-content: center; align-items: center; gap: 0.6rem;
  overflow: hidden;
  padding: 1.05rem 1.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem; font-weight: 700; line-height: 1;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s, background 0.2s, border-color 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--cta-hi), var(--cta));
  box-shadow: 0 0 0 1px var(--cta-ring), 0 10px 30px -8px rgba(var(--cta-rgb), 0.75), inset 0 1px 0 #ffffff40;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 0 0 1px var(--cta-ring), 0 0 40px -4px rgba(var(--cta-rgb), 0.85), inset 0 1px 0 #ffffff4d; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, #0000 30%, #ffffff47 50%, #0000 70%);
  transform: translate(-120%);
}
.btn-primary:hover::after { transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); transform: translate(120%); }
.btn-ghost {
  color: var(--ink);
  background: linear-gradient(#ffffff0f, #ffffff06);
  border-color: var(--line-strong);
  padding: 0.85rem 1.3rem;
  font-size: 0.8rem;
}
.btn-ghost:hover { border-color: var(--accent-line); box-shadow: 0 0 30px -8px rgba(var(--cta-rgb), 0.6); }
.btn-sm { padding: 0.6rem 0.95rem; font-size: 0.7rem; }
.btn-block { width: 100%; }
.btn-halo { animation: halo 2.2s ease-out infinite; }
.btn-halo:hover { animation: none; }
.link-btn {
  background: none; border: 0; padding: 0.25rem 0;
  color: var(--accent-hi); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line);
}
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(#ffffff0f, #ffffff06);
  font-size: 1.15rem; font-weight: 700; line-height: 1;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.15s;
}
.icon-btn:hover:not(:disabled) { border-color: var(--accent-line); box-shadow: 0 0 24px -8px rgba(var(--cta-rgb), 0.7); }
.icon-btn:active:not(:disabled) { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

/* ---------- Karty ---------- */

.glass {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  background: linear-gradient(#ffffff0f, #ffffff06);
}
.card { padding: 22px 18px; margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-title { margin: 4px 0 0; font-size: 1.05rem; font-weight: 700; }
@media (min-width: 560px) { .card { padding: 28px; } }

/* ---------- Horní lišta ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 4px; }
.logo { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who { font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .who { display: none; } }

/* ---------- Hero ---------- */

.hero { text-align: center; padding: 34px 0 10px; }
.hero h1 { font-size: clamp(2rem, 9vw, 3.3rem); margin-top: 12px; }
.hero .sub { margin: 14px auto 0; font-size: 0.92rem; color: var(--ink-2); }
.progress { margin: 22px auto 0; max-width: 460px; }
.progress-track { height: 8px; border-radius: 999px; background: #ffffff10; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  box-shadow: 0 0 18px rgba(var(--cta-rgb), 0.8);
}
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.74rem; color: var(--ink-3); font-weight: 600; }

/* ---------- Tři denní závazky ---------- */

.checks { display: flex; gap: 8px; flex-wrap: wrap; }
.check {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff06;
  color: var(--ink-3);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap;
}
.check .dot { width: 16px; height: 16px; border-radius: 999px; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 0.6rem; }
.check.on { color: var(--accent-hi); border-color: var(--accent-line); background: var(--accent-soft); }
.check.on .dot { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Report ---------- */

.daynav { display: flex; align-items: center; gap: 10px; }
.daynav-label { flex: 1; text-align: center; min-width: 0; }
.daynav-label strong { display: block; font-size: 1.05rem; text-transform: capitalize; }
.daynav-label span { font-size: 0.76rem; color: var(--ink-3); font-weight: 600; }

.section { margin-top: 22px; }
.label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 0.5rem;
  color: var(--ink-2); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
}
.label .goal { color: var(--ink-3); font-weight: 600; }
.label .goal.ok { color: var(--accent-hi); }

.field {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--sunken);
  color: var(--ink);
  padding: 0.8rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field::placeholder { color: var(--ink-3); }
.field:focus { border-color: var(--accent-hi); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-lg { font-size: 1.6rem; font-weight: 700; padding: 0.55rem 1rem; }
textarea.field { resize: vertical; min-height: 84px; line-height: 1.5; font-size: 0.95rem; }
input[type="time"].field { min-height: 58px; -webkit-appearance: none; appearance: none; }
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.6; }

.wake-row { display: flex; gap: 10px; align-items: stretch; }
.wake-row .field { flex: 1; }

.brand-list { display: grid; gap: 8px; }
.brand-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--sunken);
}
.brand-row .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.brand-row .name { flex: 1; min-width: 0; font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .count { width: 2.2ch; text-align: center; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.total-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 0.85rem; color: var(--ink-2); }
.total-row strong { color: var(--ink); font-size: 1rem; }

.option {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--sunken);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.option:hover { border-color: var(--line-strong); }
.option .radio { width: 22px; height: 22px; flex: none; border-radius: 999px; border: 2px solid var(--ink-3); display: grid; place-items: center; color: #fff; font-size: 0.75rem; transition: all 0.2s; }
.option .opt-title { display: block; font-weight: 600; }
.option .opt-sub { display: block; font-size: 0.78rem; color: var(--ink-3); }
.option.on { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: 0 0 30px -12px rgba(var(--cta-rgb), 0.8); }
.option.on .radio { background: var(--accent); border-color: var(--accent); }

.save-row { margin-top: 24px; display: grid; gap: 10px; }
.save-state { text-align: center; font-size: 0.78rem; color: var(--ink-3); font-weight: 600; min-height: 1.2em; }
.save-state.dirty { color: var(--warn); }

.notice {
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  font-size: 0.9rem; color: var(--ink);
}
.error-box {
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--bad-line); background: #ff5b5b14; color: var(--bad);
  font-size: 0.85rem;
}

/* Úprava brandů */
.brand-edit { display: grid; gap: 8px; }
.brand-edit-row { display: flex; gap: 8px; align-items: center; }
.brand-edit-row .field { padding: 0.65rem 0.9rem; font-size: 0.95rem; }
.archived { margin-top: 12px; font-size: 0.8rem; color: var(--ink-3); }
.archived button { margin-left: 6px; }

/* ---------- Statistiky ---------- */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--sunken); }
.stat .k { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { margin-top: 6px; font-family: var(--font-display); font-size: 1.75rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .s { margin-top: 6px; font-size: 0.74rem; color: var(--ink-2); }

/* ---------- 90 dní ---------- */

.days { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.day {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #ffffff05;
  color: var(--ink-3);
  font-size: clamp(0.55rem, 2.2vw, 0.72rem); font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 0;
  transition: transform 0.15s, box-shadow 0.2s;
}
.day:hover:not(:disabled) { transform: translateY(-1px); }
.day:disabled { cursor: default; }
.day.full { background: linear-gradient(180deg, var(--cta-hi), var(--cta)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px -6px rgba(var(--cta-rgb), 0.9); }
.day.partial { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.day.missed { border-color: var(--bad-line); color: var(--bad); background: #ff5b5b0d; }
.day.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.day.selected { outline: 2px solid var(--warn); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 0.74rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }
.legend i.full { background: var(--accent); border-color: transparent; }
.legend i.partial { background: var(--accent-soft); border-color: var(--accent-line); }
.legend i.missed { background: #ff5b5b0d; border-color: var(--bad-line); }

/* ---------- Grafy ---------- */

.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--sunken); }
.seg button { border: 0; background: none; padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.seg button.on { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent-line); }
.chart { position: relative; margin-top: 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 2px 0 8px; font-size: 0.76rem; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.axis text { fill: var(--ink-3); font-size: 11px; font-family: var(--font-sans); font-weight: 600; }
.gridline { stroke: #ffffff10; stroke-width: 1; }
.chart-sep { height: 1px; background: var(--line); margin: 22px 0 18px; }
.hit { cursor: crosshair; }
.hit:hover { fill: #ffffff0a; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty-chart { padding: 26px 0; text-align: center; color: var(--ink-3); font-size: 0.85rem; }

.tip {
  position: fixed; z-index: 50; pointer-events: none;
  min-width: 150px; max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #0f1320f2;
  box-shadow: 0 16px 40px -12px #000;
  font-size: 0.78rem; line-height: 1.45;
}
.tip b { display: block; margin-bottom: 4px; font-size: 0.8rem; }
.tip .row { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.tip .row span:last-child { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

details.table { margin-top: 18px; }
details.table summary { cursor: pointer; font-size: 0.8rem; font-weight: 700; color: var(--accent-hi); letter-spacing: 0.04em; }
.tbl-wrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink-3); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
td.note { white-space: normal; min-width: 180px; color: var(--ink-2); }

/* ---------- Detail dne (kouč) ---------- */

.detail-grid { display: grid; gap: 10px; margin-top: 16px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); font-size: 0.9rem; }
.detail-row span:first-child { color: var(--ink-2); }
.detail-row span:last-child { font-weight: 700; text-align: right; }
.late {
  display: inline-block; margin-left: 6px; padding: 0.1rem 0.5rem;
  border-radius: 999px; border: 1px solid #fbbf2455; background: #fbbf2418; color: var(--warn);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.detail-note { padding: 14px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); font-size: 0.9rem; white-space: pre-wrap; }

/* ---------- Přehled klientů ---------- */

.client-card { display: block; text-decoration: none; padding: 20px; margin-top: 14px; transition: border-color 0.2s, box-shadow 0.2s; }
.client-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-card), 0 0 40px -16px rgba(var(--cta-rgb), 0.8); }
.client-card h2 { margin: 6px 0 12px; font-size: 1.3rem; }
.client-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 0.8rem; color: var(--ink-2); }
.client-meta strong { color: var(--ink); }

/* ---------- Přihlášení ---------- */

.login { min-height: calc(100vh - 80px); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 440px; padding: 34px 26px; text-align: center; overflow: hidden; }
.login-card .glow { position: absolute; right: -40px; top: -40px; width: 190px; height: 190px; border-radius: 999px; background: #2f5bff40; filter: blur(32px); pointer-events: none; }
.login-card h1 { font-size: 1.75rem; margin-top: 22px; }
.login-card p { margin: 12px 0 0; font-size: 0.9rem; color: var(--ink-2); }
.login-card .btn { margin-top: 26px; width: 100%; }

.install { margin-top: 26px; text-align: center; font-size: 0.78rem; color: var(--ink-3); }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 0.75rem 1.2rem; border-radius: 999px;
  background: var(--panel-hi); border: 1px solid var(--accent-line);
  box-shadow: 0 10px 30px -8px rgba(var(--cta-rgb), 0.7);
  font-size: 0.85rem; font-weight: 700;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--bad-line); box-shadow: 0 10px 30px -8px #ff5b5b80; }

@keyframes halo {
  0%, to { box-shadow: 0 0 0 0 rgba(var(--cta-rgb), 0.55), 0 10px 30px -8px rgba(var(--cta-rgb), 0.75); }
  50% { box-shadow: 0 0 0 14px rgba(var(--cta-rgb), 0), 0 10px 30px -8px rgba(var(--cta-rgb), 0.75); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-halo { animation: none; }
  .btn-primary::after { display: none; }
}
@media (forced-colors: active) {
  .day.full, .day.partial, .day.missed { border: 2px solid CanvasText; }
}
