@import url('/fonts/inter/index.css');

/* Izgled prema „Est-Trans” (Fireart Studio, Dribbble): svetlo siva podloga,
   bele kartice sa velikim zaobljenjem, crne pilule za glavne radnje. */

:root {
  --bg: #f1f1f0;
  --card: #ffffff;
  --soft: #f4f4f3;
  --soft-2: #eaeae8;
  --line: #e3e3e1;
  --ink: #141a1a;
  --ink-2: #5b6161;
  --ink-3: #8b9090;
  --black: #131919;
  --blue-pale: #cbdbe8;
  --blue-paler: #e7eff6;
  --green: #1c9a52;
  --red: #e5484d;

  --s-kreiran: #9aa0a6;
  --s-primljen: #3b82e0;
  --s-u_dostavi: #efb100;
  --s-isporucen: #1c9a52;
  --s-vracen: #7c5cdb;
  --p-kreiran: #ececea;
  --p-primljen: #d7e6f6;
  --p-u_dostavi: #fbedb5;
  --p-isporucen: #d4efdd;
  --p-vracen: #e6def8;

  --r-card: 22px;
  --r-md: 14px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --f: 'Inter Variable', 'Inter', system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 14.5px/1.45 var(--f);
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: 'cv11', 'ss01';
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; }
a { color: inherit; }
code { font-size: 13px; background: var(--soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

.i { width: 20px; height: 20px; flex: none; }
.muted { color: var(--ink-3); font-size: 13.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.code { font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

[data-s='kreiran'] { --c: var(--s-kreiran); --p: var(--p-kreiran); }
[data-s='primljen'] { --c: var(--s-primljen); --p: var(--p-primljen); }
[data-s='u_dostavi'] { --c: var(--s-u_dostavi); --p: var(--p-u_dostavi); }
[data-s='isporucen'] { --c: var(--s-isporucen); --p: var(--p-isporucen); }
[data-s='vracen'] { --c: var(--s-vracen); --p: var(--p-vracen); }

/* ---------- osnovni delovi */

.card { background: var(--card); border-radius: var(--r-card); padding: 22px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 3px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  transition: background-color 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out);
}
.btn:hover { background: var(--soft); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn[data-busy] { opacity: 1; color: transparent; }
.btn[data-busy]::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-color: var(--ink-3) var(--ink-3) var(--ink-3) transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-dark[data-busy]::after { border-color: #fff #fff #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: #d23b40; border-color: #d23b40; }
.btn .i { width: 18px; height: 18px; }
.btn-dark { background: var(--black); border-color: var(--black); color: #fff; }
.btn-dark:hover { background: #2a3232; border-color: #2a3232; }
.btn-soft { background: var(--soft); border-color: var(--soft); }
.btn-soft:hover { background: var(--soft-2); border-color: var(--soft-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-block { width: 100%; height: 50px; }

.round {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.round:active { transform: scale(0.94); }
.round:hover { background: var(--soft); }
.round.soft { background: var(--soft); }
.round.soft:hover { background: var(--soft-2); }
.round.sm { width: 36px; height: 36px; }
.round.sm .i { width: 18px; height: 18px; }
.round:disabled { opacity: 0.4; cursor: default; }
.badge-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border: 2px solid var(--card); border-radius: 50%; background: var(--ink-3); }
.badge-dot[data-on='true'] { background: var(--green); }
.badge-dot[data-on='false'] { background: var(--red); }

.field { display: grid; gap: 7px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--soft);
  transition: border-color 0.15s, background-color 0.15s;
}
.input::placeholder { color: var(--ink-3); }
.input:hover { background: var(--soft-2); }
.input:focus { outline: none; border-color: var(--ink); background: var(--card); }
textarea.input { height: auto; min-height: 76px; padding: 12px 16px; resize: vertical; }
select.input { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141a1a' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack { display: grid; gap: 16px; }
.form-error { color: var(--red); font-weight: 500; }
.form-ok { color: var(--green); font-weight: 500; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--p);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.logo { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--black); color: #fff; }
.logo .i { width: 20px; height: 20px; }

.check {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin: 0;
  border: 1.5px solid #c7caca;
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
}
.check:checked { border-color: var(--black); background: var(--black) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-8.5'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* ---------- dijalozi */

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px rgb(20 26 26 / 0.22);
}
dialog::backdrop { background: rgb(20 26 26 / 0.32); backdrop-filter: blur(3px); }

/* Otvaranje i zatvaranje: prozor izraste iz 96%, zatvara se istim putem. */
dialog {
  opacity: 1;
  transform: scale(1);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out),
    overlay 220ms allow-discrete, display 220ms allow-discrete;
}
dialog:not([open]) { opacity: 0; transform: scale(0.96); }
@starting-style { dialog[open] { opacity: 0; transform: scale(0.96); } }
dialog::backdrop { opacity: 1; transition: opacity 220ms var(--ease-out), overlay 220ms allow-discrete, display 220ms allow-discrete; }
dialog:not([open])::backdrop { opacity: 0; }
@starting-style { dialog[open]::backdrop { opacity: 0; } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 24px 0; }
.dlg-head h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.dlg-body { display: grid; gap: 16px; padding: 20px 24px; }
.dlg-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 4px 24px 24px; }

dialog.drawer {
  width: min(470px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
  max-height: none;
  margin: 12px 12px 12px auto;
  overflow-y: auto;
  transition-duration: 320ms;
  transition-timing-function: var(--ease-drawer);
}
dialog.drawer:not([open]) { opacity: 1; transform: translateX(calc(100% + 24px)); }
@starting-style { dialog.drawer[open] { opacity: 1; transform: translateX(calc(100% + 24px)); } }

/* Obaveštenje: crna pilula koja silazi sa vrha i vraća se istim putem. */
.toast {
  position: fixed;
  left: 50%;
  top: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 8px 20px 8px 8px;
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 14px 40px rgb(20 26 26 / 0.28);
  opacity: 0;
  transform: translate(-50%, calc(-100% - 20px)) scale(0.96);
  transition: opacity 400ms ease, transform 400ms ease;
  pointer-events: none;
}
.toast[data-open='true'] { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast-ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--green); }
.toast-ic .i { width: 17px; height: 17px; }
.toast[data-kind='error'] .toast-ic { background: var(--red); }

/* Potvrda (umesto sistemskog prozora) */
dialog.confirm { width: min(380px, calc(100vw - 32px)); padding: 28px 24px 24px; text-align: center; }
dialog.confirm h2 { margin-top: 14px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
dialog.confirm p { margin-top: 6px; color: var(--ink-2); }
.confirm-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--soft); }
.confirm-ic .i { width: 26px; height: 26px; }
.confirm-ic.danger { background: #fde4e4; color: var(--red); }
.confirm-actions { display: grid; gap: 8px; margin-top: 22px; }
.confirm-actions .btn { height: 48px; }

/* Klizni indikator: kopija pilula u aktivnim bojama, isečena na izabrano dugme */
.slide-host { position: relative; }
.slide-copy {
  position: absolute !important;
  left: 0;
  top: 0;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
  pointer-events: none;
}
.slide-copy > * { background: var(--black) !important; color: #fff !important; }
.slide-copy > * span { color: #a9b0b0 !important; }
.slide-copy.moving { transition: clip-path 250ms var(--ease-in-out); }

/* Kostur dok se podaci učitavaju */
.skel { display: block; border-radius: 10px; background: var(--soft-2); animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }

/* Kartica „stigao sken” dole desno */
.notice {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  padding: 12px 12px 12px 14px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 18px 50px rgb(20 26 26 / 0.18);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
  pointer-events: none;
}
.notice[data-open='true'] { opacity: 1; transform: none; pointer-events: auto; }
.notice .dot { width: 40px; height: 40px; border-radius: 50%; background: var(--p); display: grid; place-items: center; color: var(--ink); }
.notice b { display: block; font-size: 14px; font-weight: 600; }
.notice small { display: block; color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice .count { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--soft); color: var(--ink-2); font-size: 11.5px; font-weight: 600; }

/* ---------- prijava */

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); padding: 34px; display: grid; gap: 26px; border-radius: 28px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.login-card h1 { font-size: 36px; font-weight: 450; letter-spacing: -0.03em; line-height: 1.1; }
.login-card .lead { color: var(--ink-2); margin-top: 8px; }

/* ---------- zaglavlje */

.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; max-width: 1480px; margin: 0 auto; padding: 18px 28px 6px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: var(--card); }
.nav a { display: flex; align-items: center; height: 40px; padding: 0 20px; border-radius: 999px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color 0.15s; }
.nav a:hover { background: var(--soft); }
.top-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.profile-wrap { position: relative; }
.profile { display: flex; align-items: center; gap: 11px; padding: 5px 14px 5px 5px; border: 0; border-radius: 999px; background: var(--card); text-align: left; cursor: pointer; }
.profile b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.profile small { display: block; color: var(--ink-3); font-size: 12.5px; }
.profile .i { width: 18px; height: 18px; margin-left: 6px; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  min-width: 210px;
  padding: 6px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 18px 50px rgb(20 26 26 / 0.16);
}
.menu a, .menu button { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border: 0; border-radius: 12px; background: none; text-decoration: none; text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--soft); }

.page { max-width: 1480px; margin: 0 auto; padding: 18px 28px 40px; }

/* ---------- pozdrav i radnje */

.hero { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 26px; }
.hello { font-size: 18px; }
.greet { margin-top: 2px; font-size: 48px; font-weight: 450; letter-spacing: -0.035em; line-height: 1.05; }
.actions { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 999px; background: var(--card); }
.today { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px 0 14px; border-radius: 999px; background: var(--soft); }
.today small { display: block; color: var(--ink-3); font-size: 11.5px; line-height: 1.1; }
.today b { display: block; font-size: 14px; font-weight: 500; line-height: 1.2; }

/* ---------- pregled */

.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.col { display: grid; grid-template-rows: auto 1fr; gap: 18px; }
.col-main > .card { display: flex; flex-direction: column; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stat-ic { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--card); }
.stat-ic .i { width: 22px; height: 22px; }
.stat > div { min-width: 0; }
.stat-num { display: flex; align-items: baseline; gap: 7px; font-size: 30px; font-weight: 450; letter-spacing: -0.03em; line-height: 1.1; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--green); white-space: nowrap; }
.delta .i { width: 15px; height: 15px; }
.delta.zero { color: var(--ink-3); }
.stat-label { color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--k); }

.chart { --k1: var(--black); --k2: var(--blue-pale); position: relative; flex: 1; display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: minmax(230px, 1fr) auto; column-gap: 10px; }
.chart-y { position: relative; }
.chart-y span { position: absolute; right: 0; transform: translateY(50%); color: var(--ink-3); font-size: 12px; }
.plot { position: relative; display: flex; align-items: flex-end; justify-content: space-around; }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.day { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; flex: 1; height: 100%; cursor: default; }
.bar { width: min(20px, 34%); min-height: 3px; border-radius: 5px 5px 0 0; background: var(--k1); transition: opacity 0.15s; }
.bar.b2 { background: var(--k2); }
.plot:hover .day:not(:hover) .bar { opacity: 0.45; }
.chart-x { grid-column: 2; display: flex; justify-content: space-around; padding-top: 10px; }
.chart-x span { flex: 1; text-align: center; color: var(--ink-2); font-size: 13px; }
.chart-x span.is-today { color: var(--ink); font-weight: 600; }
.tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  display: none;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--black);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
}
.tip b { display: block; font-weight: 600; }
.tip i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--k); }
.day:hover .tip, .day:focus-visible .tip { display: block; }

