/* Komponente */

/* ---------- Kartica ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 18px;
  min-width: 0;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

/* ---------- Labele i naslovi ---------- */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--accent-text);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.page-header > div { min-width: 0; }

.page-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Dugmad ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-btn);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease);
  user-select: none;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-btn-active);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn--primary {
  color: #fff;
  background: var(--primary-bg);
  border-color: var(--primary-border);
  box-shadow: var(--primary-shadow);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.btn--primary:hover { filter: brightness(1.04); }

.btn--primary:active {
  transform: translateY(2px);
  box-shadow: var(--primary-shadow-active);
}

.btn--block { width: 100%; }
.btn--lg { min-height: 54px; font-size: 16px; font-weight: 700; }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-muted);
}

.btn--ghost:active { box-shadow: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  color: var(--text-muted);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-btn:hover { color: var(--text); }

.icon-btn:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-btn-active);
}

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ---------- Polja ---------- */
.field { display: grid; gap: 8px; }

.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: var(--r-input);
  border: 1px solid var(--border-strong);
  background: var(--well);
  box-shadow: var(--well-shadow);
  font-size: 16px;
  color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.input::placeholder { color: #9a8d7d; }

.input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--well-shadow), 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.input[aria-invalid='true'] { border-color: var(--danger); }

.input--code {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.input--pin {
  text-align: center;
  letter-spacing: 0.4em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.field__error {
  min-height: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--danger);
}

/* ---------- Empty state ---------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--well);
  box-shadow: var(--well-shadow);
  color: var(--accent-text);
}

.empty__icon .icon { width: 26px; height: 26px; }

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

.empty__text {
  max-width: 34ch;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Skeleton ---------- */
.skeleton {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton-a) 0%, var(--skeleton-b) 50%, var(--skeleton-a) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s var(--ease) infinite;
}

.skeleton--line { height: 12px; }
.skeleton--title { height: 18px; width: 55%; }
.skeleton--label { height: 10px; width: 28%; }

.skeleton-card { display: grid; gap: 12px; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------- Staggered ulaz ---------- */
.stagger > * {
  opacity: 0;
  animation: rise 360ms var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Admin pill ---------- */
.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  font-size: 13px;
  font-weight: 700;
  color: var(--green-text);
  white-space: nowrap;
}

.admin-pill:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-btn-active);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18), 0 0 8px rgba(16, 185, 129, 0.8);
}

/* ---------- Bottom pill nav (< 1024px) ---------- */
.bottom-nav {
  position: fixed;
  /* 5 stavki × min 56px: na 320px bočni razmak 12.8px */
  left: clamp(10px, 4vw, 20px);
  right: clamp(10px, 4vw, 20px);
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 20;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(5, minmax(56px, 1fr));
  padding: 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-nav);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 44px;
  border-radius: 26px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.nav-item .icon { width: 22px; height: 22px; transition: filter var(--dur) var(--ease); }

.nav-item[aria-current='page'] {
  color: var(--accent-text);
  font-weight: 700;
}

.nav-item[aria-current='page'] .icon {
  color: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
}

/* ---------- Sidebar (≥ 1024px) ---------- */
.sidebar {
  position: sticky;
  top: 0;
  flex-direction: column;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 24px) 16px calc(env(safe-area-inset-bottom) + 20px);
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #efe7db 100%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-btn);
  color: var(--blue);
}

.brand__name { font-size: 17px; font-weight: 800; letter-spacing: var(--tracking-tight); }

.side-nav { display: grid; gap: 4px; }

.side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.side-item:hover { color: var(--text); background: rgba(120, 90, 50, 0.05); }

.side-item[aria-current='page'] {
  color: var(--accent-text);
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.side-item[aria-current='page'] .icon { color: var(--accent); }

.sidebar__footer {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.side-item--button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.side-admin-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-text);
}

/* Desktop: sidebar umesto bottom nav-a; header akcije samo na mobilnom */
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .mobile-only { display: none !important; }
}

/* ---------- Ulaz ---------- */
.entry {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 32px) 20px calc(env(safe-area-inset-bottom) + 88px);
}

.entry__inner {
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 28px;
  text-align: center;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto;
  border-radius: 26px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, #ffffff 0%, #f3ece2 55%, #e9e0d3 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(120, 90, 50, 0.08), 0 3px 0 rgba(120, 90, 50, 0.12),
    0 16px 32px rgba(120, 90, 50, 0.16);
  color: var(--blue);
}

.app-icon .icon { width: 46px; height: 46px; stroke-width: 1.8; filter: drop-shadow(0 1px 0 #fff); }

.entry__title { font-size: 30px; font-weight: 800; margin-top: 18px; }

.entry__subtitle {
  margin: 8px auto 0;
  max-width: 30ch;
  color: var(--text-muted);
  font-size: 15px;
}

.entry__form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.entry__lock {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
}

/* ---------- Modal / bottom sheet ---------- */
.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.modal::backdrop {
  background: rgba(42, 36, 29, 0.32);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.modal[open] { display: flex; }

.modal__panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 18px;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  background: var(--surface-solid);
  box-shadow: var(--shadow-nav);
  animation: sheet-up 260ms var(--ease);
}

.modal__grip {
  justify-self: center;
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--border-strong);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal__title { font-size: 20px; font-weight: 800; }
.modal__text { color: var(--text-muted); font-size: 14px; }

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: none; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@media (min-width: 640px) {
  .modal__panel {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(400px, calc(100% - 40px));
    padding: 24px;
    border-radius: var(--r-card);
    border-bottom: 1px solid var(--border-strong);
    transform: translate(-50%, -50%);
    animation: pop-in 220ms var(--ease);
  }

  .modal__grip { display: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--nav-h) + 14px + env(safe-area-inset-bottom));
  z-index: 50;
  /* translate (ne transform): rise animacija koristi transform */
  translate: -50% 0;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  text-align: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-card);
  font-size: 14px;
  font-weight: 600;
  animation: rise 220ms var(--ease);
  transition: opacity var(--dur) var(--ease);
}

