/* Jarabot Redline — pohotovostní linka */
:root {
  --bg: #f4f5f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5e7ef;
  --line-2: #eef0f6;
  --red: #e11d48;
  --red-ink: #be123c;
  --red-soft: #fff1f3;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --side: #0b1120;
  --side-ink: #cbd5e1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 .6em; }
small, .muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 13px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 248px, var(--bg) 248px); }
.shell > * { min-width: 0; }
.side {
  background: var(--side); color: var(--side-ink); padding: 22px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--red); display: grid; place-items: center; position: relative; }
.brand-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 70% { box-shadow: 0 0 0 9px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.brand b { font-size: 17px; letter-spacing: .01em; }
.brand small { display: block; color: #94a3b8; font-size: 11.5px; margin-top: -2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 9px 12px; border-radius: 10px; font-weight: 500; font-size: 14.5px;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(225, 29, 72, .16); color: #fff; }
.nav a.on .ico { color: #fb7185; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.side-foot { margin-top: auto; padding: 12px; font-size: 12.5px; color: #94a3b8; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot a { color: #cbd5e1; }
.main { padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.demo-ribbon {
  display: flex; gap: 10px; align-items: center; background: var(--amber-soft); color: var(--amber); border: 1px solid #fde68a;
  border-radius: 12px; padding: 9px 14px; font-size: 13.5px; margin-bottom: 18px;
}

/* ---------- cards & grid ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-h small { white-space: nowrap; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stat b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13.5px; }

/* ---------- now hero ---------- */
.hero {
  background: radial-gradient(1200px 300px at 0% 0%, #1e293b 0%, #0b1120 60%);
  color: #e2e8f0; border: 0; padding: 26px 28px;
}
.hero .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: #fda4af; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 0 0 rgba(244,63,94,.7); animation: pulse-red 1.8s infinite; }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(244,63,94,.6); } 70% { box-shadow: 0 0 0 8px rgba(244,63,94,0); } 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); } }
.hero h2 { font-size: 15px; font-weight: 500; color: #94a3b8; margin-top: 6px; }
.hero .meta { margin-top: 16px; display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; color: #cbd5e1; }
.hero .meta b { color: #fff; }
.hero .chain { margin-top: 18px; }
.hero .person { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #fff; }
.hero .person small { color: #94a3b8; }
.hero .arrow { color: #64748b; }
.hero .empty-chain { background: rgba(244,63,94,.15); color: #fecdd3; border-radius: 12px; padding: 14px 16px; }

/* ---------- chain ---------- */
.chain { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.person { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px 9px 9px; background: #fff; min-width: 0; }
.person .who { line-height: 1.25; min-width: 0; }
.person .who b { display: block; font-size: 14.5px; white-space: nowrap; }
.person .who small { font-size: 12.5px; white-space: nowrap; }
.person.first { box-shadow: 0 0 0 2px var(--red) inset; }
.hero .person.first { box-shadow: 0 0 0 2px #f43f5e inset; background: rgba(244,63,94,.12); }
.arrow { align-self: center; color: #94a3b8; font-size: 18px; }
.step-no { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.avatar { flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; width: 36px; height: 36px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

/* ---------- badges & buttons ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #f1f5f9; color: #475569; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red-ink); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.dark { background: #0f172a; color: #fff; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 9px 15px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.2; font-family: inherit;
}
.btn:hover { text-decoration: none; border-color: #cbd5e1; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.link { border: 0; background: none; color: var(--blue); padding: 0; }
.btn.danger { color: var(--red-ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.button_to { display: inline; }

/* ---------- week grid ---------- */
.week { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; align-items: center; }
.week .day { font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.week .day small { display: block; font-weight: 500; font-size: 12px; }
.week .day.today { color: var(--red-ink); }
.track { position: relative; height: 34px; background: var(--line-2); border-radius: 8px; overflow: hidden; }
.bar {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 8px; color: #fff; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 2px solid rgba(255,255,255,.85);
}
.bar.gap { background: repeating-linear-gradient(135deg, #fecdd3 0 6px, #fff1f2 6px 12px); color: var(--red-ink); }
.bar .sub { opacity: .85; font-weight: 500; margin-left: 4px; }
.now-line { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); z-index: 2; }
.now-line::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.axis { position: relative; height: 18px; font-size: 11.5px; color: var(--muted); }
.axis span { position: absolute; transform: translateX(-50%); }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.holiday-tag { font-size: 11px; color: var(--amber); font-weight: 600; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click:hover td { background: #fafbff; cursor: pointer; }
.table-wrap { overflow-x: auto; }

/* ---------- forms ---------- */
.form { max-width: 720px; }
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=time], input[type=date], input[type=number], input[type=url], select, textarea {
  width: 100%; font: inherit; padding: 9px 12px; border: 1px solid #d5d9e4; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(225, 29, 72, .25); border-color: var(--red); }
input[type=color] { width: 54px; height: 38px; border: 1px solid #d5d9e4; border-radius: 10px; padding: 3px; background: #fff; }
.inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { position: relative; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: inline-block; min-width: 46px; text-align: center; padding: 8px 10px; border: 1px solid #d5d9e4; border-radius: 10px; font-weight: 600; cursor: pointer; user-select: none; background: #fff; }
.days input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.days input:focus-visible + span { outline: 2px solid var(--red); }
.chain-pick { display: grid; gap: 8px; }
.chain-pick .slot { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; }
.chain-pick .slot b { font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--red); }
.errors { background: var(--red-soft); color: var(--red-ink); border: 1px solid #fecdd3; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.errors ul { margin: 6px 0 0; padding-left: 18px; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; }

/* ---------- flash ---------- */
.flash { border-radius: 12px; padding: 11px 16px; margin-bottom: 18px; font-size: 14.5px; }
.flash.notice { background: var(--green-soft); color: #065f46; border: 1px solid #a7f3d0; }
.flash.alert { background: var(--red-soft); color: var(--red-ink); border: 1px solid #fecdd3; }

/* ---------- simulator timeline ---------- */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.tl-item.ring::before { border-color: var(--red); }
.tl-item.end::before { border-color: var(--muted); }
.tl-item .t { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- calls ---------- */
.transcript { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; }
.bubble small { display: block; font-size: 11.5px; margin-bottom: 2px; font-weight: 600; }
.bubble.caller { background: #f1f5f9; align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.tech { background: #0f172a; color: #e2e8f0; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.tech small { color: #94a3b8; }
.ticket { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ticket-h { background: #f8fafc; border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ticket-b { padding: 14px 16px; font-size: 14.5px; }
.ticket-b ul { margin: 4px 0 10px; padding-left: 18px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; margin-bottom: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
pre.code { background: #0b1120; color: #cbd5e1; padding: 14px 16px; border-radius: 12px; overflow: auto; font-size: 12.5px; max-height: 420px; margin: 0; }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
details[open] summary { margin-bottom: 10px; }
audio { width: 100%; }
.attempts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.attempts .a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 999px; background: #f1f5f9; }
.attempts .a.ok { background: var(--green-soft); color: var(--green); }
.attempts .a.no { background: #f8fafc; color: var(--muted); text-decoration: line-through; }
.processing { display: inline-flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border: 2px solid #cbd5e1; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.recorder { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 18px; text-align: center; }
.rec-btn { width: 74px; height: 74px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 6px 20px rgba(225,29,72,.35); }
.rec-btn.on { animation: pulse-red 1.4s infinite; background: var(--red-ink); }
.rec-time { font-family: var(--mono); font-size: 20px; margin-top: 10px; }

/* ---------- pbx ---------- */
.op { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.op + .op { margin-top: 10px; }
.op .verb { font-family: var(--mono); font-size: 12px; font-weight: 700; background: #0f172a; color: #fff; padding: 2px 7px; border-radius: 6px; }
.op .path { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); word-break: break-all; }
.op pre.code { margin-top: 10px; max-height: 220px; }
.checklist { counter-reset: c; list-style: none; padding: 0; margin: 0; }
.checklist li { counter-increment: c; position: relative; padding: 0 0 14px 40px; }
.checklist li::before { content: counter(c); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: #0f172a; color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.checklist li b { display: block; }
.checklist li span { color: var(--ink-2); font-size: 14px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 20% 10%, #1e293b, #0b1120 65%); }
.auth .card { width: 100%; max-width: 400px; padding: 30px; }
.auth .brand { color: var(--ink); padding: 0 0 18px; }
.auth .brand small { color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; z-index: 10; overflow-x: auto; gap: 4px; }
  .brand { padding: 0 8px 0 0; }
  .brand small, .side-foot { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 7px 10px; font-size: 13.5px; white-space: nowrap; }
  .nav .ico { display: none; }
  .main { padding: 18px 16px 50px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat b { font-size: 24px; }
  .span2 { grid-column: auto; }
  .week { grid-template-columns: 62px 1fr; }
  .bar { font-size: 0; padding: 0; }
  .bubble { max-width: 92%; }
  .kv { grid-template-columns: 1fr; }
  .card-h { flex-wrap: wrap; }
  .card-h small { white-space: normal; }
  .chain-pick .slot { grid-template-columns: 1fr; gap: 4px; }
  h1 { font-size: 22px; }
}