.gauge { position: relative; margin: 4px auto 0; max-width: 300px; }
.gauge svg { display: block; width: 100%; height: auto; }
.gauge-center { position: absolute; left: 0; right: 0; bottom: 4px; display: grid; justify-items: center; gap: 4px; text-align: center; }
.gauge-center b { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.gauge-center span { font-size: 13px; color: var(--ink-3); }

.couriers { position: relative; overflow: hidden; min-height: 236px; }
.couriers-num { display: flex; align-items: baseline; gap: 10px; font-size: 40px; font-weight: 450; letter-spacing: -0.03em; }
.couriers .sub2 { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.stackav { display: flex; margin-top: 16px; }
.stackav .avatar { width: 34px; height: 34px; margin-right: -8px; border: 2px solid var(--card); font-size: 12px; }
.onroute { position: absolute; left: 22px; bottom: 20px; display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 13.5px; font-weight: 500; }
.onroute i { width: 14px; height: 14px; border: 3px solid var(--green); border-radius: 50%; }
.onroute.off { color: var(--ink-3); }
.onroute.off i { border-color: var(--ink-3); }
.van { position: absolute; right: -6px; bottom: 6px; width: 62%; max-width: 230px; }

.track { display: flex; flex-direction: column; }
.qr-box { display: grid; place-items: center; height: 168px; border-radius: 18px; background: var(--soft); }
.qr-box img { width: 132px; height: 132px; mix-blend-mode: multiply; }
.track-id { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 18px 0 14px; }
.track-id small { display: block; color: var(--ink-3); font-size: 13px; }
.track-id b { display: block; font-size: 19px; font-weight: 600; letter-spacing: 0.01em; }
.steps { display: grid; gap: 0; margin: 0 0 16px; padding: 0; list-style: none; }
.steps li { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 0 0 14px 24px; }
.steps li::before { content: ''; position: absolute; left: 2px; top: 5px; width: 9px; height: 9px; border: 1.5px solid #c9cccc; border-radius: 50%; background: var(--card); }
.steps li::after { content: ''; position: absolute; left: 6px; top: 17px; bottom: 0; border-left: 1.5px dashed #d6d8d8; }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps li.done::before { border-color: var(--red); background: var(--red); }
.steps li.done::after { border-left-color: var(--red); }
.steps small { color: var(--ink-3); font-size: 12.5px; }
.steps b { grid-column: 1; font-size: 14px; font-weight: 500; }
.steps time { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 13.5px; font-weight: 500; }
.steps li:not(.done) time { color: var(--ink-3); }
.person { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 6px; border-radius: 999px; background: var(--soft); }
.person > div { flex: 1; min-width: 0; }
.person small { display: block; color: var(--ink-3); font-size: 12px; }
.person b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-card { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 260px; color: var(--ink-3); text-align: center; }
.empty-card .i { width: 34px; height: 34px; color: var(--ink-3); }

/* ---------- tabela paketa */

.table-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.search { position: relative; width: min(340px, 100%); }
.search .i { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-3); }
.search .input { height: 44px; padding-left: 42px; border-radius: 999px; }
.table-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.pills { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--soft); overflow-x: auto; max-width: 100%; }
.pills button { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font-weight: 500; white-space: nowrap; cursor: pointer; }
.pills button:hover { background: var(--soft-2); }
.pills button span { color: var(--ink-3); font-size: 12.5px; }
.pager { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  height: 48px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
th:first-child { border-left: 1px solid var(--line); border-radius: 999px 0 0 999px; padding-left: 18px; }
th:last-child { border-right: 1px solid var(--line); border-radius: 0 999px 999px 0; }
.sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font-weight: 500; cursor: pointer; }
.sort .i { width: 16px; height: 16px; color: var(--ink-3); }
.sort[data-dir] .i { color: var(--ink); }
td { padding: 15px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td:first-child { padding-left: 18px; }
.rows tr[data-id] { cursor: pointer; transition: background-color 0.12s; }
.rows tr[data-id]:hover { background: #fafaf9; }
.rows tr.is-selected { background: var(--blue-paler); }
.rows tr.flash { animation: row-flash 1.8s ease-out; }
@keyframes row-flash { from { background: var(--p-u_dostavi); } }
.rows .code { font-size: 14.5px; }
.c-check { width: 52px; }
.num { text-align: right; white-space: nowrap; }
.sub-line { color: var(--ink-3); font-size: 13px; }
.empty td { padding: 56px 24px; text-align: center; cursor: default; }
.empty-box { display: grid; justify-items: center; gap: 12px; color: var(--ink-2); }
.empty-box b { color: var(--ink); font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }

.selbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 22px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  box-shadow: 0 18px 44px rgb(20 26 26 / 0.3);
  white-space: nowrap;
}
.selbar .btn { height: 42px; }
.selbar .btn-light { background: #fff; border-color: #fff; color: var(--ink); margin-left: 10px; }
.selbar .btn-ghost { color: #c9cfcf; }
.selbar .btn-ghost:hover { background: #2a3232; color: #fff; }

/* ---------- detalj paketa */

.detail-code { font-size: 26px; font-weight: 600; letter-spacing: 0.01em; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; margin: 0; padding: 16px 18px; border-radius: 18px; background: var(--soft); }
.facts dt { color: var(--ink-3); font-size: 13.5px; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- štampa: izbor formata */

.formats { display: grid; gap: 10px; }
.fmt { display: grid; grid-template-columns: 58px 1fr; gap: 14px; align-items: center; padding: 14px 16px; border: 1.5px solid transparent; border-radius: 18px; background: var(--soft); cursor: pointer; }
.fmt:hover { background: var(--soft-2); }
.fmt:has(input:checked) { border-color: var(--black); background: var(--card); }
.fmt:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.fmt input { position: absolute; opacity: 0; pointer-events: none; }
.fmt b { font-weight: 600; }
.fmt small { display: block; color: var(--ink-3); font-size: 13px; }
.fmt-shape { position: relative; justify-self: center; border: 1.5px solid var(--ink-2); border-radius: 3px; background: #fff; }
.fmt-shape::after { content: ''; position: absolute; border-radius: 1px; background: var(--ink); }
.fmt-shape[data-f='t150'] { width: 32px; height: 48px; }
.fmt-shape[data-f='t150']::after { width: 18px; height: 18px; left: 6px; top: 5px; }
.fmt-shape[data-f='t50'] { width: 50px; height: 25px; }
.fmt-shape[data-f='t50']::after { width: 15px; height: 15px; left: 4px; top: 4px; }
.fmt-shape[data-f='a4'] {
  width: 36px;
  height: 50px;
  background: repeating-linear-gradient(90deg, transparent 0 11px, var(--line) 11px 12px),
    repeating-linear-gradient(0deg, transparent 0 5.6px, var(--line) 5.6px 6.2px), #fff;
}
.fmt-shape[data-f='a4']::after { display: none; }
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }

/* ---------- radnici i podešavanja */

.page-title { margin-bottom: 24px; }
.page-title h1 { font-size: 44px; font-weight: 450; letter-spacing: -0.035em; line-height: 1.05; }
.page-title p { color: var(--ink-2); margin-top: 8px; max-width: 640px; }
.narrow { max-width: 1000px; }
.user-form { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.users td { vertical-align: middle; }
.users .actions-cell { display: flex; justify-content: flex-end; gap: 6px; }
.person-cell { display: flex; align-items: center; gap: 12px; }
.inactive .person-cell, .inactive td:nth-child(2) { opacity: 0.5; }

.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings .card { display: grid; gap: 14px; }
.settings .wide { grid-column: 1 / -1; }
.settings p { color: var(--ink-2); }
.inline-form { display: flex; gap: 10px; }
.steps-list { display: grid; gap: 8px; margin: 0; padding-left: 20px; color: var(--ink-2); }
.links { display: flex; flex-wrap: wrap; gap: 14px; }
.link-card { display: grid; justify-items: center; gap: 8px; padding: 16px; border-radius: 20px; background: var(--soft); text-align: center; }
.link-card img { width: 170px; height: 170px; mix-blend-mode: multiply; }
.link-card b { font-size: 13.5px; font-weight: 600; }
.link-card a { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }

/* ---------- klijenti */

.client-chip { display: flex; align-items: center; gap: 9px; height: 50px; padding: 0 20px 0 16px; border-radius: 999px; background: var(--card); font-weight: 600; white-space: nowrap; }
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; }
.shop-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; }
.shop-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.shop-state[data-ok='true'] i { background: var(--green); }
.shop-state[data-ok='false'] { color: var(--red); }
.shop-state[data-ok='false'] i { background: var(--red); }
.guide { display: grid; gap: 10px; margin: 0; padding: 14px 16px 14px 34px; border-radius: 16px; background: var(--soft); color: var(--ink-2); font-size: 13.5px; }
.guide b { color: var(--ink); }
.guide code { background: var(--card); }
.client-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-bottom: 18px; }

/* ---------- pokreti na pregledu */

/* Stubići izrastu iz osnove samo pri prvom učitavanju (jedan orkestriran trenutak, ne na svaki sken). */
.chart.enter .bar { transform-origin: 50% 100%; animation: grow 520ms var(--ease-out) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes grow { from { transform: scaleY(0.04); } }
.gauge-fill { transition: stroke-dasharray 700ms var(--ease-out); }

/* Traka koraka u detalju paketa (kao „Confirmed → On the way → Delivered”) */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; padding-top: 4px; }
.stepper::before, .stepper-fill { content: ''; position: absolute; left: 12.5%; right: 12.5%; top: 11px; height: 3px; border-radius: 3px; background: var(--soft-2); }
.stepper-fill { background: var(--black); transform-origin: 0 50%; transform: scaleX(var(--done, 0)); transition: transform 450ms var(--ease-out); }
.stepper span { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; color: var(--ink-3); font-size: 12.5px; text-align: center; }
.stepper span::before { content: ''; width: 17px; height: 17px; border: 3px solid var(--card); border-radius: 50%; background: var(--soft-2); box-shadow: 0 0 0 1px var(--line); }
.stepper span.done { color: var(--ink); font-weight: 500; }
.stepper span.done::before { background: var(--black); box-shadow: 0 0 0 1px var(--black); }
.stepper span.now::before { background: var(--c, var(--black)); box-shadow: 0 0 0 1px var(--c, var(--black)), 0 0 0 6px var(--p, var(--soft)); }

.empty-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--soft); color: var(--ink-2); }
.empty-ic .i { width: 28px; height: 28px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ---------- PIN tastatura (prijava na telefonu, kao kod bankarskih aplikacija) */

.pin-dots { display: flex; justify-content: center; gap: 14px; height: 18px; margin: 4px 0 6px; }
.pin-dots i { width: 14px; height: 14px; border: 1.5px solid var(--ink-2); border-radius: 50%; transition: background-color 120ms ease, transform 160ms var(--ease-out); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); transform: scale(1.12); }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); justify-content: center; gap: 14px 22px; }
.key {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  font-size: 28px;
  font-weight: 450;
  cursor: pointer;
  transition: background-color 120ms ease, transform 140ms var(--ease-out);
  touch-action: manipulation;
}
.key:active { background: var(--soft-2); transform: scale(0.94); }
.key.ghost { background: transparent; }
.key.go { background: var(--black); color: #fff; }
.key .i { width: 26px; height: 26px; }

/* ---------- uži ekrani */

@media (max-width: 1240px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-main { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; padding: 14px 16px 4px; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-self: start; overflow-x: auto; max-width: 100%; }
  .profile b, .profile small, .profile .i { display: none; }
  .profile { padding: 5px; }
  .page { padding: 14px 16px 100px; }
  .greet { font-size: 36px; }
  .actions { width: 100%; overflow-x: auto; }
  .today { display: none; }
  .dash { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-chip { display: none; }
  .client-form { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .grid-2, .user-form, .settings { grid-template-columns: 1fr; }
  .pager { width: 100%; justify-content: space-between; }
  .card { padding: 18px 16px; }
  td, th { padding-left: 8px; padding-right: 8px; }
  td:first-child, th:first-child { padding-left: 12px; }
  .c-check { width: 36px; }
  .rows td:last-child, #pkg-head th:last-child { display: none; }
  #pkg-head th:nth-last-child(2) { border-right: 1px solid var(--line); border-radius: 0 999px 999px 0; }
  .selbar { left: 12px; right: 12px; transform: none; justify-content: space-between; padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
