/* =====================================================
   VR Training v2 — klikatelný prototip
   Ostré hrany na kartách/tlačítkách, kulaté pilulky.
   ===================================================== */

:root {
  /* Barvy */
  --orange:        #f4500c;
  --orange-dark:   #d8440a;
  --orange-soft:   #f5a24b;
  --orange-pill-bg:#fdead9;

  --green-dark:    #0d7c44;
  --green:         #17a05c;
  --green-ring:    #22b573;
  --green-soft:    #8fdca8;
  --green-pill-bg: #ddf3e6;

  --red:           #e5484d;
  --red-pill-bg:   #fce1e2;

  --ink:           #1e2126;
  --ink-soft:      #757b83;
  --ink-faint:     #9aa0a8;

  --bg:            #eef0f2;
  --surface:       #ffffff;
  --line:          #e3e5e8;
  --chip:          #e7e9ec;   /* timer, disabled tlačítka, aktivní nav */
  --bar-idle:      #e8ebee;
  --row-stripe:    #f4f5f7;
  --ring-track:    #e4e7ea;
  --ring-progress: #8a9098;

  --sidebar-w: 300px;
  --rail-w: 96px;
  --proto-h: 44px;   /* výška lišty prototypu */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-width: 1280px;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

/* =====================================================
   Lišta prototypu (nad aplikací, není součást produktu)
   ===================================================== */

.proto-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 22px;
  background: #202226;
  color: #fff;
  border-bottom: 1px solid #33363b;
}

.proto-bar__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8b9098;
}

.proto-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: #33363b;
  border: none;
  cursor: pointer;
  transition: background .15s;
}

.proto-bar__btn:hover { background: #3e424a; }

.proto-bar__btn.is-on { background: var(--orange); }

.proto-bar__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #70757e;
}

.proto-bar__btn.is-on .proto-bar__dot {
  background: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}

.proto-bar__hint { font-size: 12.5px; color: #8b9098; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--proto-h));
}

.app--rail { grid-template-columns: var(--rail-w) 1fr; }

/* =====================================================
   Sidebar — plná varianta
   ===================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 26px 0 26px;
  position: sticky;
  top: var(--proto-h);
  height: calc(100vh - var(--proto-h));
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  margin-bottom: 40px;
}

.brand__logo {
  width: 48px;
  height: 48px;
  background: var(--orange);
  display: grid;
  place-items: center;
  flex: none;
}

.brand__logo svg { width: 30px; height: 30px; }

.brand__text strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand__text span { font-size: 12.5px; color: var(--ink-soft); }

.nav { display: grid; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 30px;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .15s, background .15s;
}

.nav__item svg { width: 21px; height: 21px; flex: none; }

.nav__item:hover { color: var(--ink); }

.nav__item.is-active {
  background: var(--chip);
  color: var(--ink);
  font-weight: 600;
}

.nav__item.is-active svg { color: var(--orange); }

.user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 28px 0;
  cursor: pointer;
}

.user__avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #e2e4e7;
  color: #aab0b7;
  display: grid;
  place-items: center;
  flex: none;
}

.user__avatar svg { width: 25px; height: 25px; }

.user__text strong { display: block; font-size: 15px; font-weight: 600; }

.user__text span { font-size: 12.5px; color: var(--ink-soft); }

.user__chevron { width: 18px; height: 18px; margin-left: auto; color: var(--ink-soft); }

/* --- Sidebar — ikonový rail (konzole školení) --- */

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 0 26px;
  position: sticky;
  top: var(--proto-h);
  height: calc(100vh - var(--proto-h));
}

.rail__logo {
  width: 46px;
  height: 46px;
  background: var(--orange);
  display: grid;
  place-items: center;
  margin-bottom: 34px;
}

.rail__logo svg { width: 28px; height: 28px; }

.rail__item {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  transition: color .15s, background .15s;
}

.rail__item svg { width: 22px; height: 22px; }

.rail__item:hover { color: var(--ink); }

.rail__item.is-active { background: var(--chip); color: var(--orange); }