.toast--error { color: var(--danger); border-color: #f1c4bf; }
.toast--out { opacity: 0; }

@media (min-width: 1024px) {
  .toast { bottom: calc(24px + env(safe-area-inset-bottom)); left: calc(50% + var(--sidebar-w) / 2); }
}

/* =====================================================================
   Faza 2: Raspored i Početna
   ===================================================================== */

/* ---------- Badge, chip, tačka predmeta ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--predavanje { background: #ece4fb; color: #5b21b6; }
.badge--vezbe { background: #dcf2e7; color: #065f46; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: inset 0 1px 2px rgba(120, 90, 50, 0.1);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.subject-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--subject, var(--violet));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--subject, var(--violet)) 16%, transparent);
}

.subject-link {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.subject-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.now-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f1ebfd;
  border: 1px solid #d9cbf8;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.now-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
  animation: pulse 1.8s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Kontrole rasporeda ---------- */
.sched-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 18px;
}

.sched-controls > * { min-width: 0; }

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--well);
  box-shadow: var(--well-shadow);
}

.segmented__btn {
  min-height: 44px;
  min-width: 84px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.segmented__btn[aria-pressed='true'] {
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f3 100%);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(120, 90, 50, 0.1), 0 3px 8px rgba(120, 90, 50, 0.1);
  color: var(--violet-text);
  font-weight: 700;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-btn-active);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.chip-btn[aria-pressed='true'] {
  background: #f1ebfd;
  border-color: #d9cbf8;
  color: #5b21b6;
  box-shadow: none;
}

/* ---------- Birač dana ---------- */
.week-note {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.day-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
}

.day-btn {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  min-width: 0;
  height: 52px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-btn-active);
  color: var(--text-muted);
  line-height: 1.15;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.day-btn__name { font-size: 12px; font-weight: 600; }
.day-btn__num { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.day-btn[aria-current='date']::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
}

.day-btn[aria-pressed='true'] {
  background: linear-gradient(180deg, #8b5cf6, #7c3aed);
  border-color: #6d28d9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 0 #6d28d9, 0 6px 14px rgba(124, 58, 237, 0.25);
  color: rgba(255, 255, 255, 0.85);
}

.day-btn[aria-pressed='true'] .day-btn__num { color: #fff; }
.day-btn[aria-pressed='true'][aria-current='date']::after { background: #fff; }

/* ---------- Kartica termina ---------- */
.slot-list {
  display: grid;
  gap: 10px;
}

.slot {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
}

.slot__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.slot__top .badge { margin-left: auto; }

.slot__time {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.slot__subject {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.slot__subject .subject-dot { margin-top: calc(0.65em - 4px); }

.slot__teacher {
  font-size: 13px;
  color: var(--text-muted);
}

.slot__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.slot__note {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-strong);
  font-size: 13px;
}

.slot__note summary {
  display: flex;
  align-items: center;
  min-height: 32px;
  font-weight: 600;
  color: var(--violet-text);
  cursor: pointer;
}

.slot__note p {
  margin-top: 4px;
  color: var(--text-muted);
  white-space: pre-line;
}

.slot__note-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--well);
  color: var(--violet-text);
}

.slot__note-icon .icon { width: 14px; height: 14px; }

.slot--now {
  border-color: #d9cbf8;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 3px rgba(124, 58, 237, 0.1), 0 8px 24px rgba(124, 58, 237, 0.16);
}

.slot--past { opacity: 0.55; }

/* Stagger animacija završava sa opacity 1; prošli termini zadržavaju 0.55 */
.stagger > .slot--past { animation-name: rise-past; }

@keyframes rise-past {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 0.55; transform: none; }
}

/* translate umesto transform: stagger animacija (fill forwards) drži transform */
.slot { transition: translate var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }

@media (hover: hover) {
  .slot.card--interactive:hover { transform: none; translate: 0 -2px; box-shadow: var(--shadow-card-hover); }
  .slot--now.card--interactive:hover {
    box-shadow: inset 0 1px 0 #fff, 0 0 0 3px rgba(124, 58, 237, 0.12), 0 14px 28px rgba(124, 58, 237, 0.18);
  }
}

/* Kompaktna kartica (nedeljni prikaz) */
.slot--compact {
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
}

.slot--compact .slot__time { font-size: 13px; }
.slot--compact .slot__subject { font-size: 14px; gap: 8px; }
.slot--compact .slot__teacher { font-size: 12px; }
.slot--compact .slot__chips { gap: 4px; }
.slot--compact .chip { padding: 2px 8px; font-size: 11px; }
.slot--compact .badge { padding: 1px 8px; font-size: 11px; }

/* ---------- Slobodan termin ---------- */
.free-gap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}

.free-gap::before,
.free-gap::after {
  content: '';
  flex: 1;
  min-width: 8px;
  border-top: 1.5px dashed #ecd9ad;
}

.free-gap__pill {
  padding: 4px 11px;
  border-radius: 999px;
  background: #fff3d6;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hidden-note {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Nedeljni prikaz ---------- */
.week {
  display: grid;
  gap: 22px;
}

.week-day { min-width: 0; }

.week-day__head {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5; /* ispod bottom nav-a (20) */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 calc(-1 * var(--gutter)) 10px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.week-day__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
}

.week-day__date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}

.week-day__count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.today-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.week-day__list {
  display: grid;
  gap: 8px;
}

.week-day__empty {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--border-strong);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

@media (min-width: 1024px) {
  .week {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
  }

  .week-day {
    padding: 0 6px 8px;
    border-radius: var(--r-card);
  }

  .week-day--today {
    background: color-mix(in srgb, var(--violet) 4%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 12%, transparent);
  }

  .week-day__head {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin: 0 0 10px;
    padding: 12px 6px 10px;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .week-day__title { font-size: 15px; flex-wrap: wrap; gap: 4px 8px; }

  .week-day .free-gap { gap: 6px; }
  .week-day .free-gap__pill { padding: 3px 8px; font-size: 11px; }
}

/* ---------- Početna ---------- */
.group-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
}

.group-prompt__text { min-width: 0; }
.group-prompt__title { font-size: 16px; font-weight: 700; }
.group-prompt__hint { font-size: 13px; color: var(--text-muted); }

.group-prompt__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'exam' 'classes' 'news';
  gap: 14px;
}

.home-grid > * { min-width: 0; }
.home-grid__exam { grid-area: exam; }
.home-grid__classes { grid-area: classes; }
.home-grid__news { grid-area: news; }

@media (min-width: 1024px) {
  .home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    grid-template-areas:
      'exam classes classes'
      'news classes classes';
    gap: 16px;
    align-items: start;
  }
}

/* Sledeći ispit */
.exam-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(160deg, #fff8ea 0%, #fcecc9 100%);
  border-color: #f0d9a8;
}

