:root {
  --red-900: #4a0e0e; --red-800: #5d1414; --red-700: #7a1a1a;
  --red-600: #9a2424; --red-500: #b83030; --red-100: #f5dede; --red-50: #fbf0f0;
  --ink: #1a1614; --ink-2: #463f3a; --ink-3: #7a716b; --ink-4: #a89e96;
  --paper: #faf7f2; --paper-2: #f3ede4;
  --line: #e3dbd0; --line-2: #d4cabb;
  --gold: #b8860b; --green: #2d6a3f; --green-bg: #e6f0e9;
  --blue: #2c5282; --blue-bg: #ebf0f7;
  --shadow-sm: 0 1px 2px rgba(74,14,14,0.04), 0 1px 1px rgba(74,14,14,0.03);
  --shadow-md: 0 4px 12px rgba(74,14,14,0.06), 0 2px 4px rgba(74,14,14,0.04);
  --shadow-lg: 0 12px 32px rgba(74,14,14,0.10), 0 4px 12px rgba(74,14,14,0.06);
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 20px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body); color: var(--ink); background: var(--paper);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(184,48,48,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(184,134,11,0.03) 0%, transparent 50%);
  background-attachment: fixed; min-height: 100vh;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* HEADER */
header.brand {
  background: linear-gradient(180deg, var(--red-800) 0%, var(--red-700) 100%);
  color: var(--paper); padding: 1.25rem 1.5rem;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-md);
}
.brand-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; }
.brand-logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; letter-spacing: -0.5px;
  color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.brand-logo:hover { text-decoration: none; }
.brand-logo .flame {
  width: 30px; height: 30px;
  background: var(--paper); color: var(--red-700);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--red-800);
}
.brand-sub { font-size: 12px; opacity: 0.85; letter-spacing: 0.4px; text-transform: uppercase; }
.brand-nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.brand-nav a, .brand-nav button {
  color: var(--paper); padding: 6px 12px; font-size: 13px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md); cursor: pointer; font-family: var(--font-body);
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.brand-nav a:hover, .brand-nav button:hover {
  background: rgba(255,255,255,0.18); text-decoration: none;
}
.brand-nav svg { width: 14px; height: 14px; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
@media (min-width: 768px) { .container { padding: 2rem 2rem 4rem; } }

.page-header { margin-bottom: 1.5rem; }
.page-title {
  font-family: var(--font-display); font-weight: 600; font-size: 32px;
  line-height: 1.1; letter-spacing: -0.5px; margin: 0 0 6px;
}
.page-sub { color: var(--ink-3); font-size: 15px; margin: 0; }

/* BREADCRUMBS */
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--red-700); }

/* CARDS */
.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm); margin-bottom: 1rem;
}
@media (min-width: 768px) { .card { padding: 2rem; } }

/* GRIDS */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; gap: 1.25rem; } }

/* FORMS */
.field { margin-bottom: 1rem; }
.field-row {display: grid; gap: 1rem;}
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; } }
.field label {
  display: block; font-size: 12px; font-weight: 500; color: var(--ink-2);
  margin-bottom: 6px; letter-spacing: 0.3px; text-transform: uppercase;
}
.field input[type="text"], .field input[type="date"], .field input[type="number"],
.field input[type="password"], .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line-2);
  border-radius: var(--radius-md); background: var(--paper);
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  transition: all 0.15s; -webkit-appearance: none; appearance: none;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-4); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--red-600); background: #fff;
  box-shadow: 0 0 0 3px rgba(184,48,48,0.12);
}
.field textarea { min-height: 80px; resize: vertical; }
.field-hint { font-size: 11px; color: var(--ink-4); margin-top: 4px; }