.rail .user__avatar { margin-top: auto; cursor: pointer; }

/* =====================================================
   Hlavní obsah
   ===================================================== */

.main {
  padding: 30px 40px 60px;
  display: grid;
  gap: 24px;
  align-content: start;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-head h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-head__tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* =====================================================
   Tlačítka, selecty, pilulky
   ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: filter .15s, background .15s;
}

.btn svg { width: 17px; height: 17px; flex: none; }

.btn--primary { background: var(--orange); color: #fff; }
.btn--primary:hover { filter: brightness(1.08); }

.btn--dark { background: #17181a; color: #fff; }
.btn--dark:hover { filter: brightness(1.25); }

.btn--ghost { background: var(--surface); }
.btn--ghost:hover { background: #f7f8f9; }

.btn--block { width: 100%; }

.btn:disabled,
.btn.is-disabled {
  background: var(--chip);
  color: var(--ink-faint);
  cursor: default;
  pointer-events: none;
}

.select {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: none;
  cursor: pointer;
}

.select svg { width: 17px; height: 17px; color: var(--ink-soft); flex: none; }

.select--placeholder { color: var(--ink-soft); }

.select:disabled,
.select.is-disabled {
  color: var(--ink-faint);
  background: var(--chip);
  cursor: default;
  pointer-events: none;
}

.select:disabled svg { color: var(--ink-faint); }

/* Timer chip */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--chip);
  color: var(--ink);
}

.timer svg { width: 17px; height: 17px; color: var(--ink-soft); }

.timer.is-idle { color: var(--ink-faint); }
.timer.is-idle svg { color: var(--ink-faint); }

/* Pilulky (jediné kulaté prvky) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}

.pill svg { width: 15px; height: 15px; flex: none; }

.pill--gray   { background: #eff0f2; color: var(--ink-soft); }
.pill--green  { background: var(--green-pill-bg); color: var(--green); }
.pill--orange { background: var(--orange-pill-bg); color: var(--orange); }

.pill--spin svg { animation: spin 1.4s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Checkbox */
.checkbox {
  width: 22px;
  height: 22px;
  flex: none;
  appearance: none;
  border: 2px solid #c9cdd2;
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .12s, border-color .12s;
}

.checkbox:checked {
  background: var(--orange);
  border-color: var(--orange);
}

.checkbox:checked::after {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.check-label .count { color: var(--ink-soft); font-weight: 400; }

/* =====================================================
   Dropdowny
   ===================================================== */

.dd { position: relative; }

.dd__panel {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  min-width: 360px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(20, 24, 30, .16);
  z-index: 40;
  display: none;
  animation: dd-in .14s ease-out;
}

.dd.is-open .dd__panel { display: block; }

@keyframes dd-in {
  from { opacity: 0; transform: translateY(-6px); }
}

.dd__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .12s;
}

.dd__item:hover { background: var(--row-stripe); }

.dd__item + .dd__item { border-top: 1px solid var(--line); }

.dd__thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  flex: none;
}

.dd__text { min-width: 0; }

.dd__text small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-bottom: 1px;
}

.dd__text strong { font-size: 15px; font-weight: 600; }

.dd__text span { display: block; font-size: 13px; color: var(--ink-soft); }

.dd__item .checkbox { margin-left: auto; }

.dd__footer { padding: 12px 16px 16px; }

/* --- Panel přesunu na checkpoint --- */

.dd__panel--move { min-width: 440px; }

/* panel otevřený nahoru (uvnitř modalu) */
.dd--up .dd__panel {
  top: auto;
  bottom: calc(100% + 2px);
  left: 0;
  right: 0;
  min-width: 0;
  animation: dd-in-up .14s ease-out;
}

@keyframes dd-in-up {
  from { opacity: 0; transform: translateY(6px); }
}

.dd__head {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
}

.dd__head-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.field-select {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 14px;
  cursor: pointer;
}

.field-select:focus { outline: none; border-color: var(--orange); }

.dd__list { max-height: 300px; overflow-y: auto; }