.exam-card--empty {
  display: grid;
  gap: 4px;
  background: var(--surface);
  border-color: var(--border);
}

.exam-card__main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.exam-card__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--amber-text);
}

.exam-card--empty .exam-card__label { color: var(--text-muted); }

.exam-card__title {
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.exam-card__meta {
  font-size: 13px;
  color: #7c5a2c;
}

.exam-card--empty .exam-card__meta { color: var(--text-muted); }

.exam-card__room { margin-top: 4px; }
.exam-card .chip { background: rgba(255, 255, 255, 0.6); color: #92400e; }

.exam-count {
  flex: 0 0 86px;
  display: grid;
  place-content: center;
  justify-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #fff6e2 100%);
  border: 1px solid #f0d9a8;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 rgba(180, 83, 9, 0.12), 0 8px 18px rgba(180, 83, 9, 0.14);
  color: var(--amber-text);
  line-height: 1;
}

.exam-count__num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}

.exam-count__unit {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
}

.exam-count__word {
  font-size: 16px;
  font-weight: 800;
}

/* Časovi */
.classes-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px 10px;
}

.classes-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -6px;
}

.classes-card__title { font-size: 18px; font-weight: 800; }

.classes-card__empty {
  padding: 12px 0 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.class-rows {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.class-row {
  display: grid;
  grid-template-columns: 8px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
  margin: 0 -10px;
  border-radius: 10px;
  font-size: 14px;
}

.class-row + .class-row { box-shadow: 0 -1px 0 var(--border); }

.class-row__time {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.class-row__name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}

.class-row__name .subject-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-row__room {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.class-row--now {
  background: #f1ebfd;
  box-shadow: inset 0 0 0 1px #d9cbf8 !important;
}

.class-row--now + .class-row { box-shadow: none; }
.class-row--past { opacity: 0.55; }

.classes-card__more {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
}

@media (max-width: 1023.98px) {
  .class-row--extra { display: none; }
}

/* Uski ekran: naziv predmeta u drugi red */
@media (max-width: 400px) {
  .class-row {
    grid-template-columns: 8px minmax(0, 1fr) auto;
    row-gap: 2px;
  }

  .class-row .subject-dot { grid-row: 1; }
  .class-row__time { grid-column: 2; grid-row: 1; }
  .class-row__room { grid-column: 3; grid-row: 1; }
  .class-row__name { grid-column: 2 / -1; grid-row: 2; }
}

@media (min-width: 1024px) {
  .classes-card { padding: 18px 20px 12px; }
  .classes-card__more { display: none; }
  .class-row__name .subject-link { white-space: normal; }
}

/* Obaveštenja */
.news {
  display: grid;
  gap: 10px;
}

.news .section-label { color: var(--blue-text); }

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

.news-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
}

.news-card__title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.news-card__pin {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--blue);
}

.news-card__pin .icon { width: 16px; height: 16px; }

.news-card__body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-size: 14px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.news-card__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.news-empty {
  padding: 18px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* =====================================================================
   Faza 3: Predmeti i nastavnici
   ===================================================================== */

.chip--teal {
  background: var(--teal-tint);
  color: var(--teal-text);
  box-shadow: inset 0 0 0 1px var(--teal-border);
}

.btn--sm { min-height: 44px; padding: 0 12px; font-size: 14px; gap: 6px; }
.btn--sm .icon { width: 17px; height: 17px; }

/* ---------- Lista predmeta ---------- */
.subject-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .subject-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.subject-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 22px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  /* translate umesto transform: stagger animacija drži transform */
  transition: translate var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.subject-card::before,
.subject-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--r-card) var(--r-card) 0 0;
  background: var(--subject);
}

@media (hover: hover) {
  .subject-card.card--interactive:hover { transform: none; translate: 0 -2px; box-shadow: var(--shadow-card-hover); }
}

.subject-card:focus-visible { outline-offset: 3px; }

.subject-card__name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.subject-card__name > span:last-child { min-width: 0; overflow-wrap: anywhere; }

.subject-card__teachers {
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.subject-card__foot {
  display: flex;
  min-height: 24px;
  margin-top: auto;
  padding-top: 8px;
}

.subject-card__chip-skeleton {
  width: 150px;
  height: 22px;
  border-radius: 999px;
}

/* ---------- Stranica predmeta ---------- */
.subject-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
}

.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.subject-hero {
  position: relative;
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
  padding: 24px 20px 20px;
  overflow: hidden;
}

.subject-hero__title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
}

.subject-hero__title > span:last-child { min-width: 0; overflow-wrap: anywhere; }

.subject-hero__meta {
  font-size: 14px;
  color: var(--text-muted);
}

.subject-dot--lg {
  flex-basis: 12px;
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--subject, var(--violet)) 16%, transparent);
}

/* Mobilni: jedna kolona, napomene na kraju; ≥ 1024px: dve kolone 3fr / 2fr */
.subject-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.subject-col { display: contents; }
.subject-layout [data-notes-section] { order: 1; }

@media (min-width: 1024px) {
  .subject-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
  }

  .subject-col {
    display: grid;
    gap: 24px;
    align-content: start;
    min-width: 0;
  }

  .subject-layout [data-notes-section] { order: 0; }
}

.subject-section { display: grid; gap: 10px; min-width: 0; }

.subject-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}

.group-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  text-decoration: none;
}

.group-link:hover .chip { box-shadow: inset 0 0 0 1px var(--teal); }

/* ---------- Kartica nastavnika ---------- */
.teacher-list { display: grid; gap: 14px; }

.teacher-card__head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--subject, var(--teal)) 15%, transparent);
  color: var(--subject, var(--teal));
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.teacher-card__id { min-width: 0; }

.teacher-card__name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.teacher-card__position {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}

.teacher-card__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.teacher-card__empty {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 399.98px) {
  .teacher-card__edit { width: 44px; padding: 0; }
  .teacher-card__edit span { display: none; }
}

.contact-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.contact-row:last-child { border-bottom: 0; padding-bottom: 0; }

.contact-row__icon {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--teal-tint);
  color: var(--teal-text);
}

.contact-row__icon .icon { width: 17px; height: 17px; }

.contact-row__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.contact-row__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.contact-row__line { font-variant-numeric: tabular-nums; }

.contact-link {
  display: block;
  padding: 6px 0;
  font-weight: 600;
  color: var(--teal-text);
  text-decoration: none;
}

