:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --border: #dbe1e8;
  --text: #1b2430;
  --text-muted: #64748b;
  --accent: #1e3a5f;
  --accent-2: #2563eb;
  --danger: #dc2626;
  --danger-bg: #fde8e8;
  --success: #16a34a;
  --warn: #d97706;
  --shadow: 0 4px 16px rgba(20, 30, 50, 0.10);
  --radius: 10px;
  --today-bg: #fff7e0;
  --surface-rgb: 255, 255, 255;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1620;
  --surface: #182333;
  --surface-2: #1f2c3f;
  --border: #2c3b4f;
  --text: #e7edf5;
  --text-muted: #93a3b8;
  --accent: #6fa3d8;
  --accent-2: #4c8dee;
  --danger: #f87171;
  --danger-bg: #3a1f21;
  --success: #4ade80;
  --warn: #fbbf24;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  --today-bg: #2a2412;
  --surface-rgb: 24, 35, 51;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Varovalka: stran se nikoli ne sme dati vodoravno podrgniti/drseti kot
     celota (npr. če bi kak element pomotoma presegel širino zaslona) - vsak
     vodoravno drseč del (dnevi na mobilnem, tabela na namizju) ima svoj
     lasten "overflow-x: auto" znotraj sebe. */
  overflow-x: hidden;
}

body { min-height: 100vh; }

/* OZADJE - brez pik (uporabniku niso bile všeč) - samo mehak preliv iz
   obstoječih barv namesto povsem ravne podlage. */
body {
  background-color: var(--bg);
  background-image: linear-gradient(160deg, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0) 50%);
  background-size: 100% 420px;
  background-repeat: no-repeat;
}
:root[data-theme="dark"] body {
  background-image: linear-gradient(160deg, rgba(111, 163, 216, 0.16) 0%, rgba(111, 163, 216, 0) 50%);
  background-size: 100% 420px;
  background-repeat: no-repeat;
}

button { font-family: inherit; }

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
}

/* Velika "hero" kartica z ikono/naslovom (levo) in uporabniškim menijem +
   akcijami (desno) - preliv iz obstoječih barv (accent/accent-2), enako
   kot prej naslovni "pill", le v večjem, bolj poudarjenem formatu. */
.topbar-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 130%);
  box-shadow: 0 10px 24px rgba(20, 30, 50, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
}
:root[data-theme="dark"] .topbar-hero {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.topbar-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar-hero-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar-hero-text { min-width: 0; }
.topbar-hero-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
}
.topbar-hero-sub {
  margin: 1px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}
.topbar-hero-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hero-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.hero-icon-btn:hover { background: rgba(255, 255, 255, 0.32); }
.hero-icon-btn:active { transform: scale(0.92); }
.topbar-hero .current-user-btn {
  background: rgba(255, 255, 255, 0.22);
  border: none;
  color: #fff;
}
.topbar-hero .current-user-btn:hover { background: rgba(255, 255, 255, 0.32); }
.topbar-hero .user-menu-caret { color: rgba(255, 255, 255, 0.85); }

.topbar-week {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

.week-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.week-strip-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.week-strip-btn:hover { background: var(--surface-2); }
.week-strip-btn:active { transform: scale(0.96); }
.week-strip-btn.active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 130%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(20, 30, 50, 0.3);
  cursor: default;
}

.week-today-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.week-today-btn:hover { background: var(--surface-2); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 18px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.icon-btn:active { transform: scale(0.92); }

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn-icon { margin-right: 6px; }
.btn-primary {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface-2); }
.btn-danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { filter: brightness(1.05); }

.conn-status {
  text-align: center;
  font-size: 13px;
  padding: 6px;
  background: var(--warn);
  color: #1b2430;
}

/* GRID */
main { padding: 14px; }
.grid-wrap { overflow-x: auto; }

/* Namizna tabela je zdaj (tako kot mobilni prikaz) zaokrožena "kartica" z
   mehko senco na svetli/temni podlagi namesto ostro obrobljene tabele -
   enoten, mehkejši videz v celi aplikaciji. */
.schedule-grid {
  display: grid;
  min-width: 900px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.grid-row {
  display: contents;
}

.grid-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  min-height: 92px;
  background: var(--surface);
}