/* radio = čtvereček s oranžovou výplní, drží se ostrých hran */
.radio {
  width: 20px;
  height: 20px;
  flex: none;
  appearance: none;
  border: 2px solid #c9cdd2;
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .12s;
}

.radio:checked { border-color: var(--orange); }

.radio:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--orange);
}

.dd__item:has(.radio:checked) { background: var(--row-stripe); }

.dd__hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

/* =====================================================
   Banner běžícího školení (Přehled / Reporty)
   ===================================================== */

.live-bar {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 20px 26px;
  background: #17181a;
  color: #fff;
}

.live-bar__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  flex: none;
}

.live-bar__badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.6s ease-in-out infinite;
}

.live-bar__title strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.live-bar__title span {
  font-size: 13.5px;
  opacity: .7;
}

.live-bar__stats {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-left: auto;
}

.live-bar__stat span {
  display: block;
  font-size: 12.5px;
  opacity: .65;
  margin-bottom: 3px;
}

.live-bar__stat strong {
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.live-bar .btn { flex: none; }

/* =====================================================
   Stat karty (Přehled / Reporty)
   ===================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat {
  min-height: 176px;
  padding: 24px 28px;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.stat__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stat__top h3 { font-size: 18px; font-weight: 700; }

.stat__top .num {
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.stat__period {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  opacity: .8;
  margin-top: 4px;
  cursor: pointer;
}

.stat__period svg { width: 14px; height: 14px; }

.stat__bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.stat--green { background: var(--green-dark); }

.stat--green-soft { background: var(--green-soft); color: var(--green-dark); }
.stat--green-soft .stat__period { opacity: .75; }

.stat--orange { background: var(--orange); }

.trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.trend svg { width: 11px; height: 11px; }

.trend--up { background: #dff3e7; color: var(--green-dark); }
.trend--down { background: var(--red); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

.chip-tag {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--orange-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* =====================================================
   Karty a graf
   ===================================================== */

.card {
  background: var(--surface);
  padding: 26px 30px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.card__head h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }

.card__tools { display: flex; align-items: center; gap: 14px; }

.card__tools .select { background: var(--bg); }

.analytics-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.analytics-link svg { width: 18px; height: 18px; color: var(--orange); }

/* --- Sloupcový graf --- */

.chart {
  --chart-h: 290px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
  padding: 34px 10px 0;
}

.chart__target {
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(34px + var(--chart-h) * (100 - var(--target)) / 100);
  border-top: 2px dashed #d4d7db;
}

.chart__col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chart__bar {
  width: clamp(64px, 58%, 96px);
  height: calc(var(--chart-h) * var(--value) / 100);
  margin-top: calc(var(--chart-h) * (100 - var(--value)) / 100);
  background: var(--bar-idle);
  position: relative;
  z-index: 1;
}

.chart__value {
  position: absolute;
  top: calc(var(--chart-h) * (100 - var(--value)) / 100 - 30px);
  font-size: 15px;
  font-weight: 600;
}

.chart__label {
  margin-top: 16px;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-faint);
  text-align: center;
}

.is-highlight .chart__bar {
  background: var(--orange);
  box-shadow: 0 0 28px rgba(244, 80, 12, .4);
}

.is-highlight .chart__label { color: var(--ink); font-weight: 600; }

/* =====================================================
   Sekce s tabulkou (Přehled / Reporty)
   ===================================================== */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
}

.section-head h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }

.section-head .page-head__tools .select { min-width: 168px; }

.table-card { padding: 14px 18px; }

.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }

.table th {
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 14px 16px;
}

.table td { padding: 15px 16px; }

.table tbody tr { cursor: pointer; }

.table tbody tr:nth-child(odd) td { background: var(--row-stripe); }