.contact-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.contact-row__action {
  position: relative;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--teal-border);
  background: var(--teal-tint);
  color: var(--teal-text);
  font-size: 13px;
  font-weight: 600;
  transition: translate var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

/* Touch target 44×44 */
.contact-row__action::before {
  content: '';
  position: absolute;
  inset: -5px -2px;
}

.contact-row__action:hover { background: #d6eef3; }
.contact-row__action:active { translate: 0 1px; }

/* ---------- Forme (admin) ---------- */
.teacher-form,
.notes-form { display: grid; gap: 12px; }

.teacher-form__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.input--sm { min-height: 44px; }

.textarea {
  min-height: 120px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.teacher-form .field__error:empty,
.notes-form .field__error:empty { display: none; }

/* ---------- Termini ---------- */
.term-card { padding-block: 4px; }

.term-day { padding: 12px 0; }
.term-day + .term-day { border-top: 1px solid var(--border); }

.term-day__name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.term-rows {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.term-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-height: 30px;
}

.term-row__time {
  min-width: 92px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.term-row__room { font-size: 13px; color: var(--text-muted); }

/* ---------- Ispiti / fajlovi ---------- */
.item-list {
  margin: 0;
  padding: 4px 18px;
  list-style: none;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
}

.item-row + .item-row { border-top: 1px solid var(--border); }

.item-row__icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--teal-tint);
  color: var(--teal-text);
}

.item-row__icon--exam { background: #fdf0d8; color: var(--amber-text); }
.item-row__icon .icon { width: 18px; height: 18px; }

.item-row__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.item-row__title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.item-row__meta { font-size: 13px; color: var(--text-muted); }

.mini-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.mini-empty__icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--well);
  box-shadow: var(--well-shadow);
  color: var(--accent-text);
}

.mini-empty__icon .icon { width: 18px; height: 18px; }

/* ---------- Napomene ---------- */
.notes__text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.notes__empty { color: var(--text-muted); }

/* =====================================================================
   Faza 4: Ispiti i obaveštenja
   ===================================================================== */

html.scroll-locked { overflow: hidden; }

/* ---------- Sheet (bottom sheet / modal 520px) ---------- */
.sheet .modal__panel {
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet__body { display: grid; gap: 16px; min-width: 0; }

@media (min-width: 640px) {
  .sheet .modal__panel {
    width: min(520px, calc(100% - 40px));
    max-height: calc(100dvh - 48px);
  }
}

.sheet-form { display: grid; gap: 14px; min-width: 0; }
.sheet-form .field { gap: 6px; min-width: 0; }
.sheet-form .field__error { min-height: 0; }
.sheet-form .field__error:empty { display: none; }

.field__optional { font-weight: 400; color: var(--text-muted); }

.form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
}

/* Datum / vreme: iOS inače širi polje preko kontejnera */
.input[type='date'],
.input[type='time'] {
  display: block;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  line-height: 50px;
}

.input[type='date']::-webkit-date-and-time-value,
.input[type='time']::-webkit-date-and-time-value { text-align: left; }

.select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2375695b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  text-overflow: ellipsis;
}

.segmented--full { display: grid; width: 100%; }
.segmented--full .segmented__btn { min-width: 0; padding: 0 8px; }
.sheet--exam .segmented__btn[aria-pressed='true'] { color: var(--amber-text); }

.textarea--tall { min-height: 160px; }

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.check input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--amber);
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch__track {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--well);
  box-shadow: var(--well-shadow);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 0 rgba(120, 90, 50, 0.2), 0 2px 6px rgba(120, 90, 50, 0.2);
  transition: translate var(--dur) var(--ease);
}

.switch input:checked + .switch__track { background: var(--blue); border-color: var(--blue-text); }
.switch input:checked + .switch__track .switch__thumb { translate: 20px 0; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--blue); outline-offset: 2px; }

.btn--danger { color: var(--danger); }

/* ---------- Detalji ispita ---------- */
.exam-detail { display: grid; gap: 14px; min-width: 0; }

.exam-detail__subject {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.exam-detail__subject:hover > span:nth-child(2) { text-decoration: underline; text-underline-offset: 3px; }
.exam-detail__subject > span:last-child { color: var(--amber-text); }

.detail-list {
  display: grid;
  margin: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--well);
  box-shadow: var(--well-shadow);
}

.detail-list__row { display: grid; gap: 2px; padding: 10px 14px; min-width: 0; }
.detail-list__row + .detail-list__row { border-top: 1px solid var(--border); }

.detail-list dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
}

.detail-list dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }

.pre { white-space: pre-line; }

.exam-detail__by { font-size: 13px; color: var(--text-muted); }

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

