/* ============================================================
   Rabimbox - panel (svetla tema po rabimbox.si)
   Namizje: videz spletne strani (stranska vrstica)
   Telefon/tablica: app z spodnjo navigacijo
   ============================================================ */
:root {
  --bg:       #f3f5f9;
  --surface:  #ffffff;
  --surface-2:#f7f9fc;
  --line:     #e5e8ee;
  --line-2:   #eef1f6;
  --text:     #364151;   /* rabimbox body */
  --heading:  #2a3342;
  --muted:    #7b8794;
  --brand:    #0067ff;   /* rabimbox modra */
  --brand-dk: #0052cc;
  --brand-sf: #e8f0ff;
  --btn:      #6ec1e4;   /* barva gumbov */
  --btn-dk:   #54b1d9;   /* gumb hover */
  --green:    #00a32a;   /* rabimbox zelena */
  --green-dk: #018a24;
  --green-sf: #e6f6ea;
  --amber:    #b7791f;
  --amber-sf: #fdf3e0;
  --red:      #d92d20;
  --red-sf:   #fdeceb;
  --radius:   12px;
  --shadow:   0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-l: 0 10px 30px rgba(16,24,40,.12);
  --sidebar:  264px;
  --maxw:     880px;
  --font:     "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-h:   "Lexend", var(--font);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-h); color: var(--heading); font-weight: 600; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
svg { display: block; }

/* ---------- Boot / spinner ---------- */
.boot { display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   POSTAVITEV
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

/* --- Stranska vrstica (namizje) --- */
.sidebar { display: none; }
@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column;
    width: var(--sidebar); flex: 0 0 var(--sidebar);
    background: var(--surface); border-right: 1px solid var(--line);
    padding: 26px 20px; position: sticky; top: 0; height: 100vh;
  }
}
.side-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.side-brand .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; }
.side-brand img { height: 56px; width: auto; display: block; }
.side-brand .name { font-family: var(--font-h); font-weight: 700; font-size: 17px; color: var(--heading); }
.side-user { font-family: var(--font-h); font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--heading); padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.side-user .sub { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; color: var(--muted); margin-top: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: block; padding: 11px 12px; border-radius: 9px; color: var(--text); font-weight: 500; font-size: 14.5px; }
.side-nav a:hover { background: var(--surface-2); text-decoration: none; }
.side-nav a.active { color: var(--brand); background: var(--brand-sf); font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 16px; }
.side-foot a { display: block; padding: 10px 12px; color: var(--muted); font-size: 14px; }

/* --- Glavni stolpec --- */
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Zgornja vrstica: vidna na telefonu, minimalna na namizju */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-h); font-weight: 700; color: var(--heading); }
.topbar .brand .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; }
.topbar .brand img { height: 36px; width: auto; display: block; }
.topbar .who { font-size: 12px; color: var(--muted); text-align: right; }
@media (min-width: 900px) { .topbar { display: none; } }

.content { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 22px 18px 24px; }
@media (min-width: 900px) { .content { padding: 34px 40px 40px; } }

/* Footer (kot na rabimbox.si) */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); text-align: center; padding: 26px 18px; margin-top: 10px; }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; margin-bottom: 14px; }
.foot-nav a { color: var(--brand); font-size: 14px; font-weight: 500; }
.foot-copy { color: var(--muted); font-size: 12.5px; }
@media (max-width: 899px) { .site-footer { margin-bottom: 70px; } }

