:root {
  --navy: #14305a;
  --navy-2: #1d4373;
  --navy-soft: #e9eef6;
  --orange: #e2731f;
  --orange-2: #c75f12;
  --orange-soft: #fdf1e6;
  --ink: #1a2433;
  --muted: #64728a;
  --line: #e2e7ef;
  --line-2: #eef1f6;
  --bg: #f3f5f9;
  --card: #ffffff;
  --green: #18855a; --green-soft: #e3f5ec;
  --red: #c8372d;   --red-soft: #fdeceb;
  --amber: #a86400; --amber-soft: #fff4dc;
  --slate-soft: #eef0f4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20,48,90,.05), 0 8px 24px -14px rgba(20,48,90,.25);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
a { color: var(--navy-2); }

/* ---------- Dugmad i polja ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-weight: 600; font-size: 14.5px; white-space: nowrap; text-decoration: none; color: var(--ink);
  transition: background .12s, border-color .12s, transform .08s;
}
.btn:hover { background: #f7f9fc; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-2); }
.btn-danger { color: var(--red); border-color: #f2c9c5; }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none;
  border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--navy-soft); color: var(--navy); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn.sm svg.i { width: 15px; height: 15px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field > span em { font-style: normal; font-weight: 400; color: #98a3b5; }
.input, select.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; font-size: 16px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29,67,115,.14); }
select.input {
  appearance: none; padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%2364728a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; user-select: none; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--line-2); padding: 4px; border-radius: 12px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: grid; place-items: center; text-align: center; min-height: 40px; padding: 4px 6px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; line-height: 1.2;
}
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,48,90,.15); }
.seg input:checked + span.s-paid { color: var(--green); }
.seg input:checked + span.s-unpaid { color: var(--red); }
.seg input:checked + span.s-exempt { color: var(--amber); }

.error-msg { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 500; margin-bottom: 14px; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(90% 60% at 50% 0%, #fff 0%, var(--bg) 70%); }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 30px 26px 26px; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--navy) 0 62%, var(--orange) 62%); }
.login-logos { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 22px; }
.login-logos img { height: auto; min-width: 0; }
.login-logos .l-hores { width: 38%; max-width: 150px; }
.login-logos .l-kongres { width: 52%; max-width: 210px; }
.login-logos .sep { width: 1px; height: 50px; background: var(--line); }
.login-card h1 { margin: 0 0 4px; text-align: center; color: var(--navy); font: 600 19px/1.3 Cinzel, Georgia, serif; letter-spacing: .04em; }
.login-card .sub { margin: 0 0 22px; text-align: center; color: var(--muted); font-size: 14px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 50px; }
.pw-wrap .icon-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.login-foot { margin: 22px 0 0; text-align: center; }
.login-foot img { width: 100%; height: auto; opacity: .85; }

/* ---------- Admin layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 16px 8px; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .burger { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .brand img { height: 34px; width: auto; }
.topbar .brand .t { font-weight: 700; color: var(--navy); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(12,24,44,.4); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer {
  position: fixed; inset: 0 auto 0 0; width: min(310px, 86vw); background: #fff; z-index: 41;
  transform: translateX(-110%); transition: transform .22s ease, visibility .22s; display: flex; flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) 14px 18px; box-shadow: 10px 0 40px rgba(12,24,44,.2); visibility: hidden;
}
body.drawer-open .drawer { transform: none; visibility: visible; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer .d-logos { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.drawer .d-logos img:first-child { height: 34px; }
.drawer .d-logos img:last-child { height: 46px; }
.drawer nav { display: flex; flex-direction: column; gap: 2px; }
.drawer nav a, .drawer nav button {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 12px; text-decoration: none;
  color: var(--ink); font-weight: 600; font-size: 15px; border: 0; background: none; text-align: left; width: 100%;
}
.drawer nav a:hover, .drawer nav button:hover { background: var(--line-2); }
.drawer nav a.active { background: var(--navy-soft); color: var(--navy); }
.drawer nav svg.i { color: var(--muted); width: 20px; height: 20px; }
.drawer nav a.active svg.i { color: var(--navy); }
.drawer .d-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.drawer .d-user { margin-top: auto; padding: 12px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

.wrap { max-width: 1500px; margin: 0 auto; padding: 18px 16px 80px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 22px; color: var(--navy); flex: 1; min-width: 160px; }

/* Statistika */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); border: 1px solid transparent; text-align: left; }
button.stat { cursor: pointer; }
button.stat:hover { border-color: var(--line); }
.stat b { display: block; font-size: 22px; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; line-height: 1.25; display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.stat.g b { color: var(--green); } .stat.r b { color: var(--red); } .stat.a b { color: var(--amber); } .stat.o b { color: var(--orange); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Filteri */
.filters { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 18px; }
.filters .f-top { display: flex; gap: 10px; }
.filters .search { position: relative; flex: 1; }
.filters .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filters .search .input { padding-left: 40px; }
.filters .f-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.filters .f-grid .input { min-height: 42px; font-size: 14.5px; }
.filters .f-grid .input.on { border-color: var(--navy-2); background-color: var(--navy-soft); font-weight: 600; }
.filters .f-toggle { display: none; }
.filters .f-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
  .filters .f-toggle { display: inline-flex; }
  .filters .f-grid { grid-template-columns: 1fr 1fr; }
  .filters:not(.open) .f-grid { display: none; }
}
.badge-n { background: var(--orange); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; }

/* Hotel kutije */
.hbox { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line-2); }
.hbox-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfe, #f6f8fb);
}
.hbox-head .h-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; }
.hbox-head .h-ico svg.i { width: 20px; height: 20px; }
.hbox-head .h-t { flex: 1; min-width: 0; }
.hbox-head h2 { margin: 0; font-size: 17px; color: var(--navy); line-height: 1.25; overflow-wrap: anywhere; }
.hbox-head .h-sub { font-size: 12.5px; color: var(--muted); }
.hbox-empty { padding: 18px 16px; color: var(--muted); font-size: 14px; }