.table tbody tr:hover td { background: #eceef1; }

.table .sub { display: block; font-size: 13px; color: var(--ink-faint); margin-top: 3px; }

.table .with-ico {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.table .with-ico svg { width: 18px; height: 18px; color: var(--ink-soft); }

.table .score { font-weight: 700; color: var(--green); }

.table .kebab-cell { width: 40px; text-align: right; }

.kebab {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
}

.kebab:hover { color: var(--ink); }

.kebab svg { width: 18px; height: 18px; }

/* =====================================================
   Konzole školení
   ===================================================== */

.console-head { gap: 14px; }

.console-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

/* --- Souhrnné dlaždice vlevo --- */

.tiles { display: grid; gap: 10px; }

.tile {
  min-height: 96px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--chip);
  color: var(--ink-soft);
}

.tile h3 { font-size: 15.5px; font-weight: 600; }

.tile .val {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.tile--green-dark { background: var(--green-dark); color: #fff; }
.tile--green      { background: var(--green-soft); color: #114d2e; }
.tile--orange     { background: var(--orange-soft); color: #fff; }

/* --- Grid zařízení --- */

.devices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.devices.devices--detail {
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}

.device {
  position: relative;
  background: var(--surface);
  min-height: 288px;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: box-shadow .15s;
}

.device:hover,
.device-detail:hover { box-shadow: 0 4px 18px rgba(20, 24, 30, .12); }

.device-detail { cursor: pointer; }

.device .checkbox,
.device .kebab,
.device-detail .checkbox,
.device-detail .kebab { cursor: pointer; }

.device__top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.device__top-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
}

.device__top-icons svg { width: 18px; height: 18px; }

.device__visual {
  margin: 14px 0 16px;
  cursor: pointer;
}

/* kruh s ikonou zařízení */
.device__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 7px solid var(--ring-track);
  display: grid;
  place-items: center;
  color: #b9bec5;
}

.device__avatar svg { width: 34px; height: 34px; }

/* progress ring (SVG) */
.ring { position: relative; width: 96px; height: 96px; }

.ring svg { width: 96px; height: 96px; transform: rotate(-90deg); }

.ring circle {
  fill: none;
  stroke-width: 7;
  stroke: var(--ring-track);
}

.ring circle.fg {
  stroke: var(--ring-progress);
  stroke-linecap: butt;
  transition: stroke-dashoffset .6s ease;
}

.ring--done circle.fg { stroke: var(--green-ring); stroke-width: 9; }
.ring--done circle.bg { stroke-width: 9; stroke: transparent; }
.ring--assist circle.fg { stroke: var(--orange-soft); }

.ring__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.device__name { font-size: 16px; font-weight: 700; }

.device__sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.device__sub .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-ring);
}

.device__sub .dot--off { background: var(--red); }

.device__time { margin-top: 4px; font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.device__foot {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
}

.device__foot--center { justify-content: center; }

.device__score { font-size: 14px; font-weight: 700; }

.score--green  { color: var(--green); }
.score--orange { color: var(--orange-soft); }
.score--red    { color: var(--red); }
.score--none   { color: var(--ink-faint); font-weight: 500; }

/* --- Detail view zařízení --- */

.device-detail {
  background: var(--surface);
  padding: 18px 20px;
}

.device-detail__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.device-detail__head .ring,
.device-detail__head .ring svg { width: 72px; height: 72px; }

.device-detail__head .ring__label { font-size: 12.5px; }

.device-detail__name { font-size: 16px; font-weight: 700; }

.device-detail__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.device-detail__meta .device__score { font-size: 13.5px; }

.device-detail__head .device__top-icons { margin-left: auto; align-self: flex-start; }

.cp-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 13.5px;
}

.cp-table th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-faint);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.cp-table td { padding: 9px 10px; font-variant-numeric: tabular-nums; }

.cp-table tbody tr:nth-child(odd) td { background: var(--row-stripe); }

.cp-table .ico-ok { color: var(--green-ring); }
.cp-table .ico-fail { color: var(--red); }

.cp-table td:last-child, .cp-table th:last-child { text-align: right; }

.cp-table svg { width: 16px; height: 16px; }

/* --- Přepínač Přehled/Detail --- */