.grid-cell.head {
  /* Brez polne sivo obarvane "pasice" - glava zdaj zliva s kartico, imena
     dni pa so ločena od (bledega) datuma pod njimi - enak vzorec kot
     dnevne "pilulke" na mobilnem prikazu. */
  background: var(--surface);
  text-align: center;
  padding: 10px 6px;
  min-height: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.25;
  /* Opomba: ni "position: sticky" na navpični osi - .grid-wrap zaradi
     overflow-x:auto postane samostojen scroll-container tudi na Y osi
     (CSS spec), kar bi sticky top potisnilo navzdol in prekrivalo vrstice
     spodaj. Levi "sticky" (ime ekipe, kotna celica) ostaja - to je
     vodoravno drsenje znotraj iste vrstice in deluje pravilno. */
  z-index: 5;
}
.grid-head-name { font-size: 13px; font-weight: 700; color: var(--text); }
.grid-head-date { font-size: 12px; color: var(--text-muted); }

/* "Danes" v glavi stolpca - mehka modra "pilulka" (enak vzorec kot izbrani
   dan na mobilnem prikazu), namesto prejšnjega izbočenega "3D" videza. */
.grid-cell.head.today {
  background: rgba(37, 99, 235, 0.12);
  position: relative;
  z-index: 6;
}
:root[data-theme="dark"] .grid-cell.head.today {
  background: rgba(76, 141, 238, 0.22);
}
.grid-cell.head.today .grid-head-name,
.grid-cell.head.today .grid-head-date { color: var(--accent-2); }
.grid-cell.head.today .grid-head-name { font-weight: 800; }

.grid-cell.team-name {
  /* Ozadje po ekipah nastavi JS (mehak pastelen odtenek barve ekipe -
     glej softColor() v app.js), zato je tu samo nevtralen privzeti izgled. */
  background: var(--surface);
  color: #1b2430;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: unset;
  position: sticky;
  left: 0;
  z-index: 4;
}

.corner-cell {
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 6;
  min-height: unset;
}

/* "Danes" na namizni tabeli - tanka modra poudarjena črta na vrhu celice
   (nadaljevanje poudarka iz glave stolpca), namesto prejšnjega izbočenega
   "3D" videza (senca + svetla obroba). */
.grid-cell.day-cell.today {
  position: relative;
  z-index: 2;
  box-shadow: inset 0 2px 0 var(--accent-2);
}

.day-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.add-assignment-btn {
  /* Privzeto (namizna tabela): celica ima vedno svetel pastelen odtenek
     ekipe ne glede na temo (glej rowTint v app.js), zato lahko uporabimo
     enak "ghost" videz (črtkan obris + modro besedilo) kot na mobilnih
     karticah - proti svetli podlagi vedno dovolj kontrasten. */
  border: 1px dashed rgba(37, 99, 235, 0.35);
  background: rgba(255, 255, 255, 0.5);
  color: var(--accent-2);
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.add-assignment-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--accent-2);
  box-shadow: none;
}
.add-assignment-btn:active { transform: scale(0.97); }
/* Mobilna kartica: podlaga je zdaj enotna var(--surface) (svetla ALI
   temna, glede na temo), zato tu namesto trdo kodirane bele uporabimo
   temo-neodvisne žetone - črtkan obris + modro besedilo, kot "ghost"
   gumb za dodajanje. */
.add-assignment-btn-block {
  border: 1px dashed var(--border);
  background: var(--bg);
  color: var(--accent-2);
}
.add-assignment-btn-block:hover {
  background: var(--surface-2);
  border-color: var(--accent-2);
  color: var(--accent-2);
  box-shadow: none;
}