.mhead, .mrow {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: minmax(160px, 1.2fr) minmax(190px, 1.4fr) 100px 142px 84px 170px 170px 138px;
  padding: 10px 16px;
}
.mhead { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: #8b97ab; font-weight: 700; padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line-2); }
.mrow { border-bottom: 1px solid var(--line-2); transition: background .1s; }
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: #fafbfd; }
.m-name b { display: block; font-size: 15px; line-height: 1.3; }
.m-name small { color: var(--muted); font-size: 12.5px; display: block; }
.m-contact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cline { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13.5px; }
.cline a { color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cline a:hover { color: var(--navy-2); text-decoration: underline; }
.cline .muted { color: #a3adbd; }
.m-actions { display: flex; gap: 2px; justify-content: flex-end; }
.m-lbl { display: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; border: 1px solid transparent; background: var(--slate-soft); color: var(--muted); white-space: nowrap;
}
button.pill:hover { filter: brightness(.97); border-color: rgba(0,0,0,.06); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.paid { background: var(--green-soft); color: var(--green); }
.pill.unpaid { background: var(--red-soft); color: var(--red); }
.pill.exempt { background: var(--amber-soft); color: var(--amber); }
.pill.yes { background: var(--green-soft); color: var(--green); }
.pill.no { background: var(--slate-soft); color: #8892a3; }
.pill.role { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.pill.in { background: var(--green-soft); color: var(--green); }
.pill svg.i { width: 15px; height: 15px; }

@media (max-width: 1360px) {
  .mhead { display: none; }
  .mrow {
    grid-template-columns: 1fr auto; grid-template-areas:
      "name actions" "contact contact" "chips chips";
    gap: 8px 10px; padding: 14px 14px;
  }
  .m-name { grid-area: name; } .m-actions { grid-area: actions; align-self: start; }
  .m-contact { grid-area: contact; }
  .m-chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 8px 8px; }
  .m-chips > div { display: flex; align-items: center; gap: 6px; }
  .m-lbl { display: inline; font-size: 11px; color: #8b97ab; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
  .cline { font-size: 14px; }
}
@media (min-width: 1361px) { .m-chips { display: contents; } }

/* Tabele za ostale strane */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.panel-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 16px; color: var(--navy); flex: 1; }
.panel-body { padding: 16px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; overflow-wrap: anywhere; }
.list-row .grow small { color: var(--muted); font-size: 12.5px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 200px; }
.daytabs { display: flex; gap: 8px; flex-wrap: wrap; }
.daytabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12,24,44,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0;
  padding: 20px 18px max(18px, env(safe-area-inset-bottom)); animation: up .2s ease; -webkit-overflow-scrolling: touch;
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 18px; color: var(--navy); flex: 1; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: 22px; padding: 22px 24px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }

.dropzone {
  border: 2px dashed var(--line); border-radius: 14px; padding: 14px; display: flex; align-items: center; gap: 12px;
  background: #fbfcfe; cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--navy-2); background: var(--navy-soft); }
.dropzone .dz-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--orange-soft); color: var(--orange); display: grid; place-items: center; flex: none; }
.dropzone .dz-t { flex: 1; min-width: 0; font-size: 14px; }
.dropzone .dz-t b { display: block; overflow-wrap: anywhere; }
.dropzone .dz-t small { color: var(--muted); }

/* Popover meni */
.menu {
  position: fixed; z-index: 70; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(12,24,44,.22);
  border: 1px solid var(--line); padding: 6px; min-width: 190px; animation: fade .1s;
}
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font-weight: 600; font-size: 14px; text-align: left; }
.menu button:hover { background: var(--line-2); }
.menu button .dot { width: 9px; height: 9px; border-radius: 50%; }

/* PDF pregled */
.pdf-thumb { position: fixed; z-index: 65; width: 220px; background: #fff; border-radius: 12px; box-shadow: 0 16px 44px rgba(12,24,44,.3); padding: 8px; pointer-events: none; animation: fade .12s; }
.pdf-thumb canvas, .pdf-prev canvas { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); }
.pdf-thumb small { display: block; text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.pdf-prev { background: var(--line-2); border-radius: 12px; padding: 12px; min-height: 160px; display: grid; place-items: center; }

/* Toast */
.toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: up .18s ease; }
.toast.err { background: var(--red); }

.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--orange); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: grid; place-items: center; padding: 80px 0; }

