/* TV ploča v2: tamna tema, čitljivo s 3-5 m. 1rem = 20px na 1920x1080. */
:root {
  --bg: #121211;
  --surface: #1b1b19;
  --surface-2: #232320;
  --line: rgba(255, 255, 255, 0.07);
  --text: #f1efe9;
  --muted: #9a978f;
  --red: #e5675c;
  --red-bg: rgba(229, 103, 92, 0.13);
  --amber: #e3a93f;
  --amber-bg: rgba(227, 169, 63, 0.13);
  --green: #6fbf8a;
  --green-bg: rgba(111, 191, 138, 0.12);
  --blue: #7fb2e5;
  --sans: "Segoe UI Variable Display", "Segoe UI", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: min(calc(100vh / 54), calc(100vw / 96)); }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; cursor: none;
  -webkit-font-smoothing: antialiased;
}
.top { display: flex; justify-content: space-between; align-items: flex-end; padding: 2.2rem 3.2rem 1.4rem; border-bottom: 1px solid var(--line); }
.title { font-size: 1.3rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.slide-name { font-size: 3.4rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; margin-top: 0.3rem; }
.status { display: flex; align-items: flex-end; gap: 2rem; }
.clock { text-align: right; }
.time { font-family: var(--mono); font-size: 3.4rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.date { font-size: 1.3rem; color: var(--muted); margin-top: 0.5rem; }
.badge { font-size: 1.1rem; padding: 0.4rem 0.9rem; border-radius: 0.4rem; background: var(--amber-bg); color: var(--amber); font-weight: 600; }

.stage { position: relative; padding: 2rem 3.2rem; overflow: hidden; }
.slide { position: absolute; inset: 2rem 3.2rem; opacity: 0; transition: opacity 0.6s ease; }
.slide.on { opacity: 1; }

.bottom { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; padding: 1.2rem 3.2rem 1.8rem; }
.dots { display: flex; gap: 0.6rem; }
.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--surface-2); }
.dot.on { background: var(--text); }
.progress { height: 0.25rem; background: var(--surface-2); border-radius: 1rem; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--muted); }
.updated { font-size: 1rem; color: var(--muted); }

/* Rokovi */
.summary { display: flex; gap: 1.2rem; margin-bottom: 1.2rem; }
.chip { display: flex; align-items: baseline; gap: 0.8rem; padding: 0.8rem 1.4rem; border-radius: 0.6rem; background: var(--surface); }
.chip b { font-size: 2.4rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.chip span { font-size: 1.3rem; color: var(--muted); }
.chip.red b { color: var(--red); } .chip.amber b { color: var(--amber); }
.dl { display: flex; flex-direction: column; gap: 0.7rem; }
.dl-row {
  display: grid; grid-template-columns: 0.5rem 1fr auto 13rem; align-items: center; gap: 1.6rem;
  background: var(--surface); border-radius: 0.6rem; padding: 0 1.6rem 0 0; min-height: 5.1rem; overflow: hidden;
}
.dl-row .flag { align-self: stretch; }
.dl-row.red .flag { background: var(--red); } .dl-row.amber .flag { background: var(--amber); } .dl-row.green .flag { background: var(--green); }
.dl-name { font-size: 2.1rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-meta { font-size: 1.25rem; color: var(--muted); margin-top: 0.25rem; }
.dl-meta .hi { color: var(--red); font-weight: 600; }
.dl-date { font-family: var(--mono); font-size: 1.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cd { justify-self: end; font-size: 1.6rem; font-weight: 650; padding: 0.5rem 1rem; border-radius: 0.4rem; white-space: nowrap; }
.red .cd { background: var(--red-bg); color: var(--red); }
.amber .cd { background: var(--amber-bg); color: var(--amber); }
.green .cd { background: var(--green-bg); color: var(--green); }
.more { font-size: 1.3rem; color: var(--muted); margin-top: 0.7rem; }

/* Tjedan */
.week { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; height: 100%; }
.day { background: var(--surface); border-radius: 0.6rem; padding: 1.4rem; display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.day.today { outline: 2px solid var(--text); outline-offset: -2px; }
.day.past { opacity: 0.55; }
.day h3 { font-size: 1.6rem; font-weight: 650; }
.day h3 small { display: block; font-size: 1.15rem; color: var(--muted); font-weight: 500; margin-top: 0.15rem; }
.task { border-left: 0.35rem solid var(--green); background: var(--surface-2); border-radius: 0.3rem; padding: 0.7rem 0.9rem; }
.task.red { border-color: var(--red); } .task.amber { border-color: var(--amber); }
.task b { display: block; font-size: 1.35rem; font-weight: 600; line-height: 1.25; }
.task span { font-size: 1.1rem; color: var(--muted); }
.empty-day { font-size: 1.2rem; color: var(--muted); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 1.2rem; height: 100%; }
.kpi { background: var(--surface); border-radius: 0.6rem; padding: 2rem 2.2rem; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.kpi .name { font-size: 1.6rem; color: var(--muted); font-weight: 600; }
.kpi .val { font-size: 5.6rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 2.4rem; color: var(--muted); font-weight: 500; margin-left: 0.4rem; }
.kpi .row { display: flex; justify-content: space-between; align-items: center; font-size: 1.4rem; color: var(--muted); }
.meter { height: 0.6rem; background: var(--surface-2); border-radius: 1rem; overflow: hidden; margin: 1rem 0; }
.meter i { display: block; height: 100%; border-radius: 1rem; }
.good { color: var(--green); } .bad { color: var(--red); }
.meter .good { background: var(--green); } .meter .bad { background: var(--amber); }
.delta { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.delta svg { width: 1.3rem; height: 1.3rem; }

/* Tablica */
table.items { width: 100%; border-collapse: separate; border-spacing: 0 0.6rem; font-size: 1.7rem; }
.items th { text-align: left; font-size: 1.15rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 1.4rem; }
.items td { background: var(--surface); padding: 1.1rem 1.4rem; white-space: nowrap; }
.items td:first-child { border-radius: 0.6rem 0 0 0.6rem; font-weight: 600; max-width: 40rem; overflow: hidden; text-overflow: ellipsis; }
.items td:last-child { border-radius: 0 0.6rem 0.6rem 0; }
.items .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pill { font-size: 1.25rem; padding: 0.3rem 0.8rem; border-radius: 0.3rem; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.pill.red { background: var(--red-bg); color: var(--red); } .pill.amber { background: var(--amber-bg); color: var(--amber); }

/* Obavijesti */
.news { display: flex; flex-direction: column; gap: 1.4rem; justify-content: center; height: 100%; }
.note { background: var(--surface); border-radius: 0.6rem; padding: 2.4rem 3rem; border-left: 0.5rem solid var(--blue); }
.note p { font-size: 3.2rem; line-height: 1.3; font-weight: 550; letter-spacing: -0.01em; }
.note.single p { font-size: 4.4rem; }
.note small { display: block; font-size: 1.3rem; color: var(--muted); margin-top: 1rem; }

.empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 2.4rem; text-align: center; line-height: 1.5; }
.empty small { display: block; font-size: 1.4rem; }
