/* Dostava · Kurir · Karika */

@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ink: #14212e;
  --ink-2: #3b4a58;
  --muted: #52606d;
  --line: #d5dce3;
  --line-2: #e4e9ee;
  --field: #c3ccd5;
  --bg: #eef1f4;
  --card: #ffffff;
  --soft: #f5f7f9;
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --brand: #8f499c;
  --brand-dark: #763b81;
  --brand-soft: #f3e8f5;
  --brand-ink: #4a2152;
  --focus: #1f5fd1;
  --green-bg: #e3f3e9; --green: #1e6b3e;
  --amber-bg: #fdebdd; --amber: #9a3412;
  --red-bg: #fbe3e3;   --red: #a61b1b;
  --blue-bg: #e2ecfb;  --blue: #1f4fa8;
  --grey-bg: #e9edf1;  --grey: #3b4a58;
  --radius: 12px;
  --font: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "PlexMono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 24px; font-weight: 700; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.mono { font-family: var(--mono); }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.break { word-break: break-all; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: inline; margin: 0; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; min-height: 72px; padding: 10px 24px; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-logo { display: flex; align-items: center; background: #fff; border-radius: 9px; padding: 6px 10px; }
.brand-logo img { display: block; height: 28px; width: auto; }
.brand-name { font-weight: 600; font-size: 17px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #22323f; border-radius: 12px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 9px; font-size: 15px; font-weight: 600; color: #c9d2db; text-decoration: none; }
.tab:hover { color: #fff; background: #2c3e50; }
.tab.is-active { background: #fff; color: var(--ink); }
.who { display: flex; align-items: center; gap: 12px; }
.who-name { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; font-weight: 600; line-height: 1.25; }
.who-role { font-size: 12px; font-weight: 500; color: #c9d2db; }

.main { padding: 22px 28px 40px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--field); border-radius: 10px; background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--soft); color: var(--ink); }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #22323f; color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #861515; color: #fff; }
.btn-danger-ghost { color: var(--red); border-color: #e3b3b3; }
.btn-ghost { border-color: transparent; background: var(--soft); }
.btn-dashed { border-style: dashed; border-color: #8e9ba8; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: progress; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); cursor: pointer; padding: 0; }
.icon-btn-dark { background: transparent; border-color: #3b4a58; color: #c9d2db; width: 40px; height: 40px; }
.icon-btn-dark:hover { color: #fff; }
.icon-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.file-btn { position: relative; overflow: hidden; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* ---------- Chips and tags ---------- */
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip-sm { padding: 2px 8px; font-size: 12px; }
.chip-green { background: var(--green-bg); color: var(--green); }
.chip-amber { background: var(--amber-bg); color: var(--amber); }
.chip-red { background: var(--red-bg); color: var(--red); }
.chip-blue { background: var(--blue-bg); color: var(--blue); }
.chip-grey { background: var(--grey-bg); color: var(--grey); }
.chip-dark { background: var(--ink); color: #fff; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.table-log td:last-child { white-space: nowrap; }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: var(--blue-bg); color: var(--blue); }
.tag-grey { background: var(--grey-bg); color: var(--grey); }
.tag-dark { background: var(--ink); color: #fff; }
.tag-carried { align-self: flex-start; display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--brand-soft); color: #6e3579; font-size: 12px; font-weight: 600; }

/* ---------- Alerts ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 15px; line-height: 1.45; margin: 0; }
.alert-success { background: var(--green-bg); color: #12502d; }
.alert-error { background: var(--red-bg); color: #7a1414; }
.alert-warning { background: #fff6e5; color: #6b4a00; }
.alert-info { background: var(--blue-bg); color: #1f3f7a; }
.note-info { padding: 10px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); font-size: 14px; line-height: 1.45; margin: 0 0 14px; }
.note-ro { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--grey-bg); color: var(--ink-2); font-size: 14px; }
.note { padding: 10px 14px; border-radius: 10px; background: #fff6e5; color: #6b4a00; margin: 8px 0 14px; }
.hint { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field-label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--field); border-radius: 10px; background: #fff; font-size: 16px; color: var(--ink);
}
textarea { padding: 12px 14px; resize: vertical; min-height: 80px; }
select { padding-right: 10px; }
input:disabled, textarea:disabled, select:disabled { background: var(--soft); }
.field-was { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.code-input { min-height: 64px !important; text-align: center; font-family: var(--mono); font-size: 30px !important; letter-spacing: .35em; }
.code-input-sm { font-size: 24px !important; letter-spacing: .15em; }
.radios { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.radios label { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.radios input[type=radio] { width: 20px; height: 20px; accent-color: var(--red); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.filters .field { min-width: 150px; }
.filters .grow { flex: 1 1 260px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---------- Board (Pošiljke) ---------- */
.board { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.board-list { flex: 1 1 340px; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.list-head .muted { font-size: 14px; }
.upload { display: flex; flex-direction: column; gap: 6px; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); text-decoration: none; }
.card:hover { color: var(--ink); border-color: #a9b6c2; }
.card.is-selected { border: 2px solid var(--brand); padding: 13px 15px; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title { font-size: 17px; font-weight: 600; }
.seq { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.seq-brand { background: var(--brand); }
.seq-muted { background: #8e9ba8; }
.seq-xl { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; }
.empty { padding: 20px; border: 1px dashed var(--field); border-radius: var(--radius); color: var(--muted); text-align: center; background: #fff; }
.empty-inline { padding: 12px; border: 1px dashed var(--field); border-radius: 10px; color: var(--muted); text-align: center; font-size: 14px; }

.panel { flex: 999 1 560px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.panel-static { max-width: 1200px; }
.panel-empty { padding: 60px 30px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.panel-head { display: flex; align-items: flex-start; gap: 16px; padding: 20px 28px; border-bottom: 1px solid var(--line-2); }
.panel-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.panel-title h2 { font-size: 26px; overflow-wrap: anywhere; }
.panel-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--muted); text-transform: uppercase; }
.panel-body { padding: 20px 28px; display: flex; flex-direction: column; gap: 18px; }
.cols { display: flex; flex-wrap: wrap; gap: 28px; }
.col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.section-title { margin: 6px 0 0; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.steppers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stepper { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.stepper-row { display: flex; align-items: center; gap: 8px; }
.step-btn { width: 48px; height: 48px; flex-shrink: 0; border: 1px solid var(--field); border-radius: 10px; background: #fff; font-size: 24px; font-weight: 600; cursor: pointer; }
.step-btn:hover { background: var(--soft); }
.step-input { text-align: center; font-size: 20px !important; font-weight: 700; padding: 0 4px !important; }
.windows { display: flex; flex-direction: column; gap: 8px; }
.window-row { display: flex; align-items: center; gap: 8px; }
.window-row input[type=date] { flex: 1 1 150px; min-width: 0; }
.window-row input[type=time] { flex: 0 1 112px; min-width: 0; }
.doc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.doc-top { display: flex; align-items: center; gap: 12px; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pdf-badge { width: 40px; height: 48px; flex-shrink: 0; border-radius: 6px; background: var(--red-bg); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.items summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); min-height: 32px; display: flex; align-items: center; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; padding-top: 6px; }
.total-row strong { font-size: 20px; }
.panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 28px; border-top: 1px solid var(--line-2); }
.foot-text { flex: 1 1 260px; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.danger-zone { margin: 0 28px 20px; border: 1px solid #f1c7c7; border-radius: 12px; background: #fdf8f8; }
.danger-zone summary { cursor: pointer; padding: 12px 16px; color: var(--red); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.danger-zone form { padding: 0 16px 16px; }
.facts { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.facts dt { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.facts dd { margin: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; }
.table, .items-table { width: 100%; border-collapse: collapse; }
.table { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.table th, .table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.table th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: var(--soft); }
.table tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form + form { margin-left: 6px; }
.items-table th, .items-table td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); font-size: 14px; text-align: left; vertical-align: top; }
.items-table th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.items-table tfoot td { font-weight: 700; border-bottom: 0; }
.num { text-align: right !important; }
.role-form select { min-height: 38px; width: auto; padding: 0 8px; font-size: 14px; }

/* ---------- Pages ---------- */
.page { max-width: 1400px; display: flex; flex-direction: column; gap: 14px; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.page-head p { margin: 4px 0 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 8px; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.split-side { flex: 1 1 280px; max-width: 400px; }
.side-card, .card-form { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.side-card p { font-size: 14px; color: var(--ink-2); }
.setting { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.message-page { text-align: left; }
.message-page h1 { margin-bottom: 10px; }

/* ---------- Auth ---------- */
.auth-body { background: var(--ink); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 14px; }
.auth-card { width: 100%; max-width: 480px; background: #fff; border-radius: 20px; padding: 30px 34px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 6px; }
.auth-brand img { height: 43px; width: auto; }
.auth-app { font-size: 14px; font-weight: 600; color: var(--muted); }
.auth-title { font-size: 26px; }
.auth-foot { color: #9aa7b4; font-size: 13px; margin: 0; }
.auth-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: #6e3579; display: flex; align-items: center; justify-content: center; }
.auth-icon-ok { background: var(--green-bg); color: var(--green); }
.step-chip { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: #6e3579; font-size: 13px; font-weight: 600; }
.setup-grid { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr { flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; line-height: 0; }
.qr svg { width: 190px; height: 190px; }
.steps { margin: 0; padding-left: 20px; flex: 1 1 180px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.manual-key summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 36px; display: flex; align-items: center; }
.manual-key .key { font-size: 17px; letter-spacing: .05em; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px; border-radius: 12px; background: var(--soft); font-size: 18px; text-align: center; }

/* ---------- Small screens (phones, tablet portrait) ---------- */
@media (max-width: 760px) {
  .main { padding: 14px 12px 32px; }
  .topbar { padding: 10px 12px; }
  .brand-name { display: none; }
  .board-list { max-width: none; }
  .panel-head, .panel-body, .panel-foot { padding-left: 16px; padding-right: 16px; }
  .danger-zone { margin: 0 16px 16px; }
  .grid-2, .steppers { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .auth-card { padding: 24px 20px; }
  .window-row { flex-wrap: wrap; }
}

@media print {
  .topbar, .auth-foot, .btn, .flashes .alert-warning { display: none !important; }
  .auth-body { background: #fff; }
}
