/* ==========================================================================
   LedPay Monitor — dizajn sistem
   Boje prate Ondexo identitet (navy #16243D, plava #2E75B6).
   Dve teme: svetla (podrazumevana) i tamna, preko [data-theme] na <html>.
   Bočna traka je uvek u brend navy boji — u obe teme.
   ========================================================================== */

:root {
  --bg:        #F1F4F8;
  --surface:   #FFFFFF;
  --surface-2: #F7F9FB;
  --surface-3: #EBF0F6;
  --line:      #E3E9F0;
  --line-2:    #D2DBE5;

  --txt:       #16243D;
  --txt-2:     #3D4A5C;
  --mut:       #6B7787;

  --acc:       #2E75B6;
  --acc-soft:  #E8F0F9;
  --acc-line:  #B9D2EA;

  --ok:   #1A7F37;  --ok-soft:   #E3F3E8;
  --warn: #9A6700;  --warn-soft: #FBF0DA;
  --bad:  #B42318;  --bad-soft:  #FBE6E4;

  --badge-neutral: #4A5462;
  --badge-ok:      #125B26;
  --badge-warn:    #6F4B00;
  --badge-bad:     #9E1B11;

  --shadow-sm: 0 1px 2px rgba(22,36,61,.05);
  --shadow:    0 4px 16px rgba(22,36,61,.09);
  --shadow-lg: 0 16px 48px rgba(22,36,61,.20);

  --ic-blue-fg: #1F5C93;

  --show-on-dark:  none;
  --show-on-light: block;
}

[data-theme="dark"] {
  --bg:        #0C131D;
  --surface:   #131C28;
  --surface-2: #182231;
  --surface-3: #1E2A3A;
  --line:      #232F3F;
  --line-2:    #31425A;

  --txt:       #E8EEF6;
  --txt-2:     #C2CEDC;
  --mut:       #8698AC;

  --acc:       #57A0E0;
  --acc-soft:  #16283B;
  --acc-line:  #2B4763;

  --ok:   #5BC97E;  --ok-soft:   #14301F;
  --warn: #E0A63C;  --warn-soft: #33280F;
  --bad:  #F0796C;  --bad-soft:  #37191A;

  --badge-neutral: #9AAABC;
  --badge-ok:      #6ED28E;
  --badge-warn:    #EDB44E;
  --badge-bad:     #FF8F82;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.28);
  --shadow:    0 4px 16px rgba(0,0,0,.38);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.55);

  --ic-blue-fg: var(--acc);

  --show-on-dark:  block;
  --show-on-light: none;
}

/* bočna traka — iste boje u obe teme */
:root, [data-theme="dark"] {
  --side-bg:     #16243D;
  --side-line:   #253750;
  --side-txt:    #9FB2C7;
  --side-hover:  #1D2F4B;
  --side-active: #234067;
}

/* --------------------------------------------------------------- osnovno */
* { box-sizing: border-box; }
html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, system-ui, Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.5;
  background: var(--bg); color: var(--txt);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