.page-title { font-size: 24px; margin: 0 0 4px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
@media (max-width: 899px) { .page-title { font-size: 20px; } }

/* ---------- Spodnja navigacija (telefon) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
}
.tabbar button { background: none; border: 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; padding: 4px 2px; border-radius: 10px; }
.tabbar button svg { width: 22px; height: 22px; stroke: currentColor; }
.tabbar button.active { color: var(--brand); }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ============================================================
   GRADNIKI
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3 { margin: 0 0 14px; font-size: 16px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin: 4px 2px 10px; }

/* Statistika */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .n { font-family: var(--font-h); font-size: 30px; font-weight: 700; color: var(--heading); line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* Vrstice seznama */
.row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: 0; }
.row .ico { width: 38px; height: 38px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: 0 0 auto; color: var(--muted); }
.row .ico svg { width: 20px; height: 20px; stroke: currentColor; }
.row .main { flex: 1; min-width: 0; }
.row .main .t { font-weight: 600; font-size: 14.5px; color: var(--heading); }
.row .main .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row .end { text-align: right; flex: 0 0 auto; }
.row.selectable { cursor: pointer; }
.row .check { width: 20px; height: 20px; accent-color: var(--brand); flex: 0 0 auto; }

/* Značke */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.gray { background: #eef1f6; color: #5b6572; }
.badge.green { background: var(--green-sf); color: var(--green-dk); }
.badge.blue { background: var(--brand-sf); color: var(--brand-dk); }
.badge.amber { background: var(--amber-sf); color: var(--amber); }
.badge.red { background: var(--red-sf); color: var(--red); }

/* Gumbi */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 18px; border-radius: 3px; border: 1px solid var(--btn); background: var(--btn); color: #fff; font-weight: 600; font-size: 14.5px; transition: background .15s, border-color .15s; }
.btn:hover { text-decoration: none; background: var(--btn-dk); border-color: var(--btn-dk); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #fff; }
.btn.primary:hover { background: var(--btn-dk); border-color: var(--btn-dk); }
.btn.success { background: var(--btn); border-color: var(--btn); color: #fff; }
.btn.success:hover { background: var(--btn-dk); border-color: var(--btn-dk); }
.btn.outline { background: var(--btn); border-color: var(--btn); color: #fff; }
.btn.outline:hover { background: var(--btn-dk); border-color: var(--btn-dk); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #b3241a; border-color: #b3241a; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--btn); }
.btn.ghost:hover { background: transparent; border-color: transparent; color: var(--btn-dk); }
.btn.gray { background: #e9edf2; border-color: #e9edf2; color: #9aa5b4; }
.btn.gray:hover { background: #e9edf2; border-color: #e9edf2; color: #9aa5b4; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }
.btn.auto { width: auto; }

/* Obrazci */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: var(--heading); font-weight: 500; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 15px; font-family: inherit; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-sf); }
.field input:disabled { background: var(--surface-2); color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Prazno stanje */
.empty { text-align: center; color: var(--muted); padding: 34px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty p { margin: 0 0 4px; font-size: 14px; }

/* Auth zaslon */
.auth-wrap { max-width: 400px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .mark { width: 52px; height: 52px; border-radius: 13px; background: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.auth-logo img { height: 56px; width: auto; display: block; margin: 0 auto 14px; }
.auth-logo h1 { margin: 0 0 4px; font-size: 22px; }
.auth-logo p { margin: 0; color: var(--muted); font-size: 13.5px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.seg button { flex: 1; border: 0; background: none; color: var(--muted); padding: 9px; border-radius: 7px; font-weight: 600; font-size: 13.5px; }
.seg button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

/* Opozorila */
.alert { padding: 11px 13px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; border: 1px solid transparent; }
.alert.err { background: var(--red-sf); border-color: #f6c9c4; color: #a01810; }
.alert.ok { background: var(--green-sf); border-color: #b6e2c0; color: #096b23; }
.alert.info { background: var(--brand-sf); border-color: #c7dbff; color: #0a4bb3; }

#toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 60; background: var(--heading); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-l); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: 90%; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
@media (min-width: 900px) { #toast { bottom: 30px; } }

/* Modal / sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 900px) { .sheet-backdrop { align-items: center; } }
.sheet { background: var(--surface); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; border: 1px solid var(--line); padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; animation: rise .22s ease; }
@media (min-width: 900px) { .sheet { border-radius: 16px; max-height: 86vh; } }
@keyframes rise { from { transform: translateY(30px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.sheet .grip { width: 40px; height: 4px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
@media (min-width: 900px) { .sheet .grip { display: none; } }
.sheet h3 { margin: 0 0 16px; }

.select-box { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; background: var(--surface); }
.select-box input { width: 18px; height: 18px; accent-color: var(--brand); }
.select-box .t { font-weight: 600; font-size: 14px; color: var(--heading); }
.select-box .s { font-size: 12px; color: var(--muted); }

/* Lebdeči gumb za dostavo izbranih */
.deliver-bar { position: fixed; left: 0; right: 0; bottom: 62px; z-index: 25; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
@media (min-width: 900px) { .deliver-bar { position: sticky; bottom: 18px; padding: 0; margin-top: 8px; } }
.deliver-bar .inner { pointer-events: auto; width: 100%; max-width: var(--maxw); }
.deliver-bar .btn { box-shadow: var(--shadow-l); }
.deliver-bar.hidden { display: none; }

.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.rowflex { display: flex; gap: 12px; }
.rowflex > * { flex: 1; }

.nadzor-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 18px; }
@media (max-width: 560px) { .nadzor-choice { grid-template-columns: 1fr; } }
.nadzor-choice .nchoice { display: block; background: #fff; border: 1px solid var(--line, #e5e8ee); border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.07); padding: 20px; text-align: center; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .1s; }
.nadzor-choice .nchoice:hover { border-color: #6ec1e4; box-shadow: 0 10px 30px rgba(16,24,40,.10); transform: translateY(-2px); }
.nadzor-choice .nchoice { cursor: pointer; }
.nadzor-choice .nchoice.active { border-color: #0067ff; box-shadow: 0 0 0 3px rgba(0,103,255,.14); }
.nadzor-choice .nchoice .cnt { display: block; font-weight: 700; font-size: 30px; line-height: 1; color: #0067ff; margin-bottom: 4px; }
.nadzor-choice .nchoice .t { display: block; font-weight: 700; font-size: 18px; color: #2a3342; }
.nadzor-choice .nchoice .d { display: block; color: #7b8794; font-size: 13px; margin-top: 4px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--heading); font-weight: 600; text-align: right; }

/* ===== Mobilna optimizacija ===== */
button, .btn, a.btn, .row.selectable, .nchoice, .tab { -webkit-tap-highlight-color: rgba(0,0,0,.06); }
@media (max-width: 600px) {
  /* 16px prepreči samodejni zoom polja na iOS */
  .field input, .field select, .field textarea { font-size: 16px; padding: 12px 13px; }
  /* Udobnejši gumbi in vrstice za dotik */
  .btn { padding: 13px 18px; min-height: 46px; }
  .btn.small { padding: 10px 14px; font-size: 13.5px; min-height: 40px; }
  .row { padding-top: 12px; padding-bottom: 12px; }
  .select-box input, .check { width: 20px; height: 20px; }
  .page-sub { margin-bottom: 14px; }
}
