/* ============================================================
   SwimLab admin, okvir aplikacije (02.11.2026)
   Laptop (>= 1100 px): navigacija levo, lista polaznika, polaznik desno (lista ostaje).
   Telefon: traka gore sa imenom dela, navigacija dole, polaznik preko liste.
   Jedan upadljiv element: paket kao plocice (duzine bazena), po jedna za svaki cas.
   Osnovni stilovi polja, oznaka i redova su u styles.css (blok "admin").
   ============================================================ */
.adm-app {
  --ad-bg: #061523;
  --ad-side-bg: #04101c;
  --ad-surface: #0b2134;
  --ad-surface-2: #0f2b44;
  --ad-line: rgba(143, 176, 200, .16);
  --ad-text: #e8f2fb;
  --ad-mute: #8fb0c8;
  --ad-aqua: #5fc6ff;
  --ad-paid: #57d39a;
  --ad-owed: #ffc44d;
  --ad-out: #ff7b6b;
  --ad-side: 236px;
  --ad-nav-h: 62px;
  --ad-bar-h: 54px;
  margin: 0;
  min-height: 100vh;
  background: var(--ad-bg);
  color: var(--ad-text);
  font-family: var(--font-b);
}
.adm-app [hidden] { display: none !important; }
.adm-app :focus-visible { outline: 2px solid var(--ad-aqua); outline-offset: 2px; }

/* ---------- naslovi ---------- */
.adm-app .ad-h1 {
  font-family: var(--font-d); font-weight: 700; font-size: clamp(1.55rem, 2.2vw, 1.95rem);
  letter-spacing: -.02em; line-height: 1.1; color: #fff; margin: 0 0 14px;
}
.adm-app .ad-h3 {
  font-family: var(--font-d); font-weight: 650; font-size: 1.1rem; letter-spacing: -.01em;
  color: #fff; margin: 0 0 12px;
}
.adm-app .ad-count { font-family: var(--font-b); font-size: .95rem; font-weight: 600; color: var(--ad-owed); margin-left: 6px; letter-spacing: 0; }
.adm-app .adm-pay-sum { font-family: var(--font-b); font-size: .9rem; font-weight: 500; color: var(--ad-mute); letter-spacing: 0; }

/* ---------- navigacija levo ---------- */
.ad-side {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--ad-side);
  display: flex; flex-direction: column; gap: 26px; padding: 22px 14px 18px;
  background: var(--ad-side-bg); border-right: 1px solid var(--ad-line);
}
.ad-brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px; color: #fff; text-decoration: none; }
.ad-brand img { border-radius: 7px; }
.ad-brand-t { font-family: var(--font-d); font-weight: 700; font-size: 1.18rem; letter-spacing: -.01em; }
.ad-brand-t span { font-family: var(--font-b); font-weight: 500; font-size: .86rem; color: var(--ad-mute); margin-left: 3px; }