.dob-wrap { position: relative; }
.dob-wrap input { padding-right: 44px !important; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.dob-cal-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; background: transparent;
  color: var(--ink-3); cursor: pointer; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.dob-cal-btn:hover { background: var(--paper-2); color: var(--red-700); }
.dob-cal-btn svg { width: 18px; height: 18px; }
.dob-picker-hidden { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* RADIO/CHECK groups */
.choice-group { display: grid; gap: 8px; }
.choice-group.cols-2 { grid-template-columns: 1fr 1fr; }
.choice-group.cols-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 600px) { .choice-group.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.choice-btn {
  padding: 12px; border: 1.5px solid var(--line-2); background: var(--paper);
  border-radius: var(--radius-md); cursor: pointer; font-family: var(--font-body);
  font-size: 14px; color: var(--ink-2); transition: all 0.15s; text-align: center;
  font-weight: 500;
}
.choice-btn:hover { border-color: var(--ink-4); background: #fff; }
.choice-btn.selected {
  border-color: var(--red-700); background: var(--red-50); color: var(--red-800);
}

/* BUTTONS */
.btn {
  padding: 12px 18px; border-radius: var(--radius-md);
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  cursor: pointer; transition: all 0.15s; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-secondary { background: var(--paper); border-color: var(--line-2); color: var(--ink-2); }
.btn-secondary:hover { background: #fff; border-color: var(--ink-4); color: var(--ink); }
.btn-primary {
  background: var(--red-700); color: #fff;
  box-shadow: 0 2px 6px rgba(122,26,26,0.20);
}
.btn-primary:hover { background: var(--red-800); color: #fff; box-shadow: 0 4px 12px rgba(122,26,26,0.30); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-danger { background: transparent; border-color: var(--line-2); color: var(--ink-3); }
.btn-danger:hover { border-color: var(--red-600); color: var(--red-700); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-link { background: transparent; color: var(--red-700); padding: 4px 8px; }
.btn-link:hover { background: var(--red-50); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.form-actions {
  display: flex; gap: 10px; margin-top: 1.5rem;
  padding-top: 1.5rem; border-top: 1px dashed var(--line-2);
}
.form-actions .btn-primary { flex: 1; }

/* MESSAGES */
.msg { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 1rem; }
.msg.success { background: var(--green-bg); color: var(--green); border: 1px solid #b8d4bf; }
.msg.error { background: var(--red-50); color: var(--red-800); border: 1px solid var(--red-100); }
.msg.info { background: var(--blue-bg); color: var(--blue); border: 1px solid #c3d4e9; }

/* TABLES */
table.tbl { width: 100%; border-collapse: collapse; background: #fff; }
table.tbl th, table.tbl td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
table.tbl th {
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.5px; background: var(--paper-2);
}
table.tbl tbody tr:hover { background: var(--paper); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}

/* TAGS / BADGES */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase;
}
.tag-pomladak { background: var(--red-50); color: var(--red-800); }
.tag-mladez { background: #ede4d6; color: var(--gold); }
.tag-m { background: var(--blue-bg); color: var(--blue); }
.tag-z { background: #f5e0e8; color: #a8336b; }
.tag-priprema { background: var(--paper-2); color: var(--ink-2); }
.tag-aktivno { background: var(--green-bg); color: var(--green); }
.tag-zavrseno { background: #e8e3d8; color: var(--ink-3); }

/* EMPTY STATE */
.empty {
  text-align: center; padding: 4rem 1rem; color: var(--ink-3);
}
.empty svg {
  width: 48px; height: 48px; color: var(--ink-4);
  opacity: 0.5; margin-bottom: 12px;
}
.empty-title {
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  color: var(--ink-2); margin: 0 0 6px;
}
.empty-sub { font-size: 14px; margin: 0 0 1.5rem; }

/* CARDS GRID (za listu natjecanja) */
.cards-grid {
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}
@media (min-width: 700px) { .cards-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cards-grid { grid-template-columns: 1fr 1fr 1fr; } }

.nat-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.25rem;
  box-shadow: var(--shadow-sm); transition: all 0.2s;
  display: block; text-decoration: none; color: inherit;
}
.nat-card:hover {
  text-decoration: none; transform: translateY(-2px);
  box-shadow: var(--shadow-md); border-color: var(--line-2);
}
.nat-card .nat-date {
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  color: var(--red-700); text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.nat-card .nat-title {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  line-height: 1.2; margin-bottom: 4px; color: var(--ink);
}
.nat-card .nat-meta { font-size: 13px; color: var(--ink-3); }
.nat-card .nat-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--ink-3);
}
.nat-card .nat-stat {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  color: var(--ink);
}

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,22,20,0.5);
  backdrop-filter: blur(4px); display: none;
  align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  max-width: 460px; width: 100%; box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-wide { max-width: 580px; }
.modal-body { padding: 1.5rem; }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.modal-text { color: var(--ink-3); font-size: 14px; margin: 0 0 1.25rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem 0.5rem;
}
.modal-header h3 {
  font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 0;
}
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 0.75rem 1.5rem 1.25rem;
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
}

/* Reorder rows */
.reorder-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: #fff;
  transition: all 0.15s;
}
.reorder-row:hover { background: var(--paper); }
.reorder-select {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  padding: 8px 10px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  color: var(--red-700);
}
.reorder-select:focus {
  outline: none; border-color: var(--red-600); background: #fff;
  box-shadow: 0 0 0 3px rgba(184,48,48,0.12);
}
.reorder-info .nm { font-weight: 600; font-size: 14px; }
.reorder-info .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* Icon button danger */
.icon-btn-danger:hover {
  color: var(--red-700) !important;
  background: var(--red-50) !important;
}

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.app-footer {
  text-align: center; padding: 2rem 1rem 1rem;
  font-size: 12px; color: var(--ink-4); letter-spacing: 0.3px;
}
.app-footer strong { color: var(--ink-3); font-weight: 600; }
.app-footer a { color: var(--ink-3); }

.hidden { display: none !important; }

/* LOGIN */
.login-wrap {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xl);
  padding: 2.5rem 2rem; max-width: 380px; width: 100%;
  box-shadow: var(--shadow-lg); text-align: center;
}
.login-crest {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(180deg, var(--red-800), var(--red-700));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  margin: 0 auto 1.25rem;
  box-shadow: 0 6px 16px rgba(122,26,26,0.25);
}
.login-title {
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  margin: 0 0 6px;
}
.pin-input {
  width: 100%; padding: 16px; border: 1.5px solid var(--line-2);
  border-radius: var(--radius-md); background: var(--paper);
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  text-align: center; letter-spacing: 8px; color: var(--ink);
  margin-top: 1.5rem;
}
.pin-input:focus {
  outline: none; border-color: var(--red-600); background: #fff;
  box-shadow: 0 0 0 4px rgba(184,48,48,0.12);
}

/* NATJECATELJI tablica */
.nat-row {
  display: grid; grid-template-columns: 40px 1fr auto auto; gap: 12px;
  align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.nat-row:last-child { border-bottom: none; }
.nat-row:hover { background: var(--paper); }
.nat-row.priruva { background: var(--paper-2); }
.nat-row-num {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  color: var(--ink-3); text-align: center;
}
.nat-row.priruva .nat-row-num { color: var(--gold); }
.nat-row-info .nm { font-weight: 600; font-size: 15px; }
.nat-row-info .meta { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.nat-row-age {
  background: var(--paper-2); padding: 4px 10px; border-radius: var(--radius-md);
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--ink); white-space: nowrap;
}
.nat-row-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-4); display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--red-50); color: var(--red-700); }
.icon-btn svg { width: 16px; height: 16px; }

/* MOBILE: 2-red layout, akcije skroz desno na drugom redu */
@media (max-width: 600px) {
  .nat-row {
    grid-template-columns: 36px 1fr auto;
    grid-template-areas:
      "num info actions"
      "num age actions";
    gap: 6px 10px;
    padding: 10px 12px;
  }
  .nat-row-num { grid-area: num; align-self: center; }
  .nat-row-info { grid-area: info; min-width: 0; }
  .nat-row-info .nm { font-size: 14px; word-break: break-word; }
  .nat-row-age {
    grid-area: age; justify-self: start;
    font-size: 12px; padding: 2px 8px;
  }
  .nat-row-actions {
    grid-area: actions; align-self: center;
  }
  .icon-btn {
    width: 38px; height: 38px;  /* veći tap target za prst */
  }
  .icon-btn svg { width: 18px; height: 18px; }
}

/* === ODJELJENJA POPIS (umjesto tablice) === */
.odj-list {
  display: flex; flex-direction: column; gap: 8px;
}
.odj-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-decoration: none; color: var(--ink);
  transition: all 0.15s;
}
.odj-card:hover {
  border-color: var(--red-300, #d4a5a5);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.odj-card-main {
  flex: 1; min-width: 0;
}
.odj-card-dvd {
  font-weight: 700; font-size: 16px;
  letter-spacing: -0.1px;
  word-break: break-word;
}
.odj-card-vzp {
  font-size: 12px; color: var(--ink-3); margin-top: 2px;
}
.odj-card-tags {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; flex-wrap: wrap;
}
.odj-card-count {
  font-size: 12px; color: var(--ink-3);
  font-family: var(--font-display); font-weight: 600;
}
.odj-card-arrow {
  color: var(--ink-4); flex-shrink: 0;
}
.odj-card:hover .odj-card-arrow { color: var(--red-700); }

@media (max-width: 600px) {
  .odj-card { padding: 12px 14px; gap: 8px; }
  .odj-card-dvd { font-size: 15px; }
  .odj-card-tags { gap: 6px; }
  .odj-card-tags .tag { font-size: 10px; padding: 2px 7px; }
}

.summary-bar {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  padding: 1rem; background: var(--paper-2);
  border-radius: var(--radius-md); margin-bottom: 1rem;
  font-size: 14px;
}
.summary-bar > div { display: flex; flex-direction: column; }
.summary-bar .lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.4px; }
.summary-bar .val {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  color: var(--ink);
}

/* ===== BODOVANJE FORMA ===== */
.bod-tabs {
  display: flex; gap: 2px; background: var(--paper-2);
  padding: 4px; border-radius: var(--radius-md); margin-bottom: 1.5rem;
}
.bod-tab {
  flex: 1; padding: 10px 12px; background: transparent;
  border: none; border-radius: 6px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--ink-3); cursor: pointer; transition: all 0.15s;
}
.bod-tab.active { background: #fff; color: var(--red-700); box-shadow: var(--shadow-sm); }
.bod-tab .status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-4); margin-right: 6px; vertical-align: middle;
}
.bod-tab.has-data .status-dot { background: #22c55e; }
.bod-tab.has-disk .status-dot { background: var(--red-600); }

.greska-row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.greska-row:last-child { border-bottom: none; }
.greska-row:hover { background: var(--paper); }
.greska-name { font-size: 14px; }
.greska-bod {
  font-size: 11px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.4px; min-width: 90px; text-align: right;
}
.greska-bod strong { color: var(--red-700); font-size: 13px; }
.greska-input {
  width: 60px; padding: 6px 10px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--paper);
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  text-align: center; color: var(--ink);
}
.greska-input:focus {
  outline: none; border-color: var(--red-600); background: #fff;
  box-shadow: 0 0 0 3px rgba(184,48,48,0.12);
}
.greska-list {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden;
}

.live-bodovi {
  background: var(--paper-2);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center;
}
.live-bodovi .label-big {
  font-size: 13px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 4px;
}
.live-bodovi .formula {
  font-size: 12px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.live-bodovi .formula .minus { color: var(--red-700); }
.live-bodovi .formula .plus { color: var(--green); }
.live-bodovi .total {
  font-family: var(--font-display); font-weight: 700; font-size: 36px;
  color: var(--red-700); font-variant-numeric: tabular-nums; line-height: 1;
}
.live-bodovi.disk { background: var(--red-50); }
.live-bodovi.disk .total { color: var(--red-700); font-size: 22px; }

.autosave-status {
  font-size: 12px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 8px;
}
.autosave-status.saving { color: var(--blue); }
.autosave-status.saved { color: var(--green); }
.autosave-status.error { color: var(--red-700); }

.disk-banner {
  background: var(--red-50); border: 1px solid var(--red-100);
  color: var(--red-800); padding: 12px 16px;
  border-radius: var(--radius-md); margin-bottom: 1rem;
  display: flex; gap: 10px; align-items: center;
}
.disk-banner svg { color: var(--red-700); flex-shrink: 0; }

/* ===== REZULTATI PREGLED ===== */
.rez-row {
  display: grid; grid-template-columns: 40px 1fr auto auto auto;
  gap: 14px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}
.rez-row:last-child { border-bottom: none; }
.rez-row:hover { background: var(--paper); }
.rez-row.disk { background: var(--red-50); }
.rez-row.disk:hover { background: var(--red-100); }
.rez-rank {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  color: var(--ink-3); text-align: center;
}
.rez-rank.gold { color: #b8860b; }
.rez-rank.silver { color: #7a716b; }
.rez-rank.bronze { color: #b87333; }
.rez-info .dvd { font-weight: 600; font-size: 15px; line-height: 1.2; }
.rez-info .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.rez-status {
  display: flex; gap: 4px;
}
.rez-status-dot {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--line-2);
}
.rez-status-dot.done { background: #22c55e; }
.rez-status-dot.disk { background: var(--red-600); }
.rez-bodovi {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--ink); font-variant-numeric: tabular-nums;
  min-width: 80px; text-align: right;
}
.rez-bodovi.gray { color: var(--ink-4); font-size: 14px; }
.rez-bodovi.disk { color: var(--red-700); font-size: 14px; }

.kat-section {
  margin-bottom: 1.5rem;
}
.kat-header {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  color: var(--ink); margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}
.kat-header .count {
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--ink-3); background: var(--paper-2);
  padding: 2px 10px; border-radius: 999px;
}

/* ===== PROJEKCIJSKI MOD (placeholder) ===== */
.projekcija-btn { font-size: 12px; color: var(--ink-3); margin-left: 8px; }

/* ===== JAVNI POREDAK ===== */
.poredak-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.poredak-tab {
  padding: 10px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--line-2); background: var(--paper);
  cursor: pointer; font-family: var(--font-body); font-size: 14px;
  font-weight: 500; color: var(--ink-2); transition: all 0.15s;
}
.poredak-tab:hover { background: #fff; border-color: var(--ink-4); }
.poredak-tab.active {
  background: var(--red-700); border-color: var(--red-700); color: #fff;
}
.poredak-tab .badge {
  background: rgba(255,255,255,0.2); padding: 1px 7px; border-radius: 999px;
  font-size: 11px; margin-left: 4px;
}
.poredak-tab:not(.active) .badge { background: var(--paper-2); color: var(--ink-3); }

/* =================================================================
   SCOREBOARD — javna stranica rezultata
   Live scoreboard stil, krupne brojke, top 3 podium
   ================================================================= */

.scoreboard-header {
  background: linear-gradient(135deg, #4a0e0e 0%, #7a1a1a 50%, #5d1414 100%);
  color: #fff;
  margin: -1.5rem -1.25rem 2rem;
  padding: 2rem 1.5rem 2.5rem;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(74,14,14,0.20);
}
@media (min-width: 768px) {
  .scoreboard-header { margin: -2rem -2rem 2rem; padding: 2.5rem 2rem 3rem; }
}
.scoreboard-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,200,50,0.10) 0%, transparent 50%),
    radial-gradient(circle at 20% 100%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}
.sb-crumbs {
  font-size: 13px; opacity: 0.7; margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.sb-crumbs a { color: #fff; opacity: 0.85; text-decoration: none; }
.sb-crumbs a:hover { opacity: 1; text-decoration: underline; }

.sb-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.8px;
  margin: 0 0 14px;
  position: relative;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
@media (min-width: 768px) {
  .sb-title { font-size: 42px; }
}

.sb-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
  position: relative;
}
.sb-meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  opacity: 0.9;
}
.sb-meta-ico { opacity: 0.7; }
.sb-live {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 5px 12px; border-radius: 999px;
  text-transform: uppercase;
}
.sb-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff4444; box-shadow: 0 0 8px rgba(255,68,68,0.7);
  animation: pulse-live 1.5s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* === TABS === */
.sb-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.sb-tab {
  flex: 1;
  min-width: 130px;
  background: transparent;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  transition: all 0.18s;
  text-align: left;
}
.sb-tab:hover { background: var(--paper-2); }
.sb-tab.active {
  background: linear-gradient(135deg, #7a1a1a 0%, #5d1414 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(122,26,26,0.30);
}
.sb-tab-kat {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.sb-tab.active .sb-tab-kat { color: #fff; }
.sb-tab-kat.kat-pom::before { content: ''; }
.sb-tab-spol {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.sb-tab.active .sb-tab-spol { color: rgba(255,255,255,0.85); }
.sb-tab-count {
  position: absolute;
  top: 8px; right: 12px;
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.sb-tab { position: relative; }
.sb-tab.active .sb-tab-count {
  background: rgba(255,255,255,0.20);
  color: #fff;
}

/* === PANE === */
.sb-pane { display: none; animation: paneIn 0.3s ease-out; }
.sb-pane.active { display: block; }
@keyframes paneIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === PODIUM (TOP 3) === */
.sb-podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 1.5rem;
  align-items: end;
}
@media (max-width: 700px) {
  .sb-podium {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.podium-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  position: relative;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

/* Visine za podium efekt na desktop */
@media (min-width: 700px) {
  .podium-card.rank-1 {
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(-12px);
  }
  .podium-card.rank-2 {
    padding: 1.5rem 1.25rem 1.25rem;
  }
  .podium-card.rank-3 {
    padding: 1.25rem 1.25rem 1.25rem;
  }
}

.podium-card.gold {
  background: linear-gradient(180deg, #fef9e6 0%, #fff 30%);
  border-color: #e9c66a;
  box-shadow: 0 8px 24px rgba(184,134,11,0.18), 0 2px 6px rgba(184,134,11,0.10);
}
.podium-card.gold::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d4a017 0%, #f6d563 50%, #d4a017 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.podium-card.silver {
  background: linear-gradient(180deg, #f5f5f7 0%, #fff 30%);
  border-color: #c8c8d0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.podium-card.silver::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #9ca3af 0%, #d1d5db 50%, #9ca3af 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.podium-card.bronze {
  background: linear-gradient(180deg, #fdf3eb 0%, #fff 30%);
  border-color: #d4a07a;
  box-shadow: 0 4px 16px rgba(180,90,50,0.08);
}
.podium-card.bronze::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #b87333 0%, #d99057 50%, #b87333 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.podium-card.disk {
  opacity: 0.55;
  filter: saturate(0.5);
}

.podium-medal {
  width: 56px; height: 56px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -1px;
  box-shadow: inset 0 -3px 8px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.12);
}
.podium-card.rank-1 .podium-medal {
  width: 68px; height: 68px;
  background: linear-gradient(145deg, #f9d56b 0%, #d4a017 50%, #b8860b 100%);
  color: #fff;
}
.podium-card.rank-1 .podium-medal svg { width: 36px; height: 36px; }
.podium-card.rank-2 .podium-medal {
  background: linear-gradient(145deg, #e5e7eb 0%, #9ca3af 50%, #6b7280 100%);
  color: #fff;
}
.podium-card.rank-3 .podium-medal {
  background: linear-gradient(145deg, #d99057 0%, #b87333 50%, #8b5526 100%);
  color: #fff;
}

.podium-rank-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
}

.podium-dvd {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 2px;
  word-wrap: break-word;
  hyphens: auto;
}
.podium-card.rank-1 .podium-dvd { font-size: 19px; }

.podium-broj {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--paper-2);
  padding: 1px 8px;
  border-radius: 999px;
  margin-top: 4px;
}
.podium-vzp {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
  letter-spacing: 0.2px;
}

.podium-bodovi {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 42px;
  letter-spacing: -1.5px;
  line-height: 1;
  margin: 16px 0 2px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.podium-card.rank-1 .podium-bodovi {
  font-size: 56px;
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 50%, #b8860b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.podium-card.rank-2 .podium-bodovi { font-size: 44px; }
.podium-card.rank-3 .podium-bodovi { font-size: 38px; }

.podium-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.podium-waiting { color: var(--ink-4); font-size: 32px; }
.dsq-mark {
  display: inline-block;
  font-size: 22px;
  color: var(--red-700);
  letter-spacing: 2px;
  font-weight: 700;
  padding: 6px 14px;
  border: 2px solid var(--red-600);
  border-radius: var(--radius-md);
}

.podium-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.podium-stat {
  display: flex; flex-direction: column; align-items: center;
}
.ps-lbl {
  font-size: 9px; font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.ps-val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

/* === LIST (ostali rangovi) === */
.sb-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.sb-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}
.sb-row:last-child { border-bottom: none; }
.sb-row:hover { background: var(--paper); }
.sb-row.disk { opacity: 0.55; }

.sb-row-rank {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--ink-3);
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.sb-row-main { min-width: 0; }
.sb-row-dvd {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sb-row-broj {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--paper-2);
  padding: 1px 7px;
  border-radius: 999px;
}
.sb-row-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.sb-row-stats {
  display: flex;
  gap: 1.25rem;
}
@media (max-width: 700px) {
  .sb-row { grid-template-columns: 40px 1fr auto; gap: 10px; padding: 12px 14px; }
  .sb-row-stats { display: none; }
}

.sb-stat {
  display: flex; flex-direction: column; align-items: flex-end;
  min-width: 50px;
}
.sb-stat-lbl {
  font-size: 9px; font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.sb-stat-val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.sb-row-bodovi {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--red-700);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  min-width: 90px;
  text-align: right;
}
.sb-row-bodovi.gray { color: var(--ink-4); font-size: 18px; }
.sb-row-bodovi.disk { color: var(--red-600); font-size: 16px; letter-spacing: 1.5px; }

@media (max-width: 700px) {
  .sb-row-bodovi { font-size: 22px; min-width: 70px; }
  .sb-title { font-size: 26px; }
  .podium-bodovi { font-size: 36px; }
  .podium-card.rank-1 .podium-bodovi { font-size: 44px; }
}

.sb-refresh-note {
  text-align: center;
  padding: 1.5rem;
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.3px;
}