/* ============================ tlačidlá ============================ */
.btn {
  --b: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--b); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-weight: 650; font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn--sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.btn--xs { min-height: 26px; padding: 3px 9px; font-size: 12px; }
.btn--lg { min-height: 52px; padding: 12px 24px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }
.btn--sm.btn--icon { width: 32px; }
.btn.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--ok.is-on { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn--warn.is-on { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn--accent-on.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn .ico { font-size: 1.05em; line-height: 1; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* ============================ formuláre ============================ */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.textarea--code { font-family: var(--mono); font-size: 13px; line-height: 1.55; tab-size: 2; white-space: pre; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input--big { min-height: 58px; font-size: 22px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.range { width: 100%; accent-color: var(--accent); }

/* Prepínač */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .2s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }

/* Segmentový ovládač */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 650; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ============================ karty a štítky ============================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.2vw, 24px); box-shadow: var(--shadow-1); }
.card--flat { box-shadow: none; }
.card--soft { background: var(--surface-2); }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; }
.chip--accent { background: var(--accent-soft); color: var(--accent); }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--bad { background: var(--bad-soft); color: var(--bad); }
.chip--cyan { background: var(--cyan-soft); color: var(--cyan); }
.chip--violet { background: var(--violet-soft); color: var(--violet); }
.chip--outline { background: transparent; border-color: var(--line-strong); }
.chip button { border: 0; background: none; padding: 0 0 0 2px; font-size: 14px; line-height: 1; color: inherit; opacity: .6; }
.chip button:hover { opacity: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot--ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot--warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); animation: pulse 1.4s infinite; }
.dot--bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

/* ============================ záložky ============================ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--ink); }
.tabs button.is-on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; display: inline-grid; place-items: center; }

/* ============================ modál ============================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 10, 16, .62); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 1000; padding: 16px; animation: fadeUp .2s var(--ease); }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--ink); border-radius: 20px; box-shadow: var(--shadow-3); border: 1px solid var(--line); }
.modal--wide { width: min(1100px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 22px; }
.modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface); }

/* ============================ toast ============================ */
#toasts { position: fixed; z-index: 2000; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: min(460px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-2); opacity: 0; transform: translateY(10px); transition: all .25s var(--ease); }
.toast.is-in { opacity: 1; transform: none; }
.toast--ok { background: var(--ok); color: #fff; }
.toast--bad { background: var(--bad); color: #fff; }
.toast--warn { background: var(--warn); color: #fff; }

/* ============================ tabuľky ============================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.t th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); font-weight: 800; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================ progres ============================ */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }
.ring { --p: 0; --size: 120px; width: var(--size); height: var(--size); border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; }
.ring > span { width: calc(var(--size) - 16px); height: calc(var(--size) - 16px); border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: calc(var(--size) / 4.2); font-variant-numeric: tabular-nums; }

/* ============================ 3D tilt karta ============================ */
.tilt { transform-style: preserve-3d; transition: transform .25s var(--ease), box-shadow .25s; will-change: transform; }
.tilt-inner { transform: translateZ(30px); }

/* ============================ QR ============================ */
.qr { background: #fff; padding: 14px; border-radius: 16px; display: inline-block; line-height: 0; }
.qr svg { width: 100%; height: auto; }

/* ============================ prázdne stavy ============================ */
.empty { padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }

/* Plávajúci časovač */
.timer-pill { position: fixed; right: 16px; bottom: 16px; z-index: 900; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); font-weight: 800; font-variant-numeric: tabular-nums; }
.timer-pill .ring { --size: 34px; }
.timer-pill .ring > span { font-size: 0; background: var(--ink); }
.timer-pill.is-low { background: var(--accent); color: #fff; }
.timer-pill.is-low .ring > span { background: var(--accent); }

.broadcast { display: flex; gap: 12px; align-items: center; padding: 12px 18px; background: var(--accent); color: #fff; font-weight: 650; }
.broadcast button { margin-left: auto; border: 0; background: rgba(255,255,255,.2); color: #fff; border-radius: 99px; padding: 4px 10px; }
