/* Aplikacija avtoservisa: temna tema v barvah avtoservisa (tokens.css). Tipke za dotik so visoke vsaj 44 px. */
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 16px/1.5 var(--font-body);
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  padding: 10px 16px;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.app-brand { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; text-decoration: none; }
.app-brand .badge { width: 32px; height: 32px; color: var(--paper); }
.app-brand > span { min-width: 0; }
.app-brand strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 17px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; }
.app-brand small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 11px/1.1 var(--font-body); color: var(--yellow); }
.app-nav { display: flex; gap: 4px; }
.app-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.app-nav a[aria-current="page"] { background: var(--panel); color: var(--paper); }
/* Stanje usklajevanja: svoja vrstica pod imenom, tarča za dotik 44 px. */
.sync-status { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; min-height: 44px; margin: -6px 0 -10px; color: var(--muted); font-size: 13px; text-decoration: none; }
.sync-status::before { content: ''; flex: none; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: currentColor; }
.sync-status[data-state="offline"], .sync-status[data-state="quota"] { color: var(--yellow); }
.sync-status[data-state="denied"], .sync-status[data-state="signed-out"], .sync-status[data-state="error"] { color: #FF9088; }
/* Na telefonu povezavo »Domov« nadomesti značka z imenom aplikacije, ki prav tako vodi domov. */
@media (max-width: 440px) { .app-nav a[href="#/"] { display: none; } }
@media (max-width: 359px) { .app-brand strong { font-size: 15px; } .app-nav a { padding: 0 8px; } }

.app-main { max-width: 720px; margin: 0 auto; padding: 16px; }
.fatal, .error { margin: 24px 16px; font-weight: 500; }

.btn {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  padding: 0 16px;
  border: 1.5px solid rgba(241, 238, 230, 0.3);
  border-radius: 10px;
  background: transparent;
  color: var(--paper);
  font: 600 14px/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary { border-color: var(--yellow); background: var(--yellow); color: var(--ink); }
.input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1.5px solid rgba(241, 238, 230, 0.25);
  border-radius: 10px;
  background: var(--panel);
  color: var(--paper);
  font: 500 16px var(--font-body);
}

.toolbar { display: flex; align-items: center; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid rgba(241, 238, 230, 0.25);
  border-radius: 99px;
  background: transparent;
  color: var(--paper);
  font: 600 14px var(--font-body);
  cursor: pointer;
}
.chip-btn.is-active { border-color: var(--yellow); background: var(--panel-2); }
.count { min-width: 1.6em; padding: 2px 7px; border-radius: 99px; background: var(--line); font-size: 12.5px; text-align: center; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: stretch; overflow: hidden; border-radius: 12px; background: var(--panel); }
.row-main {
  display: grid;
  flex: 1;
  grid-template-areas: "plate text chip";
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  min-width: 0;
  min-height: 64px;
  padding: 10px 14px;
  text-decoration: none;
}
.row-main .plate { grid-area: plate; }
.row-main .chip { grid-area: chip; justify-self: end; }
.row-text { display: flex; grid-area: text; flex-direction: column; min-width: 0; }
/* Na telefonu: tablica in stanje zgoraj, ime in rok pod njima čez vso širino. */
@media (max-width: 520px) {
  .row-main { grid-template-areas: "plate . chip" "text text text"; row-gap: 8px; }
}
.row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row-due { color: var(--muted); font-size: 13px; }
.row-wa { display: grid; place-items: center; width: 56px; border-left: 1px solid var(--line); color: #72D6A1; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }
.restore-hint { margin-top: 24px; font-size: 14px; }
.restore-hint a { display: inline-flex; align-items: center; min-height: 44px; color: var(--yellow); font-weight: 600; }

.toasts { position: fixed; right: 0; bottom: 16px; left: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 480px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  pointer-events: auto;
}
.toast-warn { border-color: var(--yellow); }
.toast-error { border-color: #FF9088; }
.toast-action { min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--yellow); font: 700 14px var(--font-body); cursor: pointer; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 420px); align-content: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.6); }
.dialog { box-sizing: border-box; width: 100%; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.dialog-text { margin: 0; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dialog-actions .btn { flex: 0 1 auto; white-space: normal; text-align: center; }
@media (max-width: 480px) { .dialog-actions .btn { flex: 1 1 100%; } }

/* Naslovi in besedila */
.back { display: inline-flex; align-items: center; min-height: 44px; margin: -8px 0 0; color: var(--muted); font-weight: 600; text-decoration: none; }
.page-title { margin: 0 0 4px; font: 600 22px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.section-title { margin: 24px 0 10px; font: 600 16px/1.2 var(--font-body); }
.muted { margin: 2px 0; color: var(--muted); font-size: 14px; }

/* Vozilo */
.vehicle-heading { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.vehicle-heading .plate { font-size: 22px; }
.vehicle-heading .page-title { margin: 0; font-size: 20px; }
.card { margin: 12px 0; padding: 14px 16px; border-radius: 12px; background: var(--panel); }
.card .section-title { margin-top: 0; }
.card p { margin: 6px 0; }
.owner-phone { display: inline-flex; align-items: center; min-height: 44px; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.service-list { margin: 0; padding: 0; list-style: none; }
.service-item { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.service-item p { margin: 4px 0; overflow-wrap: anywhere; }
.service-top { display: flex; align-items: center; gap: 10px; }
.service-edit { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; padding: 0 10px; color: var(--yellow); font-weight: 600; text-decoration: none; }

/* Obrazci */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.field { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 14px; font-weight: 600; }
.field-hint { color: var(--muted); font-size: 12.5px; }
.field .input { flex: none; width: 100%; box-sizing: border-box; }
textarea.input { padding: 10px 14px; line-height: 1.4; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 10px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; }
.segment { display: inline-flex; margin-right: 8px; }
.check { display: inline-flex; margin: 0 8px 8px 0; }
.segment input, .check input { position: absolute; opacity: 0; pointer-events: none; }
.segment span, .check span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid rgba(241, 238, 230, 0.25);
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.segment input:checked + span, .check input:checked + span { border-color: var(--yellow); background: rgba(244, 180, 0, 0.14); color: var(--yellow); }
.segment input:focus-visible + span, .check input:focus-visible + span { outline: 2px solid var(--yellow); outline-offset: 2px; }
.check input:checked + span::before { content: "✓"; margin-right: 6px; }
.private { padding: 12px 14px; border: 1px dashed rgba(241, 238, 230, 0.25); border-radius: 12px; }
.private .field { margin-top: 10px; }
.next-fields .muted { margin-top: 8px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.form-actions .btn-primary { flex: 1 1 200px; }
.errors { padding: 8px 14px; border: 1px solid #FF9088; border-radius: 10px; color: #FF9088; font-weight: 600; }
.errors p { margin: 4px 0; }
.btn-danger { margin-top: 28px; border-color: rgba(255, 144, 136, 0.6); color: #FF9088; }
.visually-hidden { position: fixed; left: -9999px; opacity: 0; }

/* Tisk nalepk: zaslon (list in nalepko ureja css/print.css) */
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.queue { margin: 0 0 10px; padding: 0; list-style: none; }
.queue li { display: flex; align-items: center; gap: 10px; min-height: 56px; border-bottom: 1px solid var(--line); }
.queue .btn { min-height: 44px; margin-left: auto; }
.queue-name { min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
select.input { width: 100%; box-sizing: border-box; }
.custom-box { margin-top: 12px; }
.custom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.custom-error { color: #FF9088; font-weight: 600; }
.custom-error:empty { display: none; }
.slot-grid { display: grid; gap: 6px; max-width: 420px; margin: 8px 0 12px; }
.slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 52px;
  padding: 4px;
  border: 1.5px dashed rgba(241, 238, 230, 0.3);
  border-radius: 8px;
  background: transparent;
  color: var(--paper);
  font: 600 14px/1.2 var(--font-body);
  cursor: pointer;
}
.slot-btn small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.slot-btn.is-assigned { border-style: solid; border-color: var(--yellow); }
.slot-btn.is-assigned small { color: var(--yellow); }
.slot-btn[aria-pressed="true"] { border-style: solid; background: repeating-linear-gradient(45deg, var(--line) 0 6px, transparent 6px 12px); color: var(--muted); }
.offsets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
@media (max-width: 480px) { .offsets { grid-template-columns: 1fr; } }
.stepper { display: flex; gap: 6px; }
.stepper .input { flex: 1; width: 100%; min-width: 0; box-sizing: border-box; text-align: center; }
.stepper .btn { min-width: 48px; padding: 0; font-size: 20px; }
.module-line { margin: 10px 0 0; font-size: 14px; font-weight: 600; }
.module-line + .module-line { margin-top: 4px; }
.level-ok { color: #72D6A1; }
.level-warn { color: var(--yellow); }
.level-confirm { color: #FF9088; }
.print-warnings p { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--yellow); font-size: 14px; }
.blocked { margin: 12px 0; padding: 4px 14px; border: 1px solid var(--yellow); border-radius: 10px; }
.blocked p:first-child { margin-bottom: 2px; font-weight: 600; }
.print-hint { margin: 16px 0 8px; font-size: 14px; }
.print-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.print-actions .btn-primary { flex: 1 1 200px; }

/* Pasice z opozorili */
.banners { display: flex; flex-direction: column; gap: 6px; box-sizing: border-box; max-width: 720px; margin: 0 auto; padding: 10px 16px 0; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.banner a { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0; color: var(--yellow); font-weight: 600; }
.banner-error { border-color: #FF9088; background: rgba(194, 59, 50, 0.22); font-weight: 600; }
.banner-warn { border-color: var(--yellow); }
.banner-info { color: var(--muted); }

/* Nastavitve */
.info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; overflow-wrap: anywhere; }
.base-url { overflow-wrap: anywhere; font-weight: 600; }
.warning-note { padding-left: 12px; border-left: 3px solid var(--yellow); font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { flex: 1 1 160px; }
.file-btn:focus-within { outline: 2px solid var(--yellow); outline-offset: 2px; }
.import-report { padding: 10px 14px; border: 1px solid #72D6A1; border-radius: 10px; font-size: 14px; }
.form textarea.input { font-size: 15px; }
.settings-view .form { margin-top: 0; }

/* Kartica Oblak */
.cloud-card .cloud-user, .cloud-card .cloud-status { overflow-wrap: anywhere; }
.cloud-card .cloud-status { color: var(--muted); }
.cloud-card .btn-danger { margin-top: 0; }
.cloud-card .btn-row .btn { white-space: normal; text-align: center; }

/* Tisk: vozila, ki še niso v oblaku */
.print-waiting:empty { display: none; }
.print-waiting .waiting-item { margin-top: 0; }
.link-note { margin: 8px 0 0; }