.stat .val, td.num, .bar .vv, .count, .pager, th, .col .cv, .signal .cnt,
.kv, .stat .meta { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- ljuska */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px; flex-shrink: 0;
  background: var(--side-bg);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.side-brand { padding: 22px 22px 20px; border-bottom: 1px solid var(--side-line); }
.side-brand img { height: 26px; width: auto; display: block; }
.side-brand #brandLogoLight { display: none; }   /* traka je uvek tamna */
.side-brand-sub {
  margin-top: 9px; font-size: 14px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase; color: #6E86A3;
}

.side-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 7px;
  background: none; border: none; width: 100%;
  font: inherit; font-size: 16px; font-weight: 500;
  color: var(--side-txt); cursor: pointer; text-align: left;
  transition: background .13s, color .13s;
}
.nav-item .ic { width: 20px; height: 20px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: var(--side-hover); color: #E4EDF7; }
.nav-item.active { background: var(--side-active); color: #FFFFFF; font-weight: 600; }
.nav-item.active .ic { opacity: 1; }
.nav-item:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }

.side-foot { padding: 12px; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 2px; }
.side-foot form { margin: 0; }
.side-act {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 7px;
  background: none; border: none; width: 100%;
  font: inherit; font-size: 16px; color: var(--side-txt);
  cursor: pointer; text-align: left; transition: background .13s, color .13s;
}
.side-act .ic { width: 20px; height: 20px; flex-shrink: 0; opacity: .8; }
.side-act:hover { background: var(--side-hover); color: #E4EDF7; }

#iconSun  { display: var(--show-on-dark); }
#iconMoon { display: var(--show-on-light); }

/* --------------------------------------------------------------- glavno */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 20px 28px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.page-title h1 {
  margin: 0; font-size: 30px; font-weight: 700; line-height: 1.2;
  letter-spacing: -.6px; color: var(--txt);
}
.sub { color: var(--mut); font-size: 16px; margin-top: 4px; }
.htools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.page-body { padding: 24px 28px 36px; flex: 1; }

/* --------------------------------------------------------------- dugmad */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--acc); color: #fff;
  border: 1px solid transparent; border-radius: 6px;
  padding: 10px 20px; font-size: 16px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
}
.btn:hover { background: #2A6AA6; }
[data-theme="dark"] .btn:hover { background: #6BAFEA; }
.btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.btn.ghost { background: var(--surface); color: var(--txt-2); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--txt); border-color: var(--mut); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); }
.btn .ic { width: 18px; height: 18px; flex-shrink: 0; }

/* --------------------------------------------------------- ključni brojevi */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-bottom: 18px;
}
/* Ikonica ide u gornji desni ugao — tako ceo iznos ima punu širinu kartice
   (npr. „22.774.766,94 RSD" traži ~205px na 26px slovima). */
.stat {
  position: relative; min-width: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .18s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }

.stat-ic {
  position: absolute; top: 15px; right: 15px;
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s cubic-bezier(.2,.8,.3,1);
}
.stat:hover .stat-ic { transform: scale(1.07) rotate(-3deg); }
.stat-ic svg { width: 22px; height: 22px; }
.ic-blue  { background: var(--acc-soft);  color: var(--ic-blue-fg); }
.ic-green { background: var(--ok-soft);   color: var(--badge-ok); }
.ic-amber { background: var(--warn-soft); color: var(--badge-warn); }
.ic-red   { background: var(--bad-soft);  color: var(--badge-bad); }

.stat-body { min-width: 0; }
.stat .lab {
  font-size: 16px; font-weight: 500; color: var(--mut);
  padding-right: 54px; min-height: 24px;
}
.stat .val {
  font-size: 30px; font-weight: 700; letter-spacing: -.8px;
  margin-top: 6px; color: var(--txt); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.stat .val small { font-size: 16px; font-weight: 500; color: var(--mut); letter-spacing: 0; margin-left: 4px; }
.stat .meta { font-size: 16px; color: var(--mut); margin-top: 6px; line-height: 1.45; }

/* --------------------------------------------------------------- kartice */
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g-signals { grid-template-columns: 480px 1fr; }
@media (max-width: 1180px) { .g2, .g-signals { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px 20px;
  box-shadow: var(--shadow-sm);
}
.card-accent { border-color: var(--acc-line); }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.card-head h3 { margin: 0; font-size: 20px; font-weight: 600; color: var(--txt); letter-spacing: -.1px; }
.card-head .hint { color: var(--mut); font-size: 16px; text-align: right; }

/* --------------------------------------------------------- AML signali */
.signals { display: flex; flex-direction: column; gap: 4px; }
.signal {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; margin: 0 -10px; border-radius: 9px;
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .15s cubic-bezier(.2,.8,.3,1);
}
.signal:hover { background: var(--surface-2); border-color: var(--line); transform: translateX(3px); }
.signal:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; background: var(--surface-2); }
.signal .sig-ic {
  width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--mut);
  transition: background .15s, color .15s;
}
.signal .sig-ic svg { width: 20px; height: 20px; }
.signal.hot .sig-ic { background: var(--bad-soft); color: var(--badge-bad); }
.signal:not(.hot):hover .sig-ic { background: var(--acc-soft); color: var(--acc); }
.signal .nm { flex: 1; font-size: 16px; color: var(--txt-2); min-width: 0; }
.signal:hover .nm { color: var(--txt); }
.signal .cnt { font-size: 20px; font-weight: 700; color: var(--txt); letter-spacing: -.3px; }
.signal .unit { font-size: 16px; color: var(--mut); margin-left: 3px; font-weight: 500; }
.signal .chev {
  width: 6px; height: 6px; flex-shrink: 0; margin-right: 2px;
  border-right: 1.5px solid var(--mut); border-bottom: 1.5px solid var(--mut);
  transform: rotate(-45deg); opacity: .35;
  transition: opacity .15s, border-color .15s, transform .15s;
}
.signal:hover .chev { opacity: 1; border-color: var(--acc); transform: rotate(-45deg) translate(2px, 2px); }