.view-toggle {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.view-toggle .btn { padding: 13px 20px; font-weight: 600; color: var(--ink-faint); background: none; }

.view-toggle .btn.is-active { background: var(--chip); color: var(--ink); }

/* =====================================================
   Stream modal
   ===================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: rgba(14, 16, 18, .72);
  animation: fade-in .18s ease-out;
}

.modal.is-open { display: grid; }

@keyframes fade-in { from { opacity: 0; } }

.modal__body {
  width: min(92vw, 1720px);
  max-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  background: var(--surface);
  overflow: hidden;
}

.modal__stage {
  position: relative;
  background: #0e1012;
  align-self: stretch;
  overflow: hidden;
}

.modal__stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Načítání streamu --- */

.modal__stage img {
  opacity: 0;
  transition: opacity .45s ease;
}

.modal__stage.is-ready img { opacity: 1; }

.stream-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: #0e1012;
  color: #fff;
  transition: opacity .35s ease, visibility .35s;
}

.modal__stage.is-ready .stream-loading {
  opacity: 0;
  visibility: hidden;
}

.stream-loading__spinner {
  width: 54px;
  height: 54px;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.stream-loading__text {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
}

.stream-loading__sub {
  font-size: 13px;
  color: rgba(255, 255, 255, .5);
  margin-top: -10px;
}

/* jemné doskenování plochy, než dorazí obraz */
.stream-loading__scan {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.stream-loading__scan::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    transparent 20%,
    rgba(255, 255, 255, .05) 45%,
    rgba(255, 255, 255, .09) 50%,
    rgba(255, 255, 255, .05) 55%,
    transparent 80%);
  transform: translateX(-100%);
  animation: scan 1.9s ease-in-out infinite;
}

@keyframes scan { to { transform: translateX(100%); } }

/* HUD a odznak naskočí až s obrazem */
.modal__hud,
.live-badge {
  opacity: 0;
  transition: opacity .4s ease .1s;
}

.modal__stage.is-ready .modal__hud,
.modal__stage.is-ready .live-badge { opacity: 1; }

/* živý indikátor */
.live-badge {
  position: absolute;
  bottom: 22px;
  left: 32px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: rgba(14, 16, 18, .62);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: 999px;
}

.live-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: .25; } }

/* --- Boční panel s detailem zařízení --- */

