/* =========================================================
   Vozni park — vlastiti sloj preko Bootstrapa 5
   ========================================================= */

:root {
  --ink: #16202B;
  --steel: #54697D;
  --mute: #8B9AA8;
  --paper: #E9EDF1;
  --line: #D7DEE5;
  --line-soft: #E7ECF1;
  --blue: #1D4E89;
  --blue-soft: #E8EEF6;
  --amber: #B87514;
  --amber-soft: #FBF0DC;
  --red: #B93326;
  --red-soft: #FAE7E4;
  --green: #26714F;
  --green-soft: #E2F0EA;

  --font-display: 'Barlow Condensed', Impact, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}

h1, h2, h3, .display-font {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .02em;
  font-weight: 600;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

.mono { font-family: var(--font-mono); }

.label-sm {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ---------- Registarska pločica ---------- */

.plate {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  vertical-align: middle;
  line-height: 1;
  white-space: nowrap;
}
.plate-band {
  background: var(--blue);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.plate-text {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.plate-sm { height: 22px; }
.plate-sm .plate-band { width: 10px; font-size: 6.5px; padding-bottom: 2px; }
.plate-sm .plate-text { font-size: 11px; padding: 0 6px; }

.plate-md { height: 28px; }
.plate-md .plate-band { width: 13px; font-size: 8px; padding-bottom: 2px; }
.plate-md .plate-text { font-size: 14px; }

.plate-lg { height: 38px; }
.plate-lg .plate-band { width: 17px; font-size: 11px; padding-bottom: 3px; }
.plate-lg .plate-text { font-size: 19px; padding: 0 10px; }

/* ---------- Admin izgled ---------- */

.app-sidebar {
  background: var(--ink);
  width: 226px;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1030;
}
.app-sidebar .brand { border-bottom: 1px solid rgba(255,255,255,.09); }
.app-sidebar .brand-title { font-family: var(--font-display); font-size: 22px; color: #fff; text-transform: uppercase; }
.app-sidebar .brand-sub { font-family: var(--font-mono); font-size: 10px; color: #7C90A5; letter-spacing: .08em; }

.app-sidebar .nav-link {
  color: #9DAEBE;
  font-size: 13.5px;
  border-radius: 4px;
  border-left: 2px solid transparent;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.app-sidebar .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.10);
  border-left-color: var(--amber);
  font-weight: 600;
}

.app-main { margin-left: 226px; }

@media (max-width: 991.98px) {
  .app-sidebar { position: static; width: 100%; min-height: auto; }
  .app-main { margin-left: 0; }
  .app-sidebar .nav { flex-direction: row !important; overflow-x: auto; }
  .app-sidebar .nav-link { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; }
  .app-sidebar .nav-link.active { border-left: none; border-bottom-color: var(--amber); }
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1020;
}

/* ---------- Kartice i tablice ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: 6px;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.05rem;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.05;
}

.table > :not(caption) > * > * { padding: .7rem .75rem; }
.table thead th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--mute);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.row-link { cursor: pointer; }
.row-link:hover { background: var(--blue-soft) !important; }
.row-unread { background: #FFFDF7; }

/* ---------- Oznake statusa ---------- */

.badge-soft {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge-soft::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-soft.bg-danger-soft { background: var(--red-soft); color: var(--red); }
.badge-soft.bg-warning-soft { background: var(--amber-soft); color: var(--amber); }
.badge-soft.bg-success-soft { background: var(--green-soft); color: var(--green); }
.badge-soft.bg-secondary-soft { background: #F2F5F8; color: var(--steel); }

/* ---------- Tijek prijave ---------- */

.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; }
.timeline .dot-col { display: flex; flex-direction: column; align-items: center; }
.timeline .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--blue); }
.timeline .dot.admin { background: var(--green); }
.timeline .line { width: 1px; flex: 1; background: var(--line); margin-top: 3px; }
.timeline .content { padding-bottom: 14px; }

/* ---------- Koraci statusa ---------- */

.steps { display: flex; align-items: center; gap: 4px; }
.steps .step { display: flex; flex-direction: column; align-items: center; width: 80px; }
.steps .circle {
  width: 24px; height: 24px; border-radius: 50%;
  background: #DCE3EA; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.steps .circle.on { background: var(--blue); }
.steps .bar { flex: 1; height: 2px; background: #DCE3EA; }
.steps .bar.on { background: var(--blue); }
.steps .caption { font-size: 10.5px; margin-top: 4px; text-align: center; color: var(--mute); }
.steps .caption.on { color: var(--ink); }

/* ---------- Vozačevo sučelje (mobitel) ---------- */

.driver-wrap { max-width: 460px; margin: 0 auto; background: var(--paper); min-height: 100vh; }
.driver-topbar { background: var(--ink); color: #fff; }
.driver-topbar .title { font-family: var(--font-display); font-size: 18px; text-transform: uppercase; }

.driver-nav {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 1020;
}
.driver-nav a {
  flex: 1;
  text-align: center;
  padding: 9px 0 11px;
  color: var(--mute);
  text-decoration: none;
  font-size: 11px;
  position: relative;
}
.driver-nav a.active { color: var(--blue); font-weight: 600; }
.driver-nav a.active::before {
  content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 2px; background: var(--blue);
}
.driver-nav i { display: block; font-size: 19px; margin-bottom: 2px; }

/* Veliki gumbi — palac, rukavice, parkiralište */
.btn-touch { min-height: 52px; font-size: 15px; font-weight: 600; border-radius: 8px; }

.type-tile {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--steel);
  font-size: 12px;
  width: 100%;
}
.type-tile i { font-size: 20px; }
.type-tile.selected { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 600; }

.photo-thumb {
  width: 78px; height: 78px; border-radius: 6px; border: 1px solid var(--line);
  object-fit: cover; background: #CFD8E0;
}
.photo-add {
  width: 78px; height: 78px; border-radius: 6px; border: 1.5px dashed var(--line);
  background: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; color: var(--steel); font-size: 10px; cursor: pointer;
}

/* ---------- Sitno ---------- */

.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover { background: #17406F; border-color: #17406F; }
.text-muted-sm { font-size: 12px; color: var(--mute); }
a { text-decoration: none; }
.form-label { font-size: 12px; font-weight: 600; color: var(--steel); margin-bottom: 4px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); display: inline-block; }

@media print {
  .app-sidebar, .topbar, .driver-nav, .btn { display: none !important; }
  .app-main { margin-left: 0; }
}

/* =========================================================
   Dodaci za web sučelje na Supabaseu (webapp/)
   ========================================================= */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-brand { font-family: var(--font-display); font-size: 30px; text-transform: uppercase; color: var(--ink); }

.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-grid a img { width: 110px; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #CFD8E0; }

.driver-wrap { display: flex; flex-direction: column; }
.driver-wrap main { flex: 1; }

.table-responsive { border-radius: 6px; }
.card .table { margin-bottom: 0; }
.unread-title { font-weight: 600; }
.toast { font-size: 13.5px; }
.cursor-pointer { cursor: pointer; }

.login-logo { width: 190px; max-width: 70%; height: auto; display: block; margin: 0 auto 6px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.app-sidebar .brand-title { font-size: 18px; line-height: 1.05; }

/* ---------- Boje iz loga (narančasta) ----------
   Gumbi s bijelim tekstom: #C2570A (kontrast 4.5:1); grafovi i naglasci: #E8701A. */
:root {
  --brand: #C2570A;
  --brand-hover: #A84A07;
  --brand-accent: #E8701A;
  --brand-soft: #FDEEE3;
  --bs-primary: #C2570A;
  --bs-primary-rgb: 194, 87, 10;
  --bs-link-color: #A84A07;
  --bs-link-color-rgb: 168, 74, 7;
  --bs-link-hover-color: #7F3805;
  --bs-link-hover-color-rgb: 127, 56, 5;
  --amber: #E8701A;
}
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-active-bg: var(--brand-hover); --bs-btn-active-border-color: var(--brand-hover);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  background: var(--bs-btn-bg); border-color: var(--bs-btn-border-color); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-hover); --bs-btn-active-border-color: var(--brand-hover); --bs-btn-active-color: #fff; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); --bs-nav-link-color: var(--steel); --bs-nav-link-hover-color: var(--brand-hover); }
.text-bg-primary { background-color: var(--brand) !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 .2rem rgba(232, 112, 26, .2); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.type-tile.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); }
.driver-nav a.active { color: var(--brand); }
.driver-nav a.active::before { background: var(--brand); }
.steps .circle.on, .steps .bar.on { background: var(--brand-accent); }
.notif-dot { background: var(--brand-accent); }
.row-link:hover { background: var(--brand-soft) !important; }
.timeline .dot { background: var(--brand-accent); }
.timeline .dot.admin { background: var(--ink); }

/* ---------- Grafovi ---------- */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-axis { font-size: 11px; fill: var(--mute); font-family: var(--font-body); }
.chart-value { font-size: 11px; fill: var(--ink); font-weight: 600; font-family: var(--font-mono); }
.chart-hit { outline: none; cursor: default; }
.chart-hit:focus path, .chart-hit:hover path { filter: brightness(.9); }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--ink); color: #fff;
  font-size: 12px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 42%) 1fr auto; align-items: center; gap: 8px; border-radius: 4px; }
.bar-label { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 14px; }
.bar-fill { height: 14px; background: var(--brand-accent); border-radius: 0 4px 4px 0; }
.bar-value { font-size: 12px; color: var(--ink); }
.msg-preview { white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Mjerač zauzeća (ispuna = stanje, staza = svjetlija nijansa iste boje) ---------- */
.meter { height: 10px; border-radius: 5px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 5px; }
.meter-success { background: var(--green-soft); } .meter-success .meter-fill { background: var(--green); }
.meter-warning { background: var(--amber-soft); } .meter-warning .meter-fill { background: #B87514; }
.meter-danger { background: var(--red-soft); } .meter-danger .meter-fill { background: var(--red); }