.sheet__admin {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ---------- Kartica ispita ---------- */
.exam-list { display: grid; gap: 10px; min-width: 0; }

@media (min-width: 1024px) {
  .exams-page .exam-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}

.exam-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: translate var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

@media (hover: hover) {
  .exam-item:not(.exam-item--skeleton):hover {
    translate: 0 -2px;
    box-shadow: var(--shadow-card-hover);
  }
}

.exam-item--nearest {
  background: linear-gradient(160deg, #fff8ea 0%, #fcecc9 100%);
  border-color: #f0d9a8;
}

.exam-item--skeleton { cursor: default; }
.exam-item--skeleton .exam-item__main { gap: 10px; }

.date-tile {
  display: grid;
  place-content: center;
  justify-items: center;
  flex: 0 0 50px;
  width: 50px;
  height: 54px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: inset 0 -2px 0 rgba(120, 90, 50, 0.1), 0 1px 0 rgba(120, 90, 50, 0.06);
  line-height: 1;
}

.date-tile__month {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.date-tile--soon .date-tile__month { color: var(--amber-text); }

.date-tile__day {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}

.exam-item__main {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.exam-item__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

/* Dugme u naslovu pokriva celu karticu (::after) */
.exam-item__open,
.exam-card__open {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.exam-item__open::after,
.exam-card__open::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-card);
}

.exam-item__open:focus-visible,
.exam-card__open:focus-visible { outline: none; }

.exam-item__open:focus-visible::after,
.exam-card__open:focus-visible::after { outline: 2px solid var(--blue); outline-offset: 2px; }

.exam-item__meta { font-size: 13px; color: var(--text-muted); }

.exam-item__note {
  overflow: hidden;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.exam-item--nearest .exam-item__meta,
.exam-item--nearest .exam-item__note { color: #7c5a2c; }

.count-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.count-badge--urgent { background: #fdecea; color: #b42318; box-shadow: inset 0 0 0 1px #f6cfca; }

.count-badge--soon {
  background: linear-gradient(180deg, #f8b13c 0%, #e8890b 100%);
  color: #3b2104;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 0 #b8690a;
}

.count-badge--later { background: #efe8de; color: #4a4036; box-shadow: inset 0 1px 2px rgba(120, 90, 50, 0.16); }

.exam-item--compact { gap: 12px; padding: 10px 12px; }
.exam-item--compact .date-tile { height: 48px; }
.exam-item--compact .exam-item__title { font-size: 14px; }

/* ---------- Filteri ---------- */
.exam-filters { display: grid; gap: 8px; margin-bottom: 18px; min-width: 0; }

.exams-page .chip-btn[aria-pressed='true'] {
  background: linear-gradient(160deg, #fff8ea 0%, #fcecc9 100%);
  border-color: #f0d9a8;
  color: var(--amber-text);
}

/* Predmeti: horizontalni skrol samo unutar reda */
.chip-scroll {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip-btn { flex-shrink: 0; }

/* ---------- Završeno ---------- */
.exams-done {
  margin-top: 18px;
  padding: 0 14px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-card);
}

.exams-done[open] { padding-bottom: 14px; }

.exams-done__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  list-style: none;
  cursor: pointer;
}

.exams-done__summary::-webkit-details-marker { display: none; }

.exams-done__summary::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: -45deg;
  transition: rotate var(--dur) var(--ease);
}

.exams-done[open] .exams-done__summary::before { rotate: 45deg; }
.exams-done .exam-item { opacity: 0.6; }

/* ---------- FAB ---------- */
.has-fab { padding-bottom: 76px; }

.fab {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(22px + var(--nav-h) + 16px + env(safe-area-inset-bottom));
  z-index: 19;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: translate var(--dur) var(--ease), box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease);
}

.fab .icon { width: 26px; height: 26px; stroke-width: 2.4; }

.fab--amber {
  background: linear-gradient(180deg, #f8b13c 0%, #e8890b 100%);
  border-color: #c9740a;
  color: #3b2104;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 3px 0 #b8690a, 0 12px 24px rgba(232, 137, 11, 0.35);
}

.fab--blue {
  background: var(--primary-bg);
  border-color: var(--primary-border);
  color: #fff;
  box-shadow: var(--primary-shadow);
}

@media (hover: hover) {
  .fab:hover { translate: 0 -2px; filter: brightness(1.04); }
}

.fab:active { translate: 0 2px; }
.fab--amber:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 0 #b8690a; }
.fab--blue:active { box-shadow: var(--primary-shadow-active); }

@media (min-width: 1024px) {
  .fab { right: calc(32px + env(safe-area-inset-right)); bottom: calc(32px + env(safe-area-inset-bottom)); }
}

/* ---------- Početna: klik na "Sledeći ispit", link na sva obaveštenja ---------- */
.exam-card--clickable {
  position: relative;
  cursor: pointer;
  transition: translate var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

@media (hover: hover) {
  .exam-card--clickable:hover { translate: 0 -2px; box-shadow: var(--shadow-card-hover); }
}

.news__all { justify-self: start; gap: 5px; color: var(--blue-text); }

.count-dot {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 3px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 1px 0 var(--blue-text);
}

/* ---------- Obaveštenja ---------- */
.news-page__title { margin-bottom: 18px; }

.ann-list { display: grid; gap: 12px; max-width: 760px; }

.ann-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  transition: translate var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

@media (hover: hover) {
  .ann-card:hover { translate: 0 -2px; box-shadow: var(--shadow-card-hover); }
}

.ann-card--pinned {
  background: linear-gradient(160deg, #f5f8ff 0%, #ebf1fd 100%);
  border-color: #cddcf7;
}

.ann-card__title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.ann-card__title > span:not([class]) { min-width: 0; }

.ann-card__pin { display: inline-grid; place-items: center; margin-top: 1px; color: var(--blue); }
.ann-card__pin .icon { width: 16px; height: 16px; }

.new-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.ann-card__body { font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }

.ann-link {
  color: var(--blue-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.ann-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.chip--blue {
  padding: 1px 8px;
  font-size: 11px;
  background: #ebf1fd;
  color: var(--blue-text);
  box-shadow: inset 0 0 0 1px #cddcf7;
}

.ann-card__admin {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: 6px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ann-card__admin .btn { min-width: 0; padding: 0 10px; }

@media (max-width: 399.98px) {
  .ann-card__admin { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ann-card__admin .btn { padding: 0 6px; gap: 4px; font-size: 13px; }
  .ann-card__admin .btn .icon { width: 15px; height: 15px; }
}

.btn--pinned { color: var(--blue-text); border-color: #cddcf7; background: #f5f8ff; }

.load-more { display: flex; justify-content: center; max-width: 760px; margin-top: 16px; }

/* =====================================================================
   Faza 5: Fajlovi
   ===================================================================== */

/* ---------- Header ---------- */
.files-header__actions { flex-direction: column; align-items: flex-end; gap: 4px; }
.files-usage { font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }

/* ---------- Pretraga i filteri ---------- */
.files-tools { display: grid; gap: 10px; margin-bottom: 18px; min-width: 0; }

.search { position: relative; min-width: 0; }

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  color: var(--text-muted);
  pointer-events: none;
}

.search__input { padding: 0 48px 0 44px; -webkit-appearance: none; appearance: none; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__input:focus { border-color: var(--green); box-shadow: var(--well-shadow), 0 0 0 3px rgba(16, 185, 129, 0.2); }

.search__clear {
  position: absolute;
  right: 4px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
}

.search__clear[hidden] { display: none; }
.search__clear .icon { width: 18px; height: 18px; }
.search__clear:hover { color: var(--text); }

.files-page .chip-btn[aria-pressed='true'] {
  background: var(--green-tint);
  border-color: var(--green-border);
  color: var(--green-text);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 44px;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--green-border);
  background: var(--green-tint);
  color: var(--green-text);
  font-size: 13px;
  font-weight: 700;
}

.filter-chip > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.filter-chip .icon { width: 16px; height: 16px; stroke-width: 2.2; }

/* ---------- Bento predmeta ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

@media (min-width: 1024px) {
  .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
}

.bento-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  min-height: 84px;
  padding: 14px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: translate var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

div.bento-card { cursor: default; }
.bento-card--hero { grid-column: span 2; background: var(--green-tint); border-color: var(--green-border); }

@media (hover: hover) {
  button.bento-card:hover { translate: 0 -2px; box-shadow: var(--shadow-card-hover); }
}

.bento-card[aria-pressed='true'] { border-color: var(--green); box-shadow: var(--shadow-card), 0 0 0 2px var(--green); }

.bento-card__name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.bento-card__name > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.bento-card__meta { font-size: 12px; color: var(--text-muted); }
.bento-card--hero .bento-card__meta { color: #2f6b52; }

/* ---------- Lista ---------- */
.files-section { min-width: 0; }
.files-section__head { margin-bottom: 10px; }
.files-page .section-label { color: var(--green-text); }

.file-list { display: grid; gap: 8px; min-width: 0; }

.file-tile {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #efe8de;
  color: #4a4036;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}

.file-tile--pdf { background: #fdecea; color: #b42318; }
.file-tile--ppt { background: #fef1e4; color: #b54708; }
.file-tile--doc { background: #e8f0fe; color: #1d4ed8; }
.file-tile--xls { background: #e3f6ec; color: #047857; }
.file-tile--img { background: #f1ebfd; color: #5b21b6; }
.file-tile--zip,
.file-tile--other { background: #efe8de; color: #4a4036; }

.file-tile--lg { flex-basis: 72px; width: 72px; height: 72px; border-radius: 16px; font-size: 16px; }

.file-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 8px 10px 14px;
  cursor: pointer;
  transition: translate var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

@media (hover: hover) {
  .file-row:not(.file-row--skeleton):hover { translate: 0 -2px; box-shadow: var(--shadow-card-hover); }
}

.file-row--skeleton { cursor: default; padding-right: 14px; }
.file-row--skeleton .file-row__main { gap: 8px; }

.file-row__main { flex: 1; display: grid; gap: 1px; min-width: 0; }

.file-row__name { min-width: 0; font-size: 14px; font-weight: 600; letter-spacing: 0; line-height: 1.35; }

.file-row__open {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* Ceo red je klikabilan (::after), dugmad desno su iznad */
.file-row__open::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-card); }
.file-row__open:focus-visible { outline: none; }
.file-row__open:focus-visible::after { outline: 2px solid var(--blue); outline-offset: 2px; }

.file-row__meta,
.file-row__desc {
  overflow: hidden;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-row__desc { color: #5f5446; }

.file-row__btn {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.file-row__btn:hover { color: var(--green-text); background: var(--well); }
.file-row__btn[aria-expanded='true'] { color: var(--green-text); background: var(--well); box-shadow: var(--well-shadow); }

.file-list--compact .file-row { min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.files-all { justify-self: start; margin-top: 2px; color: var(--green-text); }
.subject-section--files { --accent-text: var(--green-text); }

/* ---------- Admin meni (⋯) ---------- */
.file-menu {
  position: fixed;
  z-index: 40;
  display: grid;
  min-width: 210px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-nav);
  animation: rise 160ms var(--ease);
}

.file-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
}

.file-menu__item .icon { width: 18px; height: 18px; color: var(--text-muted); }
.file-menu__item:hover,
.file-menu__item:focus-visible { background: var(--well); outline: none; }
.file-menu__item--danger,
.file-menu__item--danger .icon { color: var(--danger); }

/* ---------- Zeleno dugme / FAB ---------- */
.btn--green {
  background: linear-gradient(180deg, #22c58e 0%, #059669 100%);
  border-color: #047857;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 3px 0 #047857, 0 10px 22px rgba(5, 150, 105, 0.28);
}

.btn--green:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 0 #047857; }

.fab--green {
  background: linear-gradient(180deg, #22c58e 0%, #059669 100%);
  border-color: #047857;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 3px 0 #047857, 0 12px 24px rgba(5, 150, 105, 0.35);
}

.fab--green:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 0 #047857; }

/* ---------- Pregled ---------- */
.preview {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--text);
  animation: sheet-up 240ms var(--ease);
}

.preview::backdrop { background: transparent; }

.preview__panel { display: flex; flex-direction: column; height: 100%; min-width: 0; }

.preview__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 60px;
  padding: calc(8px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 8px calc(6px + env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: var(--surface-solid);
}

.preview__back { flex-shrink: 0; gap: 6px; padding: 0 10px; color: var(--text); }

.preview__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.preview__dl { flex-shrink: 0; color: var(--green-text); }
.preview__x { display: none; }

.preview__body {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  padding: 16px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.preview__stage { display: grid; gap: 10px; min-width: 0; }

/* PDF zauzima visinu ispod trake (dugme "Otvori u novom tabu" ispod) */
.preview__frame,
.preview__loading {
  display: block;
  width: 100%;
  height: calc(100dvh - 60px - 32px - 64px - env(safe-area-inset-top));
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.preview__img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 60px - 140px - env(safe-area-inset-top));
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--well);
}

.preview-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 20px;
  text-align: center;
}

.preview-card__name { margin-top: 6px; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.preview-card__meta { font-size: 13px; color: var(--text-muted); }
.preview-card__note { margin-bottom: 8px; font-size: 13px; color: var(--text-muted); }

.preview__info { display: grid; gap: 6px; min-width: 0; }

.preview__subject {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.preview__subject > span:last-child { color: var(--green-text); }
.preview__subject:hover > span:nth-child(2) { text-decoration: underline; text-underline-offset: 3px; }
.preview__by { font-size: 13px; color: var(--text-muted); }
.preview__desc { font-size: 14px; overflow-wrap: anywhere; }

/* Desktop: desni panel; lista ostaje vidljiva levo (main se sužava), sidebar se ne pokriva */
@media (min-width: 1024px) {
  :root { --preview-w: min(520px, calc((100% - var(--sidebar-w)) / 2)); }

  .preview--docked {
    left: auto;
    right: 0;
    width: var(--preview-w);
    border-left: 1px solid var(--border-strong);
    background: var(--surface-solid);
    box-shadow: -14px 0 34px rgba(120, 90, 50, 0.16);
    animation: panel-in 220ms var(--ease);
  }

  .preview--docked .preview__back { display: none; }
  .preview--docked .preview__x { display: inline-grid; }
  .preview--docked .preview__bar { padding: 10px 12px 10px 18px; }
  .preview--docked .preview__body { padding: 18px; }
  .preview--docked .preview__frame,
  .preview--docked .preview__loading { height: calc(100dvh - 60px - 36px - 64px - 110px); }
  .preview--docked .preview__img { max-height: calc(100dvh - 60px - 180px); }

  html.preview-docked .main { padding-right: calc(var(--preview-w) + 32px); }
  html.preview-docked .fab { right: calc(var(--preview-w) + 32px); }
  html.preview-docked .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Upload ---------- */
.sheet--files .check input { accent-color: var(--green); }
.sheet--files .input:focus { border-color: var(--green); box-shadow: var(--well-shadow), 0 0 0 3px rgba(16, 185, 129, 0.2); }

.drop-zone {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 20px 16px;
  border: 2px dashed var(--green-border);
  border-radius: var(--r-card);
  background: var(--surface-solid);
  text-align: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.drop-zone:hover,
.drop-zone.is-over { background: var(--green-tint); border-color: var(--green); }
.drop-zone:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }

.drop-zone__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--green-tint);
  color: var(--green-text);
  box-shadow: inset 0 0 0 1px var(--green-border);
}

.drop-zone__text { font-size: 15px; font-weight: 700; }
.drop-zone__text u { color: var(--green-text); text-underline-offset: 3px; }
.drop-zone__hint { font-size: 12px; color: var(--text-muted); }

.up-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.up-list:empty { display: none; }

.up-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 10px 6px 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.up-item .file-tile { margin-top: 3px; }
.up-item--invalid { border-color: #f1c4bf; background: #fffafa; }
.up-item--done { border-color: var(--green-border); }

.up-item__main { flex: 1; display: grid; gap: 4px; min-width: 0; }
.up-item__static { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.up-item__meta { font-size: 12px; color: var(--text-muted); }
.up-item__error { font-size: 13px; font-weight: 600; color: var(--danger); }
.up-item__remove { flex-shrink: 0; border-color: transparent; background: transparent; box-shadow: none; }
.up-item__remove[hidden] { display: none; }

.up-item__status { display: flex; align-items: center; gap: 10px; }
.up-item__status[hidden],
.up-item__fail[hidden] { display: none; }
.up-item__pct { min-width: 44px; font-size: 12px; font-weight: 700; color: var(--green-text); font-variant-numeric: tabular-nums; text-align: right; }
.up-item__fail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.up-progress {
  flex: 1;
  min-width: 0;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--well);
  box-shadow: var(--well-shadow);
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

.up-progress::-webkit-progress-bar { background: var(--well); box-shadow: var(--well-shadow); border-radius: 999px; }
.up-progress::-webkit-progress-value { background: linear-gradient(90deg, #22c58e, #059669); border-radius: 999px; transition: width 120ms linear; }
.up-progress::-moz-progress-bar { background: linear-gradient(90deg, #22c58e, #059669); border-radius: 999px; }

.name-input { position: relative; display: flex; align-items: center; min-width: 0; }
.name-input .input { padding-right: 64px; }

.name-input__ext {
  position: absolute;
  right: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.name-input--sm .input { padding-right: 56px; }
.name-input--sm .input:disabled { opacity: 1; padding-left: 0; border-color: transparent; background: transparent; box-shadow: none; }

/* =====================================================================
   Faza 6: Super-admin panel i ručna izmena rasporeda
   ===================================================================== */

/* ---------- Header ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -10px 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover { color: var(--blue-text); }

.admin-eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--blue-text);
}

/* ---------- Mreža kartica ---------- */
.admin-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
  grid-template-areas: 'invite' 'admins' 'log' 'danger';
}

.admin-card { display: grid; gap: 14px; min-width: 0; align-content: start; }
.admin-card--invite { grid-area: invite; }
.admin-card--admins { grid-area: admins; }
.admin-card--log { grid-area: log; }
.admin-card--danger { grid-area: danger; border-color: #f5c2bd; }

@media (min-width: 1024px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: 'invite log' 'admins log' 'danger log';
    align-items: start;
  }
}

.admin-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-card__title { font-size: 17px; font-weight: 700; }
.admin-card--danger .admin-card__title { color: var(--danger); }

.admin-skeleton { display: grid; gap: 12px; padding: 4px 0; }
.admin-skeleton .skeleton:nth-child(2n) { width: 70%; }

.admin-empty,
.admin-error { font-size: 14px; color: var(--text-muted); }
.admin-error { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--danger); }

/* ---------- Pozivni kod ---------- */
[data-role='invite'] { display: grid; gap: 6px; justify-items: start; }
.invite-set { font-size: 15px; font-weight: 600; }
.invite-joins { margin-bottom: 8px; font-size: 14px; color: var(--text-muted); }
.invite-joins strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Admini ---------- */
.admin-list { display: grid; gap: 4px; margin: 0 -8px; padding: 0; list-style: none; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 12px;
  transition: background-color var(--dur) var(--ease), translate var(--dur) var(--ease);
}

@media (hover: hover) {
  .admin-row:hover { background: var(--well); translate: 0 -2px; }
}

.admin-row__open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 56px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.admin-row__open:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 10px; }

.admin-row__text { display: grid; min-width: 0; }

.admin-row__name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-row__meta { font-size: 12px; color: var(--text-muted); }

.admin-row__state {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-text);
}

.admin-row--off .admin-row__name,
.admin-row--off .admin-row__state { color: var(--text-muted); }

@media (max-width: 399.98px) {
  .admin-row__state { display: none; }
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 6px rgba(120, 90, 50, 0.18);
}

.avatar--0 { background: linear-gradient(160deg, #4d8ef7, #2563eb); }
.avatar--1 { background: linear-gradient(160deg, #a77bf3, #7c3aed); }
.avatar--2 { background: linear-gradient(160deg, #34d399, #059669); }
.avatar--3 { background: linear-gradient(160deg, #fbbf24, #d97706); }
.admin-row--off .avatar { background: linear-gradient(160deg, #d6cec2, #b3a898); }

/* ---------- Prekidač ---------- */
.toggle {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e4ddd2;
  box-shadow: inset 0 2px 4px rgba(120, 90, 50, 0.22);
  cursor: pointer;
  transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Touch target 44×44 */
.toggle::before { content: ''; position: absolute; inset: -9px 0; }

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(120, 90, 50, 0.25);
  transition: translate 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle[aria-checked='true'] {
  background: #10b981;
  box-shadow: inset 0 2px 4px rgba(4, 95, 70, 0.4);
}

.toggle[aria-checked='true']::after { translate: 18px 0; }
.toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- Log ---------- */
.log-filters { display: grid; gap: 8px; min-width: 0; }

.admin-page .chip-btn[aria-pressed='true'] {
  background: #e8f0fe;
  border-color: #bfd3fb;
  color: var(--blue-text);
}

.log-list { margin: 0; padding: 0; list-style: none; }

.log-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}

.log-row + .log-row { border-top: 1px solid var(--border); }
.log-row__main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.log-row__text { font-size: 14px; overflow-wrap: anywhere; }
.log-row__text strong { font-weight: 600; }
.log-row__fields { font-size: 12px; color: var(--text-muted); }

.log-row__time {
  flex-shrink: 0;
  padding-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.log-more { margin-top: 6px; }

/* ---------- Opasna zona ---------- */
.danger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.danger-row > div { flex: 1 1 220px; min-width: 0; }
.danger-row__title { font-size: 14px; font-weight: 600; }
.danger-row__text { font-size: 13px; color: var(--text-muted); }

.btn--destructive {
  color: var(--danger);
  background: #fdecea;
  border-color: #f5c2bd;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 rgba(180, 35, 24, 0.12);
}

.btn--destructive:hover { background: #fbdcd8; }

/* ---------- Sheet-ovi panela ---------- */
.sheet--admin .check input { accent-color: var(--blue); }

.field__hint { font-size: 12px; color: var(--text-muted); }

.code-row { display: flex; gap: 8px; min-width: 0; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { flex-shrink: 0; min-height: 52px; }

.warn-box {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f5c2bd;
  background: #fdecea;
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
}

.secret { display: grid; gap: 12px; min-width: 0; }
.secret__label { font-size: 14px; color: var(--text-muted); }
.secret__label strong { color: var(--text); }

.secret__value {
  width: 100%;
  min-width: 0;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid #bfd3fb;
  background: #f1f6ff;
  box-shadow: var(--well-shadow);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-align: center;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.secret__value:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
.secret__note { font-size: 13px; color: var(--text-muted); }

.action-list { display: grid; gap: 4px; }

.action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
}

.action-item .icon { color: var(--text-muted); }
.action-item:hover,
.action-item:focus-visible { background: var(--well); outline: none; }
.action-item--danger,
.action-item--danger .icon { color: var(--danger); }
.action-item--danger:hover { background: #fdecea; }

/* ---------- Raspored: admin ---------- */
.slot__more {
  position: relative;
  width: 32px;
  height: 32px;
  margin: -6px -8px -6px 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.slot__more::before { content: ''; position: absolute; inset: -6px; }
.slot__more:hover,
.slot__more[aria-expanded='true'] { color: var(--violet-text); background: var(--well); }
.slot--compact .slot__more { width: 28px; height: 28px; margin-right: -6px; }
.slot--compact .slot__more .icon { width: 18px; height: 18px; }

.btn--outline-violet {
  background: transparent;
  border: 1.5px solid #c9b6f6;
  box-shadow: none;
  color: var(--violet-text);
}

.btn--outline-violet:hover { background: #f5f0fe; }
.add-slot { width: 100%; margin-top: 12px; }

@media (min-width: 640px) {
  .add-slot { width: auto; }
}

.btn--violet {
  background: linear-gradient(180deg, #9a68f5, #7c3aed);
  border-color: #6d28d9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 3px 0 #6d28d9, 0 10px 22px rgba(124, 58, 237, 0.28);
}

.btn--violet:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 0 #6d28d9; }
.sheet--slot .input:focus { border-color: var(--violet); box-shadow: var(--well-shadow), 0 0 0 3px rgba(124, 58, 237, 0.18); }

/* =====================================================================
   Faza 7b: PWA (offline baner, instalacija, nova verzija)
   ===================================================================== */

/* ---------- Offline baner ---------- */
.net-banner {
  display: none;
  position: sticky;
  top: calc(env(safe-area-inset-top) + 8px);
  z-index: 15;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 14px;
  padding: 7px 14px;
  border: 1px solid #f6dfa6;
  border-radius: var(--r-btn);
  background: #fff3d6;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(146, 64, 14, 0.08);
  animation: rise var(--dur) var(--ease);
}

.net-banner .icon { width: 18px; height: 18px; }
.net-banner span { min-width: 0; }
html.is-offline .net-banner { display: flex; }

.net-banner--float {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  left: calc(16px + env(safe-area-inset-left));
  right: calc(16px + env(safe-area-inset-right));
  z-index: 40;
  justify-content: center;
}

/* Akcije koje traže mrežu (net.js ih onemogućava) */
html.is-offline [data-net-disabled] { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.4); }

/* ---------- Kartica za instalaciju ---------- */
.install-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 14px 14px 16px;
  animation: rise 220ms var(--ease);
}

.install-card__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--border), 0 2px 6px rgba(120, 90, 50, 0.14);
}

.install-card__text { flex: 1; min-width: 0; }
.install-card__title { font-size: 15px; font-weight: 700; letter-spacing: 0; }
.install-card__hint { font-size: 13px; color: var(--text-muted); }
.install-card__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

@media (max-width: 379px) {
  .install-card { flex-wrap: wrap; }
  .install-card__actions { width: 100%; justify-content: flex-end; }
}

/* iOS uputstvo */
.install-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.install-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--well);
}

.install-step__num {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.install-step__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--r-btn);
  background: var(--surface-solid);
  box-shadow: var(--shadow-btn);
  color: var(--blue-text);
}

.install-step__icon .icon { width: 22px; height: 22px; }
.install-step__text { min-width: 0; font-size: 15px; }

/* ---------- Toast nove verzije ---------- */
.toast--action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 16px;
  text-align: left;
  white-space: nowrap;
}

.toast__btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--primary-border);
  border-radius: var(--r-pill);
  background: var(--primary-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transition: filter var(--dur) var(--ease);
}

.toast__btn:hover { filter: brightness(1.05); }
.toast__btn:disabled { opacity: 0.7; }

/* Obična poruka dok je toast nove verzije vidljiv: iznad njega */
.toast--action ~ .toast:not(.toast--action) { translate: -50% -56px; }