/* --------------------------------------------------------------- trake */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar { display: grid; grid-template-columns: 210px 1fr 116px; align-items: center; gap: 14px; font-size: 16px; }
.bar .nm { color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track { background: var(--surface-3); border-radius: 4px; height: 10px; overflow: hidden; }
.bar .fill {
  height: 100%; background: var(--acc); border-radius: 3px;
  width: var(--w, 0%); transition: filter .13s;
  animation: growW .75s cubic-bezier(.2,.85,.3,1) backwards;
}
.bar.hot .fill { background: var(--bad); }
@keyframes growW { from { width: 0; } to { width: var(--w, 0%); } }
.bar .vv { color: var(--txt); text-align: right; font-weight: 500; }
.bar.click { cursor: pointer; }
.bar.click:hover .nm { color: var(--txt); }
.bar.click:hover .fill { filter: brightness(1.12); }

/* --------------------------------------------------------------- kolone */
.cols { display: flex; align-items: flex-end; gap: 10px; height: 212px; padding-top: 6px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: flex-end; height: 100%; }
.col .b {
  width: 100%; background: var(--acc); border-radius: 4px 4px 0 0; min-height: 3px;
  height: var(--h, 0); transition: background .15s;
  animation: growH .7s cubic-bezier(.2,.85,.3,1) backwards;
}
.col:hover .b { background: var(--txt); }
[data-theme="dark"] .col:hover .b { background: #8CC2F2; }
.col .cl { color: var(--mut); font-size: 16px; white-space: nowrap; }
.col .cv { font-size: 16px; color: var(--txt-2); font-weight: 500; }
@keyframes growH { from { height: 0; } to { height: var(--h, 0); } }

/* --------------------------------------------------------------- filteri */
.filters {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  margin-bottom: 16px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-sm);
}
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld label { font-size: 16px; color: var(--mut); font-weight: 500; }

input, select {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--txt);
  border-radius: 8px; padding: 10px 14px; font-size: 16px; font-family: inherit;
  outline: none; transition: border-color .13s, box-shadow .13s;
}
input:hover, select:hover { border-color: var(--mut); }
input:focus, select:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
input[type=search] { min-width: 300px; }
input.w-num { width: 140px; }
input[type=checkbox] { accent-color: var(--acc); width: 24px; height: 24px; flex-shrink: 0; }
.chk { display: flex; gap: 10px; align-items: center; font-size: 16px; color: var(--txt-2); cursor: pointer; min-height: 46px; }

/* --------------------------------------------------------------- toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 14px; align-items: center; }
.count { color: var(--mut); font-size: 16px; }
.count strong { color: var(--txt); font-weight: 650; }

/* --------------------------------------------------------------- tabele */
.tblwrap {
  overflow: auto; border: 1px solid var(--line); border-radius: 10px;
  max-height: 68vh; background: var(--surface); box-shadow: var(--shadow-sm);
}
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 16px; }
th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2);
  padding: 12px 16px; text-align: left; white-space: nowrap;
  font-size: 16px; font-weight: 600; color: var(--mut);
  border-bottom: 1px solid var(--line-2);
  cursor: pointer; user-select: none; transition: color .13s;
}
th:hover { color: var(--txt); }
th .ar { color: var(--acc); font-size: 12px; margin-left: 4px; }
td { padding: 12px 16px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); color: var(--txt-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-2); cursor: pointer; }
tbody tr:hover td { color: var(--txt); }
td.num { text-align: right; }

/* --------------------------------------------------------------- oznake */
.badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 16px; font-weight: 600; letter-spacing: 0; border: 1px solid transparent; }
.r0 { background: var(--surface-3); color: var(--badge-neutral); border-color: var(--line-2); }
.r1 { background: var(--ok-soft);   color: var(--badge-ok); }
.r2 { background: var(--warn-soft); color: var(--badge-warn); }
.r3 { background: var(--bad-soft);  color: var(--badge-bad); }
.sch { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 16px; font-weight: 600; background: var(--surface-3); color: var(--mut); }
.refund { color: var(--bad); font-weight: 650; }

.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; color: var(--mut); font-size: 16px; }

/* --------------------------------------------------------------- modal */
.ov {
  position: fixed; inset: 0; background: rgba(12,19,29,.55); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 24px;
}
.ov.show { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  max-width: 880px; width: 100%; max-height: 86vh; overflow: auto; box-shadow: var(--shadow-lg);
}
.modal .mh {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal .mh h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.2px; }
.x {
  cursor: pointer; color: var(--mut); font-size: 28px; line-height: 1;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background .13s, color .13s;
}
.x:hover { background: var(--surface-3); color: var(--txt); }
.mb { padding: 20px 22px; }
.kv { display: grid; grid-template-columns: 240px 1fr; gap: 10px 20px; font-size: 16px; }
.kv .k { color: var(--mut); }
.sectitle { font-size: 18px; color: var(--txt); font-weight: 600; margin: 24px 0 12px; }

/* --------------------------------------------------------------- ostalo */
.note {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--acc); border-radius: 8px;
  padding: 16px 20px; font-size: 16px; color: var(--mut); line-height: 1.6;
}
.note b { color: var(--txt-2); font-weight: 650; }
.help-li { margin: 12px 0; color: var(--txt-2); font-size: 16px; line-height: 1.6; }
.help-li b { color: var(--txt); font-weight: 650; }
footer { color: var(--mut); font-size: 16px; margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--txt); color: var(--surface); border-radius: 8px;
  padding: 12px 20px; box-shadow: var(--shadow-lg); z-index: 90;
  display: none; font-size: 16px; font-weight: 500; max-width: 90vw;
}
#toast.show { display: block; }

/* --------------------------------------------------------------- prijava */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.login-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 40px 36px; width: 100%; max-width: 440px;
}
.login-card #brandLogo      { display: var(--show-on-dark); }
.login-card #brandLogoLight { display: var(--show-on-light); }
.login-card img { height: 28px; margin: 0 auto 10px; }
.login-card .tag { text-align: center; color: var(--mut); font-size: 16px; margin-bottom: 26px; }
.login-card label { display: block; font-size: 16px; color: var(--mut); font-weight: 500; margin: 18px 0 8px; }
.login-card input { width: 100%; padding: 11px 14px; }
.login-card .btn { width: 100%; margin-top: 24px; padding: 11px; justify-content: center; }
.login-err { background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad); border-radius: 6px; padding: 12px 14px; font-size: 16px; margin-bottom: 8px; text-align: center; }