.adm-app .ad-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; overflow: visible; }
.adm-app .ad-nav .adm-tab {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 12px; background: none;
  color: var(--ad-mute); font-size: .95rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: color .15s, background .15s;
}
.adm-app .ad-nav .adm-tab svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.adm-app .ad-nav .adm-tab:hover { color: #fff; background: rgba(143, 176, 200, .08); }
.adm-app .ad-nav .adm-tab.is-on { color: #fff; background: var(--ad-surface-2); }
.adm-app .ad-nav .adm-tab.is-on::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--ad-aqua);
}
.adm-app .ad-nav .adm-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: .74rem; font-weight: 700;
  color: var(--ad-text); background: rgba(143, 176, 200, .16);
}
.adm-app .ad-nav .adm-badge-warn { color: #3a2a00; background: var(--ad-owed); }
.adm-app .ad-nav .adm-badge-hot { color: #04223a; background: var(--ad-aqua); }
.adm-app .ad-nav .adm-badge:empty { display: none; }

.ad-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--ad-line); }
.ad-side-foot a, .ad-side-foot button {
  font: inherit; font-size: .9rem; color: var(--ad-mute); text-decoration: none; text-align: left;
  background: none; border: 0; padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
.ad-side-foot a:hover, .ad-side-foot button:hover { color: #fff; background: rgba(143, 176, 200, .08); }

/* ---------- glavni deo ---------- */
.ad-shell { margin-left: var(--ad-side); min-height: 100vh; }
.ad-bar { display: none; }
.ad-main { padding: 26px clamp(20px, 2.6vw, 40px) 64px; }
.ad-loading { padding: 30px 0; }
.ad-guest { max-width: 520px; padding-top: 6vh; }
.ad-guest p { color: var(--ad-mute); margin-bottom: 22px; }

.ad-cols { display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 30px; align-items: start; }
.ad-cols > .ad-wide { grid-column: 1 / -1; width: 100%; max-width: 1000px; }
.ad-wide > .acc-card + .acc-card, .ad-wide > .acc-stats + .acc-card { margin-top: 16px; }

.adm-app .acc-card { background: var(--ad-surface); border: 1px solid var(--ad-line); border-radius: 18px; padding: clamp(16px, 2vw, 22px); }
.adm-app .adm-block { margin-top: 16px; }
.adm-app .adm-rows li { background: rgba(4, 16, 29, .45); }
.adm-app .adm-btn { padding: 8px 14px; }
.adm-app .adm-input { border-radius: 10px; }
.adm-app .adm-hint { color: var(--ad-mute); }

/* ---------- lista polaznika (na laptopu ima svoj skrol) ---------- */
.ad-list {
  position: sticky; top: 26px; max-height: calc(100vh - 52px); overflow-y: auto; overscroll-behavior: contain;
  padding-right: 6px; scrollbar-width: thin; scrollbar-color: rgba(143, 176, 200, .25) transparent;
}
.ad-list-head { position: sticky; top: 0; z-index: 2; padding-bottom: 12px; background: var(--ad-bg); }
.adm-app .ad-search { margin-top: 0; }
.adm-app .adm-users { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; padding: 0; }
.adm-app .adm-user {
  width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 12px 14px; border-radius: 14px; border: 1px solid transparent;
  background: var(--ad-surface); color: var(--ad-text); font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.adm-app .adm-user:hover { border-color: rgba(95, 198, 255, .35); }
.adm-app .adm-user.is-sel { border-color: rgba(95, 198, 255, .6); background: var(--ad-surface-2); box-shadow: inset 3px 0 0 var(--ad-aqua); }
.adm-app .adm-user-name { font-weight: 650; }
.adm-app .adm-user-line { gap: 6px 10px; }

/* ---------- polaznik ---------- */
.ad-detail { min-width: 0; }
.ad-detail-empty { border: 1px dashed var(--ad-line); border-radius: 18px; padding: 44px 30px; max-width: 560px; }
.ad-detail-empty p:first-child { font-family: var(--font-d); font-weight: 650; font-size: 1.3rem; color: #fff; }
.ad-detail-in { transition: opacity .15s; }
.ad-detail-in.is-loading { opacity: .4; pointer-events: none; }
.ad-uhead { padding-bottom: 6px; }
.adm-app .ad-uhead .adm-back { margin: 0 0 10px; font-size: .9rem; text-decoration: none; }
.adm-app .adm-name {
  font-family: var(--font-d); font-weight: 700; font-size: clamp(1.75rem, 3vw, 2.4rem);
  letter-spacing: -.025em; line-height: 1.05; color: #fff; margin: 0 0 4px;
}
.ad-umeter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 16px 0 4px; }
.ad-umeter:empty { display: none; }
.lane-cap { display: flex; flex-direction: column; line-height: 1.3; }
.lane-cap strong { font-family: var(--font-d); font-weight: 650; font-size: 1.08rem; color: #fff; }
.lane-cap span { font-size: .85rem; color: var(--ad-mute); }
.adm-app .adm-members { align-items: center; }
/* natpisi u redovima i na plocicama brojki: obicna slova, ne velika */
.adm-app .st-label { text-transform: none; letter-spacing: 0; font-size: .86rem; color: var(--ad-mute); }
.adm-app .st-tile { background: var(--ad-surface); border-color: var(--ad-line); border-radius: 16px; }
.adm-app .adm-user-k { text-transform: none; letter-spacing: 0; font-size: .84rem; font-weight: 500; color: var(--ad-mute); }

/* paket kao plocice: po jedna za svaki cas, kao duzine bazena */
.lane { --lane-c: var(--ad-aqua); display: inline-flex; gap: 3px; vertical-align: middle; }
.lane-ok { --lane-c: var(--ad-aqua); }
.lane-low { --lane-c: var(--ad-owed); }
.lane-out { --lane-c: var(--ad-out); }
.lane-s { position: relative; width: 11px; height: 8px; border-radius: 2px; background: rgba(143, 176, 200, .2); }
.lane-s.is-full { background: var(--lane-c); }
.lane-s.is-half { background: linear-gradient(90deg, var(--lane-c) 50%, rgba(143, 176, 200, .2) 50%); }
.lane-big { gap: 4px; }
.lane-big .lane-s { width: 22px; height: 30px; border-radius: 5px; }
/* crna linija na dnu staze, kao na podu bazena */
.lane-big .lane-s::after {
  content: ""; position: absolute; left: 50%; top: 24%; bottom: 24%; width: 2px; transform: translateX(-50%);
  border-radius: 2px; background: rgba(6, 21, 35, .35);
}
.lane-big .lane-s:not(.is-full):not(.is-half)::after { background: rgba(143, 176, 200, .18); }
.lane-bar { width: 140px; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(143, 176, 200, .2); }
.lane-bar .lane-fill { display: block; height: 100%; background: var(--lane-c); }
.pkg-info .lane { margin-top: 10px; }

/* brze akcije: stoje gore dok skrolujes polaznika */
.ad-qbar {
  position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 2px; padding: 10px 0 12px; background: var(--ad-bg);
}
.ad-qbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; pointer-events: none; background: linear-gradient(var(--ad-bg), rgba(6, 21, 35, 0)); }
.ad-q {
  font: inherit; font-size: .92rem; font-weight: 600; color: #fff; cursor: pointer;
  padding: 10px 16px; border-radius: 12px; border: 1px solid rgba(95, 198, 255, .4); background: rgba(95, 198, 255, .12);
  transition: background .15s, border-color .15s;
}
.ad-q:hover { background: rgba(95, 198, 255, .2); }
.ad-q:disabled { opacity: .5; cursor: progress; }
.ad-q-pay { color: #d4f7e6; border-color: rgba(87, 211, 154, .5); background: rgba(87, 211, 154, .15); }
.ad-q-pay:hover { background: rgba(87, 211, 154, .24); }
.ad-q-quiet { color: var(--ad-mute); border-color: var(--ad-line); background: none; }
.ad-q-quiet:hover { color: #fff; background: rgba(143, 176, 200, .08); }

/* nacrt vracen */
.ad-draft { margin: -2px 0 12px; padding: 9px 12px; border-radius: 10px; font-size: .88rem; color: #ffe2a3; background: rgba(255, 196, 77, .1); }
.adm-app .ad-draft .acc-link { margin: 0 0 0 8px; color: inherit; font-size: .88rem; }
.adm-pkg-add .ad-draft { margin-top: 12px; }

/* sta se upravo promenilo */
@keyframes ad-flash { from { box-shadow: 0 0 0 2px var(--ad-aqua); } to { box-shadow: 0 0 0 2px rgba(95, 198, 255, 0); } }
.is-flash { animation: ad-flash 1.1s ease-out; }
@keyframes ad-fresh { from { background: rgba(95, 198, 255, .26); } to { background: rgba(4, 16, 29, .45); } }
.adm-app .adm-rows li.is-fresh { animation: ad-fresh 1.8s ease-out; }
.adm-app .adm-rows li.is-removing, .adm-app .adm-rv.is-removing { opacity: 0; transform: translateX(14px); transition: opacity .2s, transform .2s; }

/* tab Uplate: "Naplati" pored duga */
.adm-app .adm-rows li.ad-owed-row { padding: 0; gap: 8px; flex-wrap: nowrap; background: none; }
.adm-app .ad-owed-row .grp-member { flex: 1 1 auto; min-width: 0; }
.adm-app .ad-collect { flex: none; align-self: center; }

/* ---------- poruka posle akcije (sa "Poništi") ---------- */
.ad-toast {
  position: fixed; z-index: 80; left: calc(50% + var(--ad-side) / 2); bottom: 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-width: min(300px, calc(100vw - 32px)); max-width: min(560px, calc(100vw - 32px));
  padding: 12px 14px 12px 18px; border-radius: 14px;
  background: #eef6fc; color: #082036; font-size: .95rem; font-weight: 600;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
  opacity: 0; transform: translate(-50%, 14px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.ad-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ad-toast.bad { background: #ffe3de; color: #5a140b; }
.ad-toast:empty { display: none; }
.ad-toast-undo {
  font: inherit; font-weight: 700; color: #1b5fd0; background: none; border: 0; cursor: pointer;
  padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}

/* ---------- meni na telefonu ---------- */
.ad-menu { position: relative; }
.ad-menu summary { list-style: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; color: var(--ad-mute); }
.ad-menu summary::-webkit-details-marker { display: none; }
.ad-menu summary svg { width: 22px; height: 22px; fill: currentColor; }
.ad-menu[open] summary { background: rgba(143, 176, 200, .12); color: #fff; }
.ad-menu-in {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; display: flex; flex-direction: column; padding: 6px;
  border-radius: 14px; background: var(--ad-surface-2); border: 1px solid var(--ad-line); box-shadow: 0 14px 36px rgba(0, 0, 0, .45);
}
.ad-menu-in a, .ad-menu-in button {
  font: inherit; font-size: .95rem; color: var(--ad-text); text-decoration: none; text-align: left;
  background: none; border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.ad-menu-in a:hover, .ad-menu-in button:hover { background: rgba(143, 176, 200, .1); }

/* ---------- telefon i tablet ---------- */
@media (max-width: 1099px) {
  .ad-shell { margin-left: 0; padding-bottom: calc(var(--ad-nav-h) + env(safe-area-inset-bottom)); }
  .ad-side {
    inset: auto 0 0 0; width: auto; height: calc(var(--ad-nav-h) + env(safe-area-inset-bottom));
    flex-direction: row; gap: 0; padding: 0 4px env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid var(--ad-line);
    background: rgba(4, 16, 28, .97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .ad-brand, .ad-side-foot { display: none; }
  .adm-app .ad-nav { flex-direction: row; width: 100%; gap: 0; }
  .adm-app .ad-nav .adm-tab {
    flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 3px;
    padding: 8px 2px 6px; border-radius: 10px; font-size: .68rem; text-align: center;
  }
  .adm-app .ad-nav .adm-tab .ad-nav-t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .adm-app .ad-nav .adm-tab:hover { background: none; }
  .adm-app .ad-nav .adm-tab.is-on { background: none; }
  .adm-app .ad-nav .adm-tab.is-on::before { left: 26%; right: 26%; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .adm-app .ad-nav .adm-badge { position: absolute; top: 5px; left: calc(50% + 5px); margin: 0; min-width: 17px; height: 17px; padding: 0 4px; font-size: .62rem; }

  .ad-bar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    height: var(--ad-bar-h); padding: 0 8px 0 16px;
    background: rgba(6, 21, 35, .95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ad-line);
  }
  .ad-bar-title { margin: 0; min-width: 0; font-family: var(--font-d); font-weight: 700; font-size: 1.12rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .ad-main { padding: 14px 16px 30px; }
  .ad-cols { display: block; }
  .ad-list { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .ad-list-head { position: static; }
  .ad-list .ad-h1, .ad-wide > .ad-h1 { display: none; }
  .ad-detail-empty { display: none; }
  body[data-view="polaznici"] .ad-detail { display: none; }
  body[data-view="polaznik"] .ad-list { display: none; }
  body[data-view="polaznik"] .ad-detail-in { animation: ad-in .22s ease-out; }

  .ad-qbar { top: var(--ad-bar-h); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 6px -16px 0; padding: 10px 16px 12px; }
  .ad-qbar::-webkit-scrollbar { display: none; }
  .ad-q { flex: none; white-space: nowrap; }
  .lane-big .lane-s { width: 20px; height: 28px; }

  .ad-toast { left: 50%; bottom: calc(var(--ad-nav-h) + 14px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .lane-big .lane-s { width: 17px; height: 26px; }
}
@keyframes ad-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .adm-app *, .adm-app *::before, .adm-app *::after { animation: none !important; transition: none !important; }
}