/* ---------- Skener ---------- */
.scan-page { background: #0d1a2e; color: #fff; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.scan-top { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
.scan-top .logos { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 6px 10px; }
.scan-top .logos img:first-child { height: 24px; width: auto; } .scan-top .logos img:last-child { height: 32px; width: auto; }
.scan-top .spacer { flex: 1; }
.scan-top .icon-btn { color: #c5d0e2; width: 42px; height: 42px; }
.scan-top .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.scan-count { text-align: center; font-size: 13px; color: #9fb0c9; padding: 0 16px 10px; }
.scan-count b { color: #fff; font-size: 15px; }
.scan-stage { position: relative; margin: 0 14px; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 1; max-height: 62vh; max-width: 560px; align-self: center; width: calc(100% - 28px); }
#reader { width: 100%; height: 100%; }
#reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
#reader > div { display: none !important; }
.scan-frame { position: absolute; inset: 14%; pointer-events: none; border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.28); }
.scan-frame::before, .scan-frame::after { content: ""; position: absolute; inset: 0; border-radius: 18px; border: 3px solid transparent; }
.scan-frame i { position: absolute; width: 38px; height: 38px; border: 4px solid var(--orange); }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.scan-line { position: absolute; left: 16%; right: 16%; height: 2px; background: linear-gradient(90deg, transparent, var(--orange), transparent); top: 20%; animation: scanl 2.2s ease-in-out infinite alternate; }
@keyframes scanl { to { top: 78%; } }
.cam-start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: #0d1a2e; }
.cam-start p { margin: 0; color: #b9c6db; font-size: 14.5px; max-width: 300px; }
.cam-start .btn { min-height: 56px; font-size: 17px; padding: 0 26px; border-radius: 16px; }
.scan-hint { text-align: center; color: #9fb0c9; font-size: 14px; padding: 14px 20px 6px; }
.scan-manual { display: flex; justify-content: center; padding: 4px 16px 10px; }
.scan-manual .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #e6ecf5; }
.recent { margin: 6px 14px max(16px, env(safe-area-inset-bottom)); max-width: 560px; align-self: center; width: calc(100% - 28px); }
.recent h4 { margin: 8px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #7d8ea9; }
.recent .r { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); margin-bottom: 6px; font-size: 14px; }
.recent .r small { color: #9fb0c9; display: block; }
.recent .r time { color: #9fb0c9; font-variant-numeric: tabular-nums; }

.result { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(8,16,30,.72); animation: fade .12s; }
.result-card { width: 100%; max-width: 420px; background: #fff; color: var(--ink); border-radius: 26px; padding: 30px 24px 22px; text-align: center; animation: pop .22s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.88); opacity: .4; } }
.result-ico { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; }
.result-ico svg { width: 46px; height: 46px; }
.result.ok .result-ico { background: var(--green-soft); color: var(--green); }
.result.already .result-ico { background: var(--amber-soft); color: var(--amber); }
.result.err .result-ico { background: var(--red-soft); color: var(--red); }
.result-card .status { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px; }
.result.ok .status { color: var(--green); } .result.already .status { color: var(--amber); } .result.err .status { color: var(--red); }
.result-card h2 { margin: 0; font: 600 28px/1.15 Cinzel, Georgia, serif; color: var(--navy); overflow-wrap: anywhere; }
.result-card .meta { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.result-card .chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.result-card .time { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.result-card .btn { margin-top: 20px; min-height: 54px; font-size: 16px; }
.result-loader { display: flex; flex-direction: column; align-items: center; gap: 16px; color: #fff; font-weight: 600; }
.result-loader .spin { width: 46px; height: 46px; border-color: rgba(255,255,255,.2); border-top-color: var(--orange); border-width: 4px; }
.result-bar { height: 4px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin-top: 16px; }
.result-bar i { display: block; height: 100%; background: var(--navy-2); width: 100%; transform-origin: left; animation: shrink 3.2s linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }

.search-results .list-row { cursor: pointer; }
.search-results .list-row:hover { background: var(--line-2); }

/* Slanje akreditacije: mejl + Viber */
.m-send { display: flex; align-items: center; gap: 6px; }
.send-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: 12.5px; font-weight: 700; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.send-btn svg.i { width: 15px; height: 15px; }
.send-btn:hover { background: var(--navy-soft); border-color: #c9d4e6; }
.send-btn.sent { color: var(--green); background: var(--green-soft); border-color: transparent; }
.send-btn.viber { color: #7360f2; }
.send-btn.viber:hover { background: #f1efff; border-color: #d9d3ff; }
.send-btn[disabled] { opacity: .45; pointer-events: none; }
.send-to { background: var(--line-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 2px; }
.send-to span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.send-warn { display: flex; gap: 8px; align-items: flex-start; background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 500; margin: 0 0 14px; }

/* Otkazano učešće */
.pill.x { background: var(--red-soft); color: var(--red); height: 22px; padding: 0 8px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
.stat.x b { color: var(--red); }
.mrow.cancelled { background: #fdf3f2; box-shadow: inset 4px 0 0 var(--red); }
.mrow.cancelled:hover { background: #fbecea; }
.mrow.cancelled .m-name b { color: var(--red); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.mrow.cancelled .m-name .pill.x { margin: 3px 0 2px; }
.mrow.cancelled .m-contact, .mrow.cancelled .m-chips > div:not(.m-send) { opacity: .6; }
.hbox.cancelled { border-color: #f2c9c5; }
.hbox.cancelled .hbox-head { background: linear-gradient(180deg, #fdf1ef, #fbe7e4); border-bottom-color: #f2c9c5; }
.hbox.cancelled .h-ico { background: var(--red); }
.hbox.cancelled h2 { color: var(--red); }
.hbox.cancelled .mrow.cancelled { box-shadow: none; }
.canc-n { color: var(--red); font-weight: 600; }
.hbox-head .icon-btn { width: 36px; height: 36px; }
@media (max-width: 640px) {
  .hbox-head { padding: 12px 10px 12px 14px; gap: 10px; }
  .hbox-head [data-add] { width: 38px; min-height: 38px; padding: 0; }
  .hbox-head [data-add] span { display: none; }
}

/* Slanje: "Poslato ..." ispod dugmadi + istorija */
.send-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.send-wrap.end { align-items: flex-end; }
.send-row { display: flex; gap: 6px; }
.sent-meta { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--green); white-space: nowrap; }
.sent-meta svg.i { width: 13px; height: 13px; }
.hist-btn { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 10.5px; }
.hist-btn:hover { background: var(--navy-soft); color: var(--navy); }
.hist-btn svg.i { width: 12px; height: 12px; }
.hist-menu { padding: 8px; min-width: 240px; max-height: 320px; overflow: auto; }
.hist-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 8px 6px; }
.hist-row { padding: 7px 8px; border-radius: 8px; display: flex; flex-direction: column; font-size: 13px; }
.hist-row + .hist-row { border-top: 1px solid var(--line-2); }
.hist-row span { color: var(--muted); font-size: 12px; }

/* Račun */
.inv-cell { display: flex; align-items: center; gap: 2px; }
.send-btn.inv-dl { text-decoration: none; color: var(--navy); font-variant-numeric: tabular-nums; }
.send-btn.inv-new { color: var(--orange-2); }
.send-btn.inv-new:hover { background: var(--orange-soft); border-color: #f3cfae; }
.row-pc { display: grid; grid-template-columns: 140px 1fr; gap: 0 12px; }
.inv-no { display: flex; align-items: center; gap: 10px; }
.inv-no .input { max-width: 160px; font-variant-numeric: tabular-nums; }
.inv-no span { color: var(--muted); font-weight: 600; }
.hint-sm { margin: -4px 0 14px; font-size: 12.5px; color: var(--muted); }

/* Datepicker */
.dp { position: relative; }
.dp-field { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-field svg.i { color: var(--muted); }
.dp-pop { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(12,24,44,.18); padding: 10px; animation: fade .12s; }
.dp-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.dp-head b { font-size: 14.5px; color: var(--navy); }
.dp-head button { width: 32px; height: 32px; border: 0; background: none; border-radius: 8px; font-size: 20px; line-height: 1; color: var(--muted); }
.dp-head button:hover { background: var(--line-2); color: var(--navy); }
.dp-wd, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd span { text-align: center; font-size: 11px; font-weight: 700; color: #98a3b5; padding: 4px 0; }
.dp-grid button { height: 34px; border: 0; background: none; border-radius: 9px; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink); }
.dp-grid button:hover { background: var(--navy-soft); }
.dp-grid button.today { color: var(--orange-2); font-weight: 700; }
.dp-grid button.sel { background: var(--navy); color: #fff; font-weight: 700; }
.dp-foot { display: flex; justify-content: flex-end; padding-top: 6px; border-top: 1px solid var(--line-2); margin-top: 6px; }
.dp-foot button { border: 0; background: none; color: var(--navy-2); font-weight: 600; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.dp-foot button:hover { background: var(--navy-soft); }
@media (max-width: 1360px) {
  .m-chips .m-send, .m-chips .m-inv { align-items: flex-start; }
  .m-chips .m-send .m-lbl, .m-chips .m-inv .m-lbl { margin-top: 8px; }
}

/* Skener: ručna pretraga (tamna stranica, svetao prozor) */
.scan-page .modal { color: var(--ink); }
.scan-page .modal .input { color: var(--ink); background: #fff; }
.scan-page .modal-backdrop { align-items: flex-start; padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
.scan-page .modal { border-radius: 20px; max-height: calc(100dvh - 24px); padding: 18px 16px 12px; }
.scan-page .modal .field { margin-bottom: 8px; }
.search-results { margin: 0 -16px; }
.search-results .list-row { padding: 12px 16px; gap: 12px; min-height: 60px; }
.search-results .list-row .grow b { font-size: 16px; color: var(--ink); }
.search-results .list-row .grow small { display: block; margin-top: 2px; }
.search-results .list-row .btn { flex: none; min-height: 40px; padding: 0 16px; }
.search-results .empty { padding: 24px 16px; }
.dp-pop { position: fixed; top: auto; left: auto; }

/* Račun objekta */
.inv-obj {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 8px;
  background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; text-decoration: none;
}
.inv-obj svg.i { width: 14px; height: 14px; }
.inv-obj:hover { filter: brightness(.96); }
.btn.inv-view { color: var(--green); border-color: #bfe3cf; background: var(--green-soft); text-decoration: none; }
.btn.inv-view:hover { filter: brightness(.97); }
.btn.inv-hnew { color: var(--muted); }
.btn.inv-hnew:hover { color: var(--navy); background: var(--navy-soft); }
.inv-total { min-height: 46px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px; background: var(--line-2); font-weight: 700; font-size: 16px; color: var(--navy); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .hbox-head .inv-view, .hbox-head .inv-hnew { width: 38px; min-height: 38px; padding: 0; }
  .hbox-head .inv-view span, .hbox-head .inv-hnew span { display: none; }
}

/* Brzo biranje cene */
.price-row { display: flex; gap: 8px; align-items: center; }
.price-row .input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.price-chip {
  flex: none; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  font-weight: 700; font-size: 14px; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background .12s, border-color .12s, color .12s;
}
.price-chip:hover { background: var(--navy-soft); border-color: #c9d4e6; }
.price-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (max-width: 420px) { .price-chip { padding: 0 10px; font-size: 13px; } }