/* --------------------------------------------------------------- uvoz */
.imp-card { margin-bottom: 16px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 30px 20px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: 10px; background: var(--surface-2);
  transition: border-color .15s, background .15s, opacity .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--acc); background: var(--acc-soft); }
.dropzone:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.dropzone .dz-ic { width: 40px; height: 40px; color: var(--acc); }
.dropzone .dz-main { font-size: 18px; font-weight: 600; color: var(--txt); }
.dropzone .dz-link { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; }
.dropzone .dz-sub { font-size: 16px; color: var(--mut); }
.dropzone.busy { pointer-events: none; opacity: .6; }
.dropzone.disabled { pointer-events: none; opacity: .45; }
.imp-result {
  margin-top: 14px; padding: 14px 16px; border-radius: 8px; font-size: 16px; line-height: 1.55;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--txt-2);
}
.imp-result.ok   { background: var(--ok-soft);   border-color: transparent; color: var(--badge-ok); }
.imp-result.warn { background: var(--warn-soft); border-color: transparent; color: var(--badge-warn); }
.imp-result.bad  { background: var(--bad-soft);  border-color: transparent; color: var(--badge-bad); }
.imp-note { margin-top: 6px; font-size: 16px; }
.imp-progress { display: flex; flex-direction: column; gap: 8px; }
.ip-head { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; font-weight: 600; color: var(--txt); }
.ip-val { font-variant-numeric: tabular-nums; color: var(--mut); font-weight: 500; white-space: nowrap; }
.ip-track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.ip-bar { height: 100%; border-radius: 4px; background: var(--acc); transition: width .2s ease; }
.ip-track.indet .ip-bar { position: absolute; top: 0; left: -40%; width: 40% !important; animation: ipKlizi 1.3s ease-in-out infinite; }
@keyframes ipKlizi { from { left: -40%; } to { left: 100%; } }
.ip-sub { font-size: 16px; color: var(--mut); }
.dropzone.busy { opacity: .75; }
@media (prefers-reduced-motion: reduce) {
  .ip-track.indet .ip-bar { left: 0; width: 100% !important; opacity: .55; animation: none; }
}
#imptable th { cursor: default; }
#imptable tbody tr { cursor: default; }
td.empty { text-align: center; color: var(--mut); padding: 22px; }
/* dok server vraća novu stranu transakcija */
#txtable tbody { transition: opacity .15s; }
#txtable.loading tbody { opacity: .45; }
td.wrap { white-space: normal; min-width: 220px; max-width: 420px; }
td.wrap .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mut { color: var(--mut); }