.modal__aside {
  padding: 26px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.modal__aside h4 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal__aside .sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 3px;
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.detail-meta div span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.detail-meta div strong {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.modal__aside .cp-table { margin-top: 0; }

.modal__actions { margin-top: auto; display: grid; gap: 8px; }

.modal__close {
  position: absolute;
  top: 22px;
  right: 26px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.modal__close svg { width: 26px; height: 26px; }

.modal__hud {
  position: absolute;
  top: 26px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #fff;
}

.modal__hud .ring circle { stroke: rgba(255,255,255,.28); }
.modal__hud .ring circle.fg { stroke: #fff; }
.modal__hud .ring__label { color: #fff; font-size: 15px; }

.modal__hud h3 { font-size: 26px; font-weight: 700; }

.modal__hud .scene { font-size: 15px; opacity: .85; margin-top: 2px; }

.modal__hud .task {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 14px;
  background: rgba(20, 22, 25, .55);
  font-size: 13.5px;
  border-radius: 999px;
}

/* =====================================================
   Modal „všechna školení dokončena“
   ===================================================== */

.modal--done .modal__body {
  display: block;
  width: min(92vw, 520px);
  max-height: none;
  text-align: center;
  padding: 44px 44px 36px;
}

.done-mark {
  width: 84px;
  height: 84px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--green-pill-bg);
  color: var(--green-ring);
  display: grid;
  place-items: center;
}

.done-mark svg { width: 44px; height: 44px; }

.modal--done h3 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.modal--done p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.done-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  margin-bottom: 28px;
}

.done-stats div {
  background: var(--surface);
  padding: 18px 10px;
}

.done-stats span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.done-stats strong {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.done-actions { display: flex; gap: 10px; }

.done-actions .btn { flex: 1; }

/* =====================================================
   Výsledky — timeline
   ===================================================== */

.result-head {
  display: flex;
  align-items: stretch;
}

.result-head__score {
  width: 190px;
  flex: none;
  background: var(--green-dark);
  color: #fff;
  padding: 24px 26px;
}

.result-head__score span { font-size: 15px; font-weight: 600; display: block; margin-bottom: 8px; }

.result-head__score strong { font-size: 40px; font-weight: 700; letter-spacing: -0.01em; }

.result-head__main {
  flex: 1;
  background: var(--surface);
  padding: 24px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.result-head__title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-head__title h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }

.back-link {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  text-decoration: none;
}

.back-link:hover { background: var(--row-stripe); }

.back-link svg { width: 22px; height: 22px; }

.result-head__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.result-head__meta .sep { width: 1px; height: 16px; background: var(--line); }

.result-head__meta .with-ico { display: inline-flex; align-items: center; gap: 8px; }

.result-head__meta svg { width: 17px; height: 17px; }

/* --- Timeline --- */

.timeline {
  position: relative;
  margin-left: 190px;   /* zarovnáno pod zelený blok */
  padding: 40px 0 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #c9cdd2;
}

.tl-entry {
  position: relative;
  padding-left: 150px;
  margin-bottom: 64px;
}

.tl-entry__time {
  position: absolute;
  left: -78px;
  top: 84px;
  width: 156px;
  text-align: left;
  font-size: 14px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  padding: 6px 0;
}

.tl-entry__time small { display: block; font-size: 12.5px; color: var(--ink-faint); }

.tl-entry__tick {
  position: absolute;
  left: 0;
  top: 96px;
  width: 44px;
  border-top: 1px solid #c9cdd2;
}

.tl-entry__main {
  display: flex;
  gap: 26px;
  align-items: flex-start;
}

.tl-entry__thumb {
  width: 270px;
  height: 176px;
  object-fit: cover;
  flex: none;
}

.tl-entry__info small {
  display: block;
  font-size: 14px;
  color: var(--ink-faint);
  margin-bottom: 2px;
}

.tl-entry__info h3 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }

.tl-entry__info .pct { font-size: 26px; font-weight: 700; margin-top: 6px; }

.pct--green { color: var(--green); }
.pct--orange { color: var(--orange-soft); }
.pct--red { color: var(--red); }

.tl-entry__kebab { margin-left: auto; }

.tasks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 220px));
  gap: 14px;
  margin-top: 22px;
}

.task-card {
  display: block;
  background: var(--surface);
  padding: 14px 16px 16px;
  border-bottom: 3px solid var(--green-ring);
  color: inherit;
  text-decoration: none;
  transition: box-shadow .15s;
}

a.task-card:hover { box-shadow: 0 4px 16px rgba(20, 24, 30, .12); }

.task-card--fail { border-bottom-color: var(--red); }
.task-card--warn { border-bottom-color: var(--orange-soft); }

.task-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.task-card__meta .sep { width: 1px; height: 13px; background: var(--line); }

.task-card__meta .res { margin-left: auto; font-weight: 700; }

.task-card__meta .res--green { color: var(--green); }
.task-card__meta .res--orange { color: var(--orange-soft); }

.task-card__meta svg { width: 17px; height: 17px; margin-left: auto; }

.task-card__meta .ico-ok { color: var(--green-ring); }
.task-card__meta .ico-fail { color: var(--red); }

.task-card__name { font-size: 14.5px; line-height: 1.4; color: var(--ink); }

/* =====================================================
   Placeholder stránky
   ===================================================== */

.placeholder {
  padding: 80px 40px;
  text-align: center;
  color: var(--ink-soft);
}

.placeholder h2 { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }

/* =====================================================
   Animace při načtení
   ===================================================== */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.main > * { animation: rise .4s ease-out backwards; }

.main > *:nth-child(1) { animation-delay: .02s; }
.main > *:nth-child(2) { animation-delay: .07s; }
.main > *:nth-child(3) { animation-delay: .12s; }
.main > *:nth-child(4) { animation-delay: .17s; }
.main > *:nth-child(5) { animation-delay: .22s; }

@media (prefers-reduced-motion: reduce) {
  .main > * { animation: none; }
}