.assignment-chip {
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #10141c;
  border-left: 4px solid transparent;
  background: var(--surface-2);
  line-height: 1.35;
}
.assignment-chip:hover { filter: brightness(0.97); }
:root[data-theme="dark"] .assignment-chip { color: #10141c; }
.assignment-chip .chip-project { font-weight: 700; display: block; }
.assignment-chip .chip-location { display: block; opacity: 0.85; }

.assignment-chip.status-koncano { opacity: 0.6; text-decoration: line-through; }
.assignment-chip.status-odpovedano { opacity: 0.55; text-decoration: line-through; }
.assignment-chip.status-v-teku { box-shadow: inset 0 0 0 2px rgba(37,99,235,0.35); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.modal-small { max-width: 360px; }
.modal-wide { max-width: 720px; }

.modal-header-actions { display: flex; align-items: center; gap: 4px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 16px; }

.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.modal-footer .spacer { flex: 1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}
.field input, .field select, .field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.field select { cursor: pointer; }
/* Barva možnosti v razširjenem spustnem seznamu - podprto v večini
   brskalnikov na osnovi Chromiuma (ne povsod, npr. Firefox/Safari to
   večinoma ignorirata in uporabita sistemski izgled - v redu, gre le za
   dodatno polepšavo, ne za nujno potrebno funkcionalnost). */
.field select option { background: var(--surface); color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  background: var(--surface);
}
.teams-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.team-row input[type="text"] {
  flex: 1;
  border: 1px solid transparent;
  background: none;
  color: var(--text);
  font-size: 14px;
  padding: 4px;
  border-radius: 6px;
}
.team-row input[type="text"]:focus { border-color: var(--border); background: var(--surface-2); }

.team-add-row { display: flex; gap: 8px; align-items: center; }
.team-add-row input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.team-add-row input[type="color"] {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  background: var(--surface);
}

/* ZGODOVINA EKIPE (klik na ime ekipe v tabeli, samo supervisor) */
.team-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.team-history-filters input[type="text"],
.team-history-filters select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.team-history-filters input[type="text"] { flex: 1; min-width: 160px; }
.team-history-period { display: flex; gap: 6px; }
.team-history-period button {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.team-history-period button:hover { background: var(--surface-2); }
.team-history-period button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.team-history-daterange {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}
.team-history-daterange input[type="date"] {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.team-history-summary:not(:empty) {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.team-history-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.team-history-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.team-history-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
}

/* Navodila (modalHelp) - kratek, prilagojen pregled pravic glede na vlogo */
.help-role { margin: 0 0 12px; font-size: 14px; color: var(--text); }
.help-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
.help-list li { padding-left: 2px; }

.team-history-table-wrap { overflow-x: auto; }
.team-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.team-history-table th, .team-history-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.team-history-table th { color: var(--text-muted); font-weight: 600; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 100;
  box-shadow: var(--shadow);
}

/* AUTH SCREEN */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-box {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-box h1 {
  margin: 0;
  font-size: 20px;
  color: var(--accent);
  text-align: center;
}
.auth-sub {
  margin: 0 0 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.auth-submit { margin-top: 6px; }
.auth-link {
  background: none;
  border: none;
  color: var(--accent-2);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  text-align: center;
}
.auth-link:hover { text-decoration: underline; }
.auth-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.user-menu {
  position: relative;
  margin-right: 4px;
}
.current-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  max-width: 160px;
}
.current-user-btn:hover { background: var(--border); }
.current-user {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-caret {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 30;
}
.user-menu-item {
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.user-menu-item:hover { background: var(--surface-2); }
.user-menu-item-danger { color: var(--danger); }

/* INSTALL BANNER (PWA "Dodaj na domači zaslon") */
.install-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--accent);
  color: #fff;
  font-size: 13px;
}
.install-banner-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.install-banner-text { flex: 1; line-height: 1.35; }
.install-banner .btn-small { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.install-banner .icon-btn { color: #fff; flex-shrink: 0; }
.install-banner .icon-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* MOBILNI PRIKAZ: privzeto skrit, prikazan samo na ozkih zaslonih (glej
   media query spodaj), kjer nadomesti vodoravno drsečo tabelo z izbiro
   enega dneva + navpičnim seznamom kartic po ekipah - veliko bolj berljivo
   in dostopno na telefonu kot vodoravno drsenje. */
.mobile-day-view { display: none; }

/* Bela kartica okoli dnevnih "pilulk" (namesto da bi te ležale prosto na
   ozadju strani) - da vrstica izbire dneva izstopa kot lasten, jasno omejen
   element vmesnika. */
.day-pills-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 6px;
}
.day-pills {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.day-pill {
  flex: 1 0 auto;
  border: none;
  background: none;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.25;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, background 0.15s ease;
}
.day-pill:active { transform: scale(0.96); }
.day-pill-name { font-size: 13px; font-weight: 700; }
.day-pill-date { font-size: 12px; color: var(--text-muted); }
.day-pill.today .day-pill-name { color: var(--accent-2); }
/* Izbrani dan: mehka, bledo modra "pilulka" (ne polna nasičena barva) +
   majhna pika pod njim, ki nakazuje izbiro - manj vpadljivo kot prej, a še
   vedno jasno razločljivo. */
.day-pill.active {
  background: rgba(37, 99, 235, 0.12);
}
:root[data-theme="dark"] .day-pill.active {
  background: rgba(76, 141, 238, 0.22);
}
.day-pill.active .day-pill-name,
.day-pill.active .day-pill-date { color: var(--accent-2); }
.day-pill.active::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}

.mobile-teams-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.team-card {
  /* Levi obarvani rob (barva ekipe) nastavi JS - kartica sama pa je
     enotno bela/temna (var(--surface)), brez pastelnega barvanja celotne
     podlage, za bolj umirjen, "čist" videz. */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.team-card:active { transform: scale(0.995); }
.team-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.team-card-name { font-weight: 700; font-size: 16px; color: var(--text); }
/* Gumb "⋮" na kartici ekipe - bližnjica do urejanja ekip (isto okno kot
   "Uredi ekipe" v uporabniškem meniju), viden samo supervisorjem. Klik
   ustavi razširjanje (stopPropagation v app.js), da ne sproži tudi klika
   na ime (ki odpre zgodovino te ekipe). */
.team-card-menu-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.team-card-menu-btn:hover { background: var(--surface-2); }
.team-card-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.team-card-chips .assignment-chip { font-size: 13px; padding: 8px 10px; }
.team-card-empty {
  display: flex;
  align-items: center;
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-style: normal;
}
.add-assignment-btn-block {
  margin-top: 6px;
  padding: 8px;
  font-size: 13px;
}

/* RESPONSIVE: pod 720px pokažemo mobilni prikaz (dan + kartice) namesto
   namizne tabele, ki bi zahtevala vodoravno drsenje. */
@media (max-width: 720px) {
  main { padding: 10px; }
  .grid-wrap { display: none; }
  .mobile-day-view { display: block; }

  /* Tiskanje s telefona je itak redko potrebno (ostane na voljo na
     računalniku), zato ga na ozkem zaslonu skrijemo. */
  #btnPrint { display: none; }
  .current-user { max-width: 90px; font-size: 11px; }
  .topbar { padding: 8px 10px; gap: 8px; }
  .topbar-hero { padding: 10px 12px; border-radius: 16px; }
  .topbar-hero-icon { width: 30px; height: 30px; }
  .topbar-hero-title { font-size: 14px; }
  .topbar-hero-sub { font-size: 11px; }

  /* Teden-trak (5 gumbov "Teden N") na ozkem zaslonu morda ne gre vsi v
     širino - namesto da bi ga silili v širino in razpotegnili stran (kar bi
     povzročilo vodoravno drsenje cele strani), naj se sam vodoravno drsi
     znotraj svoje vrstice, gumb "Danes" pa ostane vedno viden/na mestu. */
  .week-strip {
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  .week-strip::-webkit-scrollbar { display: none; }
  .week-strip-btn { padding: 6px 11px; flex-shrink: 0; }
  .week-today-btn { flex-shrink: 0; padding: 5px 9px; font-size: 12px; }
  .week-nav-arrow { flex-shrink: 0; width: 26px; height: 26px; font-size: 16px; }
}

/* Se ozji zasloni (majhni telefoni) - dodatno skrčimo ime uporabnika */
@media (max-width: 380px) {
  .current-user { max-width: 50px; }
}

/* PRINT */
@media print {
  .topbar, .conn-status, .toast, .auth-screen, .install-banner, .mobile-day-view { display: none !important; }
  .grid-wrap { display: block !important; }
  body { background: #fff; color: #000; }
  .schedule-grid { min-width: 0; box-shadow: none; }
  .grid-cell.head, .corner-cell, .grid-cell.team-name { position: static; background: #eee !important; }
  main { padding: 0; }
}

/* Tiskanje zgodovine ekipe - sproženo z gumbom v modalu (glej app.js), ki
   pred window.print() doda body.print-team-history. Natisniti želimo SAMO
   vsebino tega modala (celoten seznam, ne le tisto, kar je vidno na
   zaslonu), zato med tiskanjem skrijemo ves ostali app + tedensko tabelo,
   modal pa "sprostimo" iz fiksnega/na-sredino-poravnanega prekritja v
   navaden potek strani, da se natisne cel (dolg) seznam, ne le en zaslon. */
@media print {
  body.print-team-history .topbar,
  body.print-team-history .conn-status,
  body.print-team-history .toast,
  body.print-team-history .grid-wrap,
  body.print-team-history .mobile-day-view,
  body.print-team-history #modalTeams,
  body.print-team-history #modalAssignment,
  body.print-team-history #modalConfirm { display: none !important; }

  body.print-team-history #modalTeamHistory {
    position: static;
    inset: auto;
    background: none;
    padding: 0;
    display: block;
  }
  body.print-team-history #modalTeamHistory .modal {
    position: static;
    max-width: none;
    max-height: none;
    box-shadow: none;
    background: #fff;
    color: #000;
  }
  body.print-team-history #modalTeamHistory .modal-body { overflow: visible; }
  body.print-team-history #modalTeamHistory .team-history-filters,
  body.print-team-history #modalTeamHistory .modal-header-actions,
  body.print-team-history #modalTeamHistory .modal-footer { display: none !important; }
  body.print-team-history #modalTeamHistory .team-history-table th,
  body.print-team-history #modalTeamHistory .team-history-table td { color: #000; }
}