/* --------------------------------------------------------------- nalozi i forme */
.nav-label {
  margin: 16px 12px 6px; font-size: 14px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #6E86A3;
}
.side-user { padding: 6px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--side-line); }
.su-name { color: #E4EDF7; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-role { color: var(--side-txt); font-size: 16px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal.narrow { max-width: 560px; }
.ov.forced .x { display: none; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form .fld { display: flex; flex-direction: column; gap: 6px; }
.form .fld > span { font-size: 16px; color: var(--mut); font-weight: 500; }
.form input[type=text], .form input[type=password], .form select { width: 100%; padding: 10px 14px; }
.form input:disabled, .form select:disabled { opacity: .6; cursor: not-allowed; }
.form .row-inline { display: flex; gap: 8px; }
.form .row-inline input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.form-lead { margin: 0; color: var(--txt-2); font-size: 16px; line-height: 1.6; }
.form-hint { font-size: 16px; color: var(--mut); line-height: 1.5; margin-top: -6px; }
.form-err { padding: 12px 14px; border-radius: 8px; font-size: 16px; background: var(--bad-soft); color: var(--badge-bad); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.chk-line { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--txt-2); cursor: pointer; }
.cred {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; line-height: 1.9; color: var(--txt-2);
}
.cred b { color: var(--txt); }
.btn-sm { padding: 7px 16px; font-size: 16px; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
.you { font-size: 16px; color: var(--mut); margin-left: 6px; }
#usrtable th, #audtable th { cursor: default; }
#usrtable tbody tr, #audtable tbody tr { cursor: default; }

/* ==========================================================================
   Animacije
   Ulazne animacije koriste fill-mode: backwards — posle završetka element
   se vraća na normalne stilove, pa hover transformacije i dalje rade.
   ========================================================================== */
@keyframes riseIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn   { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(180,35,24,.32); }
  70%  { box-shadow: 0 0 0 7px rgba(180,35,24,0); }
  100% { box-shadow: 0 0 0 0 rgba(180,35,24,0); }
}

.page-body > section { animation: riseIn .34s cubic-bezier(.2,.8,.3,1) backwards; }

.stat { animation: riseIn .42s cubic-bezier(.2,.8,.3,1) backwards; }
.stat:nth-child(1) { animation-delay: .00s; }
.stat:nth-child(2) { animation-delay: .06s; }
.stat:nth-child(3) { animation-delay: .12s; }
.stat:nth-child(4) { animation-delay: .18s; }

.signal { animation: riseIn .38s cubic-bezier(.2,.8,.3,1) backwards; }
.signal:nth-child(1) { animation-delay: .05s; }
.signal:nth-child(2) { animation-delay: .10s; }
.signal:nth-child(3) { animation-delay: .15s; }
.signal:nth-child(4) { animation-delay: .20s; }
.signal:nth-child(5) { animation-delay: .25s; }
.signal:nth-child(6) { animation-delay: .30s; }
.signal.hot .sig-ic { animation: pulseRing 2.4s ease-out 1.2s 2; }

.bar { animation: fadeIn .4s ease backwards; }
/* Samo redovi tabela u aplikaciji — NIKAKO `tbody tr`, jer to pogađa i #report:
   on je display:none do štampe, animacija ne krene i redovi ostanu na opacity 0. */
.tblwrap tbody tr { animation: fadeIn .28s ease backwards; }

.ov.show .modal { animation: popIn .22s cubic-bezier(.2,.8,.3,1) backwards; }
.ov.show { animation: fadeIn .18s ease backwards; }
#toast.show { animation: toastIn .28s cubic-bezier(.2,.8,.3,1) backwards; }

.btn:active { transform: translateY(1px); }
.nav-item { position: relative; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--acc);
  animation: fadeIn .22s ease backwards;
}
.card { transition: box-shadow .18s, border-color .18s; }
.tblwrap tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--acc); }

/* ==========================================================================
   Responsive
   ========================================================================== */
.hamb {
  display: none; width: 38px; height: 38px; flex-shrink: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 0; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); cursor: pointer; transition: background .13s;
}
.hamb:hover { background: var(--surface-3); }
.hamb span {
  display: block; width: 16px; height: 1.8px; border-radius: 2px;
  background: var(--txt-2); transition: transform .24s cubic-bezier(.3,.8,.3,1), opacity .16s;
}
body.nav-open .hamb span:nth-child(1) { transform: translateY(5.8px) rotate(45deg); }
body.nav-open .hamb span:nth-child(2) { opacity: 0; }
body.nav-open .hamb span:nth-child(3) { transform: translateY(-5.8px) rotate(-45deg); }

.side-scrim { display: none; }

/* Iznos prometa na 30px traži 247px; četiri kartice staju od 1510px širine,
   plus rezerva za traku za skrolovanje na Windows-u (izmereno u pregledaču). */
