:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1f2933; --muted: #6b7280; --line: #e3e6ea;
  --brand: #0f766e; --brand-ink: #fff; --ok: #15803d; --ok-bg: #dcfce7; --bad: #b91c1c; --bad-bg: #fee2e2;
  --warn: #a16207; --warn-bg: #fef3c7; --info-bg: #e0f2fe; --info: #0369a1;
  --radius: 10px; font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.4; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .8rem; } h2 { font-size: 1.1rem; margin: 1rem 0 .6rem; } h3 { font-size: .95rem; margin: .8rem 0 .5rem; }
section > h2:first-child, .card > h2:first-child, .card > h3:first-child { margin-top: 0; }
code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.dim { opacity: .5; }

.top { display: flex; align-items: center; gap: 1.2rem; background: #111827; color: #fff; padding: .6rem 1.2rem; flex-wrap: wrap; }
.top .brand { font-weight: 700; }
.top nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.top nav a, .top .who a { color: #cbd5e1; padding: .35rem .7rem; border-radius: 6px; }
.top nav a.on, .top nav a:hover { background: #374151; color: #fff; text-decoration: none; }
.top .admin-link { color: #fcd34d !important; }
.top .who { display: flex; gap: .4rem; align-items: center; color: #9ca3af; font-size: .9rem; }
.banner { background: var(--warn-bg); color: var(--warn); padding: .5rem 1.2rem; font-weight: 600; }
.banner.danger { background: var(--bad-bg); color: var(--bad); }

main { padding: 1.2rem; max-width: 1400px; margin: 0 auto; }
main.center { display: flex; justify-content: center; padding-top: 12vh; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.card.narrow { max-width: 520px; } .card.warn { border-color: #f59e0b; }
.login { width: 340px; }
.flash { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .8rem; background: var(--info-bg); color: var(--info); }
.flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.err { background: var(--bad-bg); color: var(--bad); }

label { display: block; margin-bottom: .6rem; font-size: .9rem; color: #374151; }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; border: 1px solid #cfd4da; border-radius: 7px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99f6e4; border-color: var(--brand); }
input[readonly] { background: #f8f9fa; }
label.check, label.radio { display: flex; gap: .5rem; align-items: flex-start; }
label.check input, label.radio input { width: auto; margin-top: .2rem; }
.num { max-width: 110px; }
.btn { display: inline-block; padding: .5rem .9rem; border: 1px solid #cfd4da; background: #fff; color: var(--ink); border-radius: 7px; cursor: pointer; font: inherit; font-weight: 500; }
.btn:hover { background: #f1f3f5; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); } .btn.primary:hover { background: #115e59; }
.btn.danger { color: var(--bad); border-color: #fca5a5; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; } .btn.big { padding: .75rem 1.3rem; font-size: 1.05rem; } .btn.wide { width: 100%; }
.btn.file { position: relative; overflow: hidden; } .btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
form.inline { display: inline; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; } .row > label { flex: 1; min-width: 160px; }
.row.tight { gap: .3rem; align-items: center; } .row.tight input { width: auto; margin: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .25rem 0; }
.stack > * { margin-bottom: .5rem; }
.filters { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; min-width: 220px; margin: 0; } .filters label { margin: 0; }

.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 2px solid var(--line); padding: .5rem; }
.table td { border-bottom: 1px solid var(--line); padding: .5rem; vertical-align: middle; }
.table td input { margin: 0; }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef0f2; color: #374151; }
.pill.aktivan, .pill.aktivna { background: var(--ok-bg); color: var(--ok); }
.pill.istekao, .pill.istekla, .pill.otkazana, .pill.potroseni_dolasci, .pill.nema { background: var(--bad-bg); color: var(--bad); }
.pill.zamrznut, .pill.zamrznuta { background: var(--info-bg); color: var(--info); }
.pill.buduca { background: var(--warn-bg); color: var(--warn); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; } .form-grid .actions { grid-column: 1 / -1; display: flex; gap: .6rem; }

/* recepcija */
.dash { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 1rem; }
.live-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.live-head h2 { margin: 0; } .search input { width: 320px; margin: 0; }
.last { display: flex; gap: 1.2rem; align-items: center; padding: 1rem; margin: .8rem 0; border-radius: var(--radius); border: 3px solid var(--line); min-height: 210px; transition: background .3s; }
.last.ok { border-color: var(--ok); background: #f0fdf4; } .last.bad { border-color: var(--bad); background: #fef2f2; }
.last .ph { width: 180px; height: 180px; flex: none; }
.ph { border-radius: 12px; background: #e5e7eb; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 2.5rem; font-weight: 700; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.big { width: 110px; height: 110px; flex: none; }
.last .name { font-size: 1.8rem; font-weight: 700; } .last .status { font-size: 1.1rem; margin: .3rem 0; }
.last .result { font-size: 1.3rem; font-weight: 700; } .last.ok .result { color: var(--ok); } .last.bad .result { color: var(--bad); }
.last .meta { color: var(--muted); margin-top: .3rem; }
.feed { width: 100%; border-collapse: collapse; } .feed td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.feed tr.bad td { color: var(--bad); } .feed .t { color: var(--muted); width: 60px; } .feed .dir { width: 60px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; }
.tile b { display: block; font-size: 1.4rem; } .tile span { color: var(--muted); font-size: .85rem; }
.device { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; flex-wrap: wrap; } .device .dname { flex: 1; font-weight: 600; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; } .dot.on { background: #22c55e; } .dot.off { background: #ef4444; }

/* clan */
.member-head { display: flex; gap: 1rem; align-items: center; } .member-head .grow { flex: 1; } .member-head h1 { margin-bottom: .3rem; }
.portal-qr { width: 180px; height: 180px; display: block; margin: .5rem 0; }
.copy { display: flex; gap: .4rem; } .copy input { margin: 0; font-size: .8rem; }
details.pop { display: inline-block; position: relative; } details.pop summary { list-style: none; } details.pop summary::-webkit-details-marker { display: none; }
details.pop[open] > form { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,.12); text-align: left; }
summary h2.inline { display: inline; }
.photo-input .cam { width: 220px; height: 220px; background: #e5e7eb; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: .5rem; }
.photo-input video, .photo-input img { width: 100%; height: 100%; object-fit: cover; }
.cam-buttons { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }

/* naplata */
.pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.pkg { display: flex; flex-direction: column; gap: .2rem; border: 2px solid var(--line); border-radius: var(--radius); padding: .8rem; cursor: pointer; margin: 0; }
.pkg input { display: none; } .pkg:has(input:checked) { border-color: var(--brand); background: #f0fdfa; }
.pkg .pname { font-weight: 700; } .pkg .pprice { font-size: 1.2rem; }
.methods { gap: 1.5rem; } .total { font-size: 1.3rem; margin: 1rem 0; } .total b { color: var(--brand); }
.keybox { border-color: var(--brand); background: #f0fdfa; }
.hours .hrow { display: flex; align-items: center; gap: .5rem; font-size: .85rem; margin: 2px 0; }
.hours .hl { width: 34px; color: var(--muted); } .hours .bar { height: 14px; background: var(--brand); border-radius: 3px; min-width: 2px; } .hours .hn { color: var(--muted); }

@media (max-width: 900px) {
  .dash, .grid2, .form-grid { grid-template-columns: 1fr; }
  .search input { width: 100%; } .live-head { flex-direction: column; align-items: stretch; }
  .last .ph { width: 110px; height: 110px; } .last .name { font-size: 1.3rem; }
  .table { display: block; overflow-x: auto; }
  main { padding: .8rem; }
}

/* v1.1 */
.quick { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.head-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; max-width: 420px; }
tr.refund td { color: var(--bad); }
tr.warn-row td { background: #fffbeb; }
.print-only { display: none; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.pos-item { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; }
.pos-item.on { border-color: var(--brand); background: #f0fdfa; }
.pos-item .pname { font-weight: 700; }
.pos-item .qty { display: flex; gap: .3rem; align-items: center; margin-top: .4rem; }
.pos-item .qty input { width: 60px; text-align: center; margin: 0; }
.hours-table td { padding: 2px 6px 2px 0; } .hours-table input { margin: 0; }
@media print {
  .top, .banner, .noprint, .flash, .filters { display: none !important; }
  .print-only { display: block; } body { background: #fff; } main { padding: 0; }
  .sign { margin-top: 40px; }
}
@media (max-width: 900px) { .member-head { flex-wrap: wrap; } .head-actions { justify-content: flex-start; } }
/* statistika */
.periodbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .8rem; }
.periodbar .filters { margin: 0; } .periodbar .filters input { min-width: 150px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: inherit; background: var(--card); font-size: .9rem; }
.chip:hover { text-decoration: none; border-color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tile.warn b { color: var(--bad); }
.hours .hl.wide { width: 48px; }
.lapsed { border-bottom: 1px solid var(--line); padding: .4rem 0; }
/* isporucilac (logo, podrska) */
main.center { flex-direction: column; align-items: center; justify-content: flex-start; }
.vendor-logo { display: block; height: 64px; max-width: 100%; margin: 0 auto .3rem; object-fit: contain; }
.center-text { text-align: center; margin-top: 0; }
.login-foot { text-align: center; line-height: 1.6; margin-top: 1rem; }
.vendor-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 1rem; background: var(--card); border-top: 3px solid #f08a24; padding: .4rem 1rem;
  font-size: .95rem; color: var(--muted); box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
.vendor-foot .vf-c { text-align: center; white-space: nowrap; } .vendor-foot .vf-c b { color: var(--text, #1f2937); }
.vendor-foot .vf-r { text-align: right; }
body:has(.vendor-foot) { padding-bottom: 64px; }
@media (max-width: 700px) {
  .vendor-foot { grid-template-columns: auto 1fr; font-size: .75rem; gap: .5rem; padding: .35rem .6rem; }
  .vendor-foot .vf-l { font-size: 0; } .vendor-foot .vf-l img { margin: 0; height: 30px; }
  .vendor-foot .vf-c { text-align: right; } .vendor-foot .vf-r { display: none; }
}
.vendor-foot img { height: 36px; vertical-align: middle; margin-right: .5rem; }
.support { display: flex; gap: 1rem; align-items: center; line-height: 1.6; }
.support img { height: 52px; flex: none; }
.support .row { margin-top: .4rem; flex-wrap: wrap; }
.support-tag { color: var(--muted); border-top: 1px solid var(--line); margin: .8rem 0 0; padding-top: .6rem; }