@media (max-width: 1540px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hamb { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 60;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.3,.8,.3,1);
  }
  body.nav-open .sidebar { transform: none; box-shadow: 6px 0 32px rgba(0,0,0,.34); }
  .side-scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(12,19,29,.5); backdrop-filter: blur(1px);
    opacity: 0; pointer-events: none; transition: opacity .26s;
  }
  body.nav-open .side-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .page-head { padding: 14px 18px; gap: 12px; }
  .page-body { padding: 18px 18px 30px; }
  .page-title h1 { font-size: 24px; }
  .htools { flex: 1; justify-content: flex-end; }
  .g-signals, .g2 { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 150px 1fr 100px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv .k { margin-top: 10px; font-size: 16px; }
  .tblwrap { max-height: none; }
}

@media (max-width: 620px) {
  .stats { grid-template-columns: 1fr; }
  .stat .val { font-size: 26px; }
  .page-head { padding: 12px 14px; }
  .page-body { padding: 14px 14px 26px; }
  .filters { padding: 14px; gap: 12px; }
  .fld { flex: 1 1 100%; }
  input[type=search] { min-width: 0; width: 100%; }
  input.w-num { width: 100%; }
  .htools .btn span { display: none; }
  .btn { padding: 10px 14px; }
  .toolbar { align-items: stretch; }
  .toolbar-right { flex-wrap: wrap; }
  .cols { height: 190px; gap: 6px; }
  .col .cv { display: none; }
  .modal { max-height: 92vh; border-radius: 10px; }
  .mb { padding: 16px; }
  .ov { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   PDF izveštaj — samo za štampu, uvek svetla varijanta
   ========================================================================== */
#report { display: none; }
@media print {
  .app, #toast, .ov { display: none !important; }
  #report { display: block !important; }
  body { background: #fff; }
  @page { margin: 11mm; }
  /* Nijedna animacija ne sme da ostane u štampi: animacije se pri štampi ne
     izvršavaju, pa bi element sa fill-mode backwards ostao neiscrtan. */
  *, *::before, *::after {
    animation: none !important; transition: none !important;
    opacity: 1 !important; transform: none !important;
  }
}
#report { color: #1a2330; font-family: Arial, Helvetica, sans-serif; font-size: 11px; }
#report .rhead {
  background: #16243D; color: #fff; padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
#report .rhead img { height: 30px; }
#report .rhead .rttl { font-size: 13px; font-weight: 700; margin-top: 6px; color: #dbe7f3; }
#report .rhead .rmeta { text-align: right; font-size: 9.5px; color: #9fb2c6; line-height: 1.5; }
#report h2.rsec { font-size: 12.5px; color: #1f3a5f; border-bottom: 2px solid #2e75b6; padding-bottom: 3px; margin: 16px 20px 6px; page-break-after: avoid; }
#report .rkpis { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 20px; }
#report .rkpi { border: 1px solid #d3dde7; border-radius: 6px; padding: 7px 11px; min-width: 135px; }
#report .rkpi .l { font-size: 8.5px; color: #667; text-transform: uppercase; letter-spacing: .4px; }
#report .rkpi .v { font-size: 15px; font-weight: 700; color: #16243D; }
#report table.rtab { width: calc(100% - 40px); margin: 4px 20px; border-collapse: collapse; font-size: 10px; }
#report table.rtab th { background: #eef3f8; text-align: left; padding: 5px 7px; border-bottom: 1px solid #c8d4e0; color: #33475b; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#report table.rtab td { padding: 4px 7px; border-bottom: 1px solid #e6ecf2; }
#report table.rtab td.n { text-align: right; font-variant-numeric: tabular-nums; }
#report table.rtab tr { page-break-inside: avoid; }
#report .rb { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 9px; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#report .rb3 { background: #fde0e0; color: #b42318; }
#report .rb2 { background: #fdf0d5; color: #9a6700; }
#report .rb1 { background: #dcf5e3; color: #1a7f37; }
#report .rb0 { background: #e9edf2; color: #556; }
#report .rnote { margin: 4px 20px 0; font-size: 10px; color: #445; }
#report .rfoot { margin: 16px 20px; font-size: 9px; color: #778; border-top: 1px solid #d3dde7; padding-top: 8px; }
