:root{
  --bg:#11161d;
  --card:#1a212b;
  --muted:#94a1b2;
  --text:#e7edf5;
  --line:rgba(214,223,235,.12);
  --primary:#5c7fa6;
  --ok:#4a9164;
  --warn:#b78a3b;
  --danger:#b55c66;
  --bg-glow-a: rgba(255,255,255,.02);
  --bg-glow-b: rgba(255,255,255,.01);
  --topbar-bg: rgba(17,22,29,.94);
  --nav-bg: rgba(22,28,36,.99);
  --card-grad-a: rgba(33,41,53,.96);
  --card-grad-b: rgba(24,30,38,.98);
  --field-bg: rgba(9,12,16,.34);
  --btn-bg: rgba(255,255,255,.03);
  --btn-bg-hover: rgba(255,255,255,.06);
  --spinner-bg: rgba(20,25,32,.98);
  --shadow: 0 10px 24px rgba(0,0,0,.24);
  --radius: 10px;
}

html[data-theme="spring"]{
  --bg:#d9ddd5;
  --card:#edf0ea;
  --muted:#556156;
  --text:#1d241d;
  --line:rgba(56,71,58,.18);
  --primary:#5c6f5f;
  --ok:#617c68;
  --warn:#8f7650;
  --danger:#9a6268;
  --bg-glow-a: rgba(255,255,255,.02);
  --bg-glow-b: rgba(0,0,0,.01);
  --topbar-bg: rgba(230,233,226,.96);
  --nav-bg: rgba(239,242,237,.99);
  --card-grad-a: rgba(245,246,243,.98);
  --card-grad-b: rgba(232,236,230,.98);
  --field-bg: rgba(255,255,255,.78);
  --btn-bg: rgba(223,227,220,.84);
  --btn-bg-hover: rgba(214,220,212,.96);
  --spinner-bg: rgba(239,242,237,.98);
  --shadow: 0 8px 18px rgba(66,79,67,.12);
}

html[data-theme="spring-dark"]{
  --bg:#171d18;
  --card:#222a24;
  --muted:#a7b2a6;
  --text:#eef2ed;
  --line:rgba(188,201,189,.14);
  --primary:#7e9381;
  --ok:#6f8a73;
  --warn:#a58d5f;
  --danger:#a76f76;
  --bg-glow-a: rgba(255,255,255,.015);
  --bg-glow-b: rgba(255,255,255,.01);
  --topbar-bg: rgba(23,29,24,.95);
  --nav-bg: rgba(29,36,30,.99);
  --card-grad-a: rgba(37,45,38,.98);
  --card-grad-b: rgba(29,36,30,.99);
  --field-bg: rgba(8,10,9,.24);
  --btn-bg: rgba(255,255,255,.04);
  --btn-bg-hover: rgba(255,255,255,.07);
  --spinner-bg: rgba(28,34,29,.98);
  --shadow: 0 10px 22px rgba(0,0,0,.24);
}

html[data-theme="police"]{
  --bg:#121922;
  --card:#1b2532;
  --muted:#9daaba;
  --text:#e8eef6;
  --line:rgba(193,205,220,.14);
  --primary:#6f849c;
  --ok:#61798a;
  --warn:#9a8356;
  --danger:#a8646b;
  --bg-glow-a: rgba(255,255,255,.015);
  --bg-glow-b: rgba(255,255,255,.01);
  --topbar-bg: rgba(18,25,34,.96);
  --nav-bg: rgba(24,33,44,.99);
  --card-grad-a: rgba(31,41,55,.98);
  --card-grad-b: rgba(22,30,40,.99);
  --field-bg: rgba(8,12,18,.28);
  --btn-bg: rgba(255,255,255,.04);
  --btn-bg-hover: rgba(255,255,255,.07);
  --spinner-bg: rgba(23,31,41,.98);
  --shadow: 0 10px 24px rgba(0,0,0,.26);
}

html[data-theme="spring"] body{
  color-scheme: light;
}

html[data-theme="spring-dark"] body{
  color-scheme: dark;
}

html[data-theme="police"] body{
  color-scheme: dark;
  background:
    linear-gradient(180deg, rgba(255,255,255,.01), rgba(255,255,255,0)),
    var(--bg);
}

html[data-theme="police"] .topbar{
  background: var(--topbar-bg);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.02), 0 8px 18px rgba(0,0,0,.18);
  position: sticky;
  overflow: visible;
  z-index: 120;
}

html[data-theme="police"] .topbar::before{
  content:none;
}

html[data-theme="police"] .topbar::after{
  content:none;
}

html[data-theme="police"] .topbar > *{
  position: relative;
  z-index: 1;
}

html[data-theme="police"] .brand,
html[data-theme="police"] .topbar-actions{
  position:relative;
  z-index:1;
}

html[data-theme="police"] .topbar .nav-drop-menu{
  z-index:220;
}

html[data-theme="police"] .brand-title{
  letter-spacing: .4px;
  text-shadow:none;
}

html[data-theme="police"] .logo{
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}

html[data-theme="police"] .card{
  border-color: var(--line);
  background: linear-gradient(180deg, var(--card-grad-a), var(--card-grad-b));
  box-shadow: var(--shadow);
}

html[data-theme="police"] .btn{
  border-color: var(--line);
  background: var(--btn-bg);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

html[data-theme="police"] .btn:hover{
  background: var(--btn-bg-hover);
  transform: translateY(-1px);
  box-shadow:none;
}

html[data-theme="police"] .topbar-actions .btn,
html[data-theme="police"] .topbar .nav-drop > summary.btn{
  height: 42px;
  border-radius: 8px;
  border-color: var(--line);
  background: var(--btn-bg);
  box-shadow:none;
}

html[data-theme="police"] .topbar-actions .btn:hover,
html[data-theme="police"] .topbar .nav-drop > summary.btn:hover{
  background: var(--btn-bg-hover);
}

html[data-theme="police"] .topbar .nav-drop-menu{
  border-color: var(--line);
  background: var(--nav-bg);
}

html[data-theme="police"] .topbar .nav-drop-item:hover{
  background: rgba(255,255,255,.05);
}

html[data-theme="police"] .pill{
  border-color: var(--line);
  background: rgba(255,255,255,.04);
}

html[data-theme="police"] .online-badge{
  background: rgba(255,255,255,.03);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

@media (prefers-reduced-motion: reduce){
  html[data-theme="police"] .topbar::before,
  html[data-theme="police"] .topbar::after,
  html[data-theme="police"] .logo,
  html[data-theme="police"] .card::after,
  html[data-theme="police"] .topbar-actions .btn::after,
  html[data-theme="police"] .topbar .nav-drop > summary.btn::after,
  html[data-theme="police"] .online-badge{
    animation:none;
  }
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 10% 10%, var(--bg-glow-a), transparent 55%),
              radial-gradient(900px 700px at 80% 30%, var(--bg-glow-b), transparent 55%),
              var(--bg);
  color:var(--text);
  background-attachment: fixed;
}

a{color:inherit;text-decoration:none}
.container{max-width:1100px;margin:26px auto;padding:0 16px}
.topbar{
  position:sticky;top:0;z-index:10;
  background: var(--topbar-bg);
  backdrop-filter: blur(6px);
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 16px;
  box-shadow:0 1px 0 rgba(255,255,255,.02), 0 8px 18px rgba(0,0,0,.14);
}
.brand{display:flex;gap:14px;align-items:center}
.brand-title{font-weight:800;letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted);margin-top:2px}
.topbar-actions{display:flex;gap:10px;align-items:center}
.nav-toggle{display:none !important}
.nav-categories{display:flex;gap:10px;align-items:center}
.nav-drop{position:relative}
.nav-drop > summary{
  list-style:none;
  cursor:pointer;
}
.nav-drop > summary::-webkit-details-marker{display:none}
.nav-drop-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  min-width:max-content;
  width:max-content;
  max-width:90vw;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--nav-bg);
  box-shadow: var(--shadow);
  padding:6px;
  display:none;
  z-index:30;
}
.nav-drop[open] .nav-drop-menu{display:block}
.nav-drop-menu-right{left:auto; right:0}
.notif-trigger{
  min-width:0;
  width:44px;
  height:44px;
  padding:0;
  justify-content:center;
  position:relative;
  gap:0;
}
.notif-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:999px;
  font-size:11px;
  line-height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.notif-menu{min-width:340px; max-width:min(420px, 92vw)}
.notif-item{
  border:1px solid var(--line);
  border-radius:8px;
  padding:8px 10px;
  margin-bottom:8px;
  background:rgba(255,255,255,.025);
}
.notif-item.unread{border-color:rgba(120,190,255,.45)}
.notif-item-title{font-weight:700; margin-bottom:3px}
.notif-item-text{font-size:13px; color:var(--muted)}
.notif-item-time{font-size:12px; color:var(--muted); margin-top:4px}
.nav-drop-item{
  display:block;
  padding:10px 12px;
  border-radius:8px;
}
.nav-drop-item:hover{background:rgba(255,255,255,.05)}

.card{
  background: linear-gradient(180deg, var(--card-grad-a), var(--card-grad-b));
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:18px;
  box-shadow: var(--shadow);
  animation:none;
}

h1{margin:0 0 10px;font-size:26px}
h2{margin:0 0 10px;font-size:18px}
p{margin:8px 0}

.muted{color:var(--muted)}
.divider{height:1px;background:var(--line);margin:16px 0}

.grid{display:grid;gap:16px}
@media (min-width: 900px){ .grid{grid-template-columns: 1.3fr 1fr;} }

.form{display:grid;gap:12px}
label{display:grid;gap:6px;font-size:14px}
input,textarea,select{
  width:100%;
  padding:12px 12px;
  border-radius: 8px;
  border:1px solid var(--line);
  background: var(--field-bg);
  color:var(--text);
  outline:none;
  transition:.15s ease;
}
input:focus,textarea:focus,select:focus{border-color: color-mix(in srgb, var(--primary) 72%, white 8%); box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent)}
textarea{resize:vertical;min-height:110px}

.btn{
  padding:11px 14px;
  border-radius: 8px;
  border:1px solid var(--line);
  background: var(--btn-bg);
  color:var(--text);
  cursor:pointer;
  transition:.15s ease;
  display:inline-flex;gap:8px;align-items:center;justify-content:center;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-size:12px;
  font-weight:700;
}
.btn:hover{transform:translateY(-1px);background: var(--btn-bg-hover);box-shadow:none}
.btn:active{transform:translateY(0px)}
.btn.primary{background: color-mix(in srgb, var(--primary) 18%, transparent); border-color: color-mix(in srgb, var(--primary) 42%, var(--line))}
.btn.primary:hover{background: color-mix(in srgb, var(--primary) 24%, transparent)}
.btn.ghost{background: transparent}
.btn.full{width:100%}

.alert{
  padding:10px 12px;
  border-radius: 8px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.alert.error{border-color: rgba(255,90,122,.35); background: rgba(255,90,122,.08)}

.row{display:flex;gap:10px;align-items:center}
.row input{flex:1}

.results{display:grid;gap:10px;margin-top:12px}
.item{
  border:1px solid var(--line);
  border-radius: 10px;
  padding:12px;
  background: rgba(255,255,255,.025);
}
.item-top{display:flex;justify-content:space-between;gap:10px;align-items:center}
.item-title{font-weight:700}
.money{font-weight:700; color: rgba(62,156,53);}
.item-sub{color:var(--muted);font-size:13px;margin-top:6px}
.pill{
  display:inline-flex;align-items:center;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  font-size:12px;
}
.pill.ok{border-color: rgba(46,229,157,.35); background: rgba(46,229,157,.10)}
.pill.warn{border-color: rgba(255,207,90,.35); background: rgba(255,207,90,.10)}
.pill.danger{border-color: rgba(255,90,122,.35); background: rgba(255,90,122,.10)}

.kv{display:grid;grid-template-columns: 130px 1fr;gap:10px 12px;font-size:14px}
.k{color:var(--muted)}
.v{color:var(--text)}
.v.pre{white-space:pre-wrap;line-height:1.35}

.checkbox{display:flex;gap:10px;align-items:center;color:var(--muted);font-size:14px;margin-top:10px}
.checkbox input{width:auto}

.captcha-wrap{border:1px dashed var(--line);border-radius:10px;padding:12px;background:rgba(255,255,255,.02)}
.captcha{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.captcha-q{font-weight:800}

.toast{
  position:fixed;left:50%;bottom:24px;transform:translateX(-50%);
  padding:12px 14px;border-radius: 8px;
  border:1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, black 12%);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  max-width: min(520px, calc(100% - 30px));
}
.hidden{display:none !important}
.spinner.hidden{display:none !important}


.spinner{
  position:fixed;inset:0;
  background: rgba(0,0,0,.28);
  display:grid;place-items:center;
  animation: fade .15s ease-out;
}
@keyframes fade{from{opacity:0}to{opacity:1}}
.spinner-card{
  width:min(420px, calc(100% - 40px));
  border:1px solid var(--line);
  border-radius: 10px;
  padding:16px;
  background: var(--spinner-bg);
  box-shadow: var(--shadow);
  display:flex;gap:12px;align-items:center;
}
.loader{
  width:22px;height:22px;border-radius:50%;
  border:3px solid rgba(255,255,255,.18);
  border-top-color: rgba(79,140,255,.9);
  animation: spin .7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.spinner-text{color:var(--muted)}

/* === Role badges === */
.role-admin{
  border-color: rgba(255,90,122,.45);
  background: rgba(255,90,122,.15);
  color: #ffb3c1;
}

.role-curator{
  border-color: rgba(79,140,255,.45);
  background: rgba(79,140,255,.18);
  color: #bcd4ff;
}

.role-leader{
  border-color: rgba(255,207,90,.45);
  background: rgba(255,207,90,.18);
  color: #ffe6a3;
}

.role-player{
  border-color: rgba(180,180,180,.35);
  background: rgba(255,255,255,.06);
  color: #e0e0e0;
}
.role-minfin{
  border-color: rgba(46,229,157,.45);
  background: rgba(46,229,157,.15);
  color: #bff7e2;
}

.role-x{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.85);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  line-height: 1;
  font-weight: 900;
  padding: 0;
}
.role-x:hover{
  border-color: rgba(255,90,122,.45);
  background: rgba(255,90,122,.14);
}

/* === Custom dropdown === */
.dd{ position: relative; }
.dd-btn{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 12px;
  border-radius:8px;
  border:1px solid var(--line);
  background: var(--field-bg);
  color: var(--text);
  cursor:pointer;
  transition:.15s ease;
}
.dd-btn:hover{ background: var(--btn-bg-hover); }
.dd-btn:focus{
  outline:none;
  border-color: color-mix(in srgb, var(--primary) 72%, white 8%);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.dd-caret{ color: rgba(255,255,255,.75); }

.dd-menu{
  position:absolute;
  top: calc(100% + 8px);
  left:0; right:0;
  border-radius:10px;
  border:1px solid var(--line);
  background: var(--nav-bg);
  box-shadow: var(--shadow);
  overflow:hidden;
  z-index:50;
  transform-origin: top;
  animation: ddpop .12s ease-out;
}
@keyframes ddpop{
  from{ opacity:0; transform: translateY(-6px) scale(.98); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}
.dd-item{
  width:100%;
  text-align:left;
  padding:12px 12px;
  border:none;
  background: transparent;
  color: var(--text);
  cursor:pointer;
}
.dd-item:hover{ background: rgba(255,255,255,.05); }

/* Compact static input */
.static-input{
  max-width: 220px;
  padding: 8px 10px;
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
}

/* Audit modal */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  z-index: 100;
}
.modal-card{
  width: min(900px, 92vw);
  max-height: 80vh;
  overflow: auto;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.modal-head{
  display:flex;
  justify-content: space-between;
  align-items:center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

/* Footer */
.app-footer{
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.12);
}

@media (max-width: 980px){
  .topbar{padding:10px 12px}
  .brand-sub{display:none}
  .topbar-actions{flex-wrap:wrap;justify-content:flex-end}
  .nav-toggle{display:inline-flex !important}
  .nav-categories{display:none;flex-direction:column;align-items:stretch;width:100%}
  .topbar-actions.open .nav-categories{display:flex}
  .nav-drop{width:100%}
  .nav-drop > summary{width:100%}
  .nav-drop-menu{
    position:static;
    min-width:0;
    margin-top:6px;
  }
}

.footer-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.55);
}

html[data-theme="spring"] .nav-drop-item:hover{
  background: rgba(0,0,0,.04);
}

html[data-theme="spring"] input,
html[data-theme="spring"] textarea,
html[data-theme="spring"] select{
  border-color: rgba(41,83,56,.28);
  background: rgba(222,232,219,.88);
  color: var(--text);
}

html[data-theme="spring"] input::placeholder,
html[data-theme="spring"] textarea::placeholder{
  color: rgba(95,111,102,.78);
}

html[data-theme="spring"] input:focus,
html[data-theme="spring"] textarea:focus,
html[data-theme="spring"] select:focus{
  border-color: rgba(92,111,95,.46);
  box-shadow: 0 0 0 3px rgba(92,111,95,.14);
}

html[data-theme="spring"] .btn{
  border-color: rgba(41,83,56,.26);
  background: rgba(214,226,211,.88);
  color: #2a332b;
}

html[data-theme="spring"] .btn:hover{
  background: rgba(225,234,222,.94);
}

html[data-theme="spring"] .btn.ghost{
  background: transparent;
}

html[data-theme="spring"] .btn.primary{
  background: rgba(92,111,95,.14);
  border-color: rgba(92,111,95,.30);
  color: #243025;
}

html[data-theme="spring"] .btn.primary:hover{
  background: rgba(92,111,95,.22);
}

html[data-theme="spring"] .btn.warning{
  border-color: rgba(247,185,85,.34);
  background: rgba(247,185,85,.18);
  color: #724b00;
}

html[data-theme="spring"] .btn.warning:hover{
  background: rgba(247,185,85,.26);
}

html[data-theme="spring"] .btn.danger{
  border-color: rgba(235,111,146,.34);
  background: rgba(235,111,146,.16);
  color: #6f1838;
}

html[data-theme="spring"] .btn.danger:hover{
  background: rgba(235,111,146,.24);
}

html[data-theme="spring"] .tag,
html[data-theme="spring"] .pill,
html[data-theme="spring"] .item,
html[data-theme="spring"] .alert,
html[data-theme="spring"] .captcha-wrap{
  border-color: rgba(41,83,56,.20);
  background: rgba(214,225,211,.72);
}

html[data-theme="spring"] .lbl{
  color: rgba(21,33,26,.78);
}

html[data-theme="spring"] .pill.ok{
  border-color: rgba(75,191,116,.36);
  background: rgba(75,191,116,.18);
  color: #1f6136;
}

html[data-theme="spring"] .pill.warn{
  border-color: rgba(247,185,85,.36);
  background: rgba(247,185,85,.20);
  color: #724b00;
}

html[data-theme="spring"] .pill.danger{
  border-color: rgba(235,111,146,.36);
  background: rgba(235,111,146,.18);
  color: #7b2343;
}

html[data-theme="spring"] .pill.checked{
  border-color: rgba(77,140,255,.34);
  background: rgba(77,140,255,.16);
  color: #184f82;
}

html[data-theme="spring"] .pill.cok{
  border-color: rgba(255,136,0,.34);
  background: rgba(255,214,153,.22);
  color: #7a4b00;
}

html[data-theme="spring"] .pill.role-gov{
  border-color: rgba(120,119,255,.34);
  background: rgba(120,119,255,.14);
  color: #413faf;
}

html[data-theme="spring"] .pill.role-lspd{
  border-color: rgba(79,140,255,.34);
  background: rgba(79,140,255,.14);
  color: #1d5a9d;
}

html[data-theme="spring"] .pill.role-bcsd{
  border-color: rgba(72,199,142,.34);
  background: rgba(72,199,142,.16);
  color: #1d6c4a;
}

html[data-theme="spring"] .pill.role-fib{
  border-color: rgba(255,159,64,.34);
  background: rgba(255,159,64,.16);
  color: #8a4d11;
}

html[data-theme="spring"] .pill.role-ng{
  border-color: rgba(24,201,196,.34);
  background: rgba(24,201,196,.16);
  color: #116d6a;
}

html[data-theme="spring"] .pill.role-ems{
  border-color: rgba(255,90,122,.34);
  background: rgba(255,90,122,.14);
  color: #8a2540;
}

html[data-theme="spring"] .toast{
  border-color: rgba(41,83,56,.22);
  background: rgba(217,228,214,.94);
  color: var(--text);
}

html[data-theme="spring"] .spinner{
  background: rgba(247,255,243,.6);
}

html[data-theme="spring"] .loader{
  border-color: rgba(93,187,99,.18);
  border-top-color: rgba(93,187,99,.95);
}

html[data-theme="spring"] .role-admin{
  border-color: rgba(235,111,146,.34);
  background: rgba(235,111,146,.16);
  color: #7b2343;
}

html[data-theme="spring"] .role-curator{
  border-color: rgba(104,170,235,.34);
  background: rgba(104,170,235,.16);
  color: #174d80;
}

html[data-theme="spring"] .role-leader{
  border-color: rgba(247,185,85,.34);
  background: rgba(247,185,85,.18);
  color: #724b00;
}

html[data-theme="spring"] .role-player{
  border-color: rgba(95,111,102,.24);
  background: rgba(95,111,102,.1);
  color: #31463a;
}

html[data-theme="spring"] .role-minfin{
  border-color: rgba(75,191,116,.34);
  background: rgba(75,191,116,.16);
  color: #1f6136;
}

html[data-theme="spring"] .role-x{
  border-color: rgba(41,83,56,.20);
  background: rgba(217,228,214,.88);
  color: #31503d;
}

html[data-theme="spring"] .role-x:hover{
  border-color: rgba(235,111,146,.34);
  background: rgba(255,235,241,.95);
}

html[data-theme="spring"] .dd-btn{
  border-color: rgba(41,83,56,.26);
  background: rgba(222,232,219,.90);
  color: var(--text);
}

html[data-theme="spring"] select.mini-select,
html[data-theme="spring"] select.nice-select,
html[data-theme="spring"] #orgRole,
html[data-theme="spring"] #matrixSelect,
html[data-theme="spring"] #matrixSelectCurator,
html[data-theme="spring"] #matrixSelectLeader{
  border-color: rgba(41,83,56,.26);
  background-color: rgba(222,232,219,.90);
  color: var(--text);
}

html[data-theme="spring"] .dd-btn:hover{
  background: rgba(229,236,226,.94);
}

html[data-theme="spring"] .dd-btn:focus{
  border-color: rgba(93,187,99,.55);
  box-shadow: 0 0 0 4px rgba(93,187,99,.14);
}

html[data-theme="spring"] .dd-caret{
  color: rgba(31,58,43,.75);
}

html[data-theme="spring"] .dd-menu,
html[data-theme="spring"] .modal-card{
  border-color: rgba(41,83,56,.20);
  background: rgba(214,226,212,.98);
}

html[data-theme="spring"] .modal-head{
  border-bottom-color: rgba(63,125,84,.12);
}

html[data-theme="spring"] .dd-item:hover{
  background: rgba(93,187,99,.12);
}

html[data-theme="spring"] .app-footer{
  border-top-color: rgba(41,83,56,.18);
  background: rgba(204,217,201,.86);
}

html[data-theme="spring"] .footer-inner{
  color: rgba(31,58,43,.78);
}

html[data-theme="spring"] .app-footer a{
  color: #245b3c;
}

html[data-theme="spring"] .online-badge{
  background: rgba(214,226,211,.88);
  color: #1f3a2b;
  box-shadow: inset 0 0 0 1px rgba(41,83,56,.16);
}

html[data-theme="spring-dark"] .nav-drop-item:hover{
  background: rgba(118,165,127,.12);
}

html[data-theme="spring-dark"] input:focus,
html[data-theme="spring-dark"] textarea:focus,
html[data-theme="spring-dark"] select:focus{
  border-color: rgba(86,185,106,.45);
  box-shadow: 0 0 0 4px rgba(86,185,106,.14);
}

html[data-theme="spring-dark"] .btn.primary{
  background: rgba(86,185,106,.20);
  border-color: rgba(86,185,106,.38);
}

html[data-theme="spring-dark"] .btn.primary:hover{
  background: rgba(86,185,106,.28);
}

html[data-theme="spring-dark"] .btn.warning{
  background: rgba(239,189,89,.16);
  border-color: rgba(239,189,89,.30);
}

html[data-theme="spring-dark"] .btn.warning:hover{
  background: rgba(239,189,89,.24);
}

html[data-theme="spring-dark"] .btn.danger{
  background: rgba(225,122,156,.16);
  border-color: rgba(225,122,156,.30);
}

html[data-theme="spring-dark"] .btn.danger:hover{
  background: rgba(225,122,156,.24);
}

html[data-theme="spring-dark"] .lbl{
  color: #dbeadb;
}

html[data-theme="spring-dark"] .pill.ok{
  border-color: rgba(100,207,131,.34);
  background: rgba(100,207,131,.14);
  color: #dff7e4;
}

html[data-theme="spring-dark"] .pill.warn{
  border-color: rgba(239,189,89,.34);
  background: rgba(239,189,89,.14);
  color: #fff0c8;
}

html[data-theme="spring-dark"] .pill.danger{
  border-color: rgba(225,122,156,.34);
  background: rgba(225,122,156,.14);
  color: #ffd8e5;
}

html[data-theme="spring-dark"] .dd-btn{
  background: rgba(11,19,14,.34);
  border-color: rgba(158,197,166,.16);
}

html[data-theme="spring-dark"] .dd-btn:hover{
  background: rgba(118,165,127,.12);
}

html[data-theme="spring-dark"] .dd-btn:focus{
  box-shadow: 0 0 0 3px rgba(86,185,106,.14);
}

html[data-theme="spring-dark"] .dd-caret{
  color: rgba(219,234,219,.75);
}

html[data-theme="spring-dark"] .dd-menu,
html[data-theme="spring-dark"] .modal-card{
  border-color: rgba(158,197,166,.16);
  background: rgba(24,37,28,.98);
}

html[data-theme="spring-dark"] .dd-item:hover{
  background: rgba(118,165,127,.12);
}

html[data-theme="spring-dark"] .toast{
  background: rgba(20,32,25,.94);
  border-color: rgba(158,197,166,.16);
}

html[data-theme="spring-dark"] .spinner{
  background: rgba(12,20,15,.55);
}

html[data-theme="spring-dark"] .loader{
  border-top-color: rgba(86,185,106,.92);
}

html[data-theme="spring-dark"] .app-footer{
  border-top-color: rgba(158,197,166,.16);
  background: rgba(20,32,25,.82);
}

html[data-theme="spring-dark"] .footer-inner{
  color: #d6e5d8;
}

html[data-theme="spring-dark"] .app-footer a{
  color: #f0bfd0;
}

html[data-theme="spring-dark"] .online-badge{
  background: rgba(36,56,42,.88);
  color: #dff7e4;
  box-shadow: inset 0 0 0 1px rgba(100,207,131,.16);
}

html, body{
  height: 100%;
}

body{
  display: flex;
  flex-direction: column;
}

/* Make main content take space so auth/register cards don't get squashed */
.container{
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.container > .card{
  width: min(520px, 100%);
}

.logo{
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.item-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
}

.item-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.item-top{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;   /* важливо */
  gap: 20px;                 /* дистанція між колонками */
}

.item-top > div:first-child{
  flex: 1 1 auto;            /* ліва частина росте */
  min-width: 0;
}

/* Compact action buttons (Lock / Unlock / Delete) */
.item-actions{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  margin-top: 6px;   /* 👈 ОЦЕ */
}

/* Warning buttons (Lock / Unlock) */
.btn.warning{
  border-color: rgba(183,138,59,.40);
  background: rgba(183,138,59,.14);
  color: #f1d4a1;
}

.btn.warning:hover{
  background: rgba(183,138,59,.22);
}

.btn.danger{
  padding:11px 14px;
  border-radius: 8px;
  border-color: rgba(181,92,102,.42);
  background: rgba(181,92,102,.14);
  color: #ffffff;
}

.btn.danger:hover{
  background: rgba(181,92,102,.22);
}

/* Agency roles (new) */
.pill.role-gov{  border-color: rgba(120,119,255,.55); background: rgba(120,119,255,.16); color:#d8d8ff; }
.pill.role-lspd{ border-color: rgba(79,140,255,.60);  background: rgba(79,140,255,.14);  color:#cfe0ff; }
.pill.role-bcsd{ border-color: rgba(72,199,142,.60);  background: rgba(72,199,142,.14);  color:#c8f5e2; }
.pill.role-fib{  border-color: rgba(255,159,64,.60);  background: rgba(255,159,64,.14);  color:#ffe0c9; }
.pill.role-ng{   border-color: rgba(24,201,196,.60);  background: rgba(24,201,196,.14);  color:#c9fffe; }
.pill.role-ems{  border-color: rgba(255,90,122,.60);  background: rgba(255,90,122,.14);  color:#ffcad6; }

.pill.checked{  border-color: rgba(0, 60, 255, 0.6);  background: rgba(0, 153, 255, 0.14);  color:#cfe0ff; }
.pill.cok{  border-color: rgba(255, 136, 0, 0.6);  background: rgba(255, 240, 192, 0.14);  color:#fffbd5; }

.tag-filter{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}

.tag{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  font-size: 13px;
  user-select:none;
}
.tag input{ transform: translateY(1px); }

#bulkRemoveBtn{
  width: 100%;
  min-height: 36px;
  white-space: normal;
  text-align: center;
}

.table{display:block;width:100%;overflow:auto;border:1px solid var(--line);border-radius:10px}
.table table{width:100%;border-collapse:collapse}
.table th,.table td{padding:10px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.table tr:hover{background:rgba(255,255,255,.02)}
.lbl{display:block;margin:8px 0 6px;color:var(--muted);font-size:12px}
.input{width:100%;box-sizing:border-box}
.hidden{display:none!important}

#snow-canvas{
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

.emoji-confetti-layer{
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}
.emoji-confetti{
  position: absolute;
  font-size: 24px;
  will-change: transform, opacity;
  animation: emoji-fall var(--dur, 1400ms) cubic-bezier(.2,.8,.2,1) forwards;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.15));
}
@keyframes emoji-fall{
  0%{
    transform: translate(var(--x0), var(--y0)) rotate(var(--r0)) scale(var(--s0));
    opacity: 0;
  }
  10%{ opacity: 1; }
  100%{
    transform: translate(var(--x1), var(--y1)) rotate(var(--r1)) scale(var(--s1));
    opacity: 0;
  }
}

/* акуратне прев'ю документа */
.preview-box{
  width: 100%;
  max-height: 420px;          /* головне обмеження */
  overflow: auto;             /* якщо документ дуже довгий */
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background: rgba(0,0,0,.18);
  padding: 10px;
}

/* canvas НЕ повинен рости до "натурального" розміру */
#docCanvas{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  color: #e6e6e6;
  font-size: 14px;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.online-badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 rgba(46, 204, 113, 0.7);
  animation: pulse 2s infinite;
}

.online-badge.offline .dot {
  background: #999;
  animation: none;
}

.online-badge .count {
  font-weight: 700;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,204,113,0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}

a.link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
a.link:hover {
  opacity: 0.85;
}

.premii-minfin-page .premii-action-spaced {
  margin-top: 10px;
}

.premii-export-card {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}

.premii-export-row {
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
}

.premii-export-label {
  margin: 0;
  min-width: 100%;
}

.premii-export-input {
  flex: 0 0 200px;
  max-width: 200px;
}

.premii-export-row .btn {
  flex: 0 0 auto;
}

.theme-switch-card{
  border:1px solid var(--line);
  border-radius:10px;
  padding:12px 14px;
  background:rgba(255,255,255,.025);
}

.theme-switch{
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
}

.theme-switch input{
  position:absolute;
  opacity:0;
  width:0;
  height:0;
}

.theme-switch-slider{
  width:46px;
  height:26px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.12);
  position:relative;
  transition:.2s ease;
  flex:0 0 auto;
}

.theme-switch-slider::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:rgba(255,255,255,.9);
  transition:.2s ease;
}

.theme-switch input:checked + .theme-switch-slider{
  background:rgba(46,229,157,.24);
  border-color:rgba(46,229,157,.48);
}

.theme-switch input:checked + .theme-switch-slider::after{
  transform:translateX(20px);
  background:rgba(46,229,157,.95);
}

.theme-switch-label{font-weight:700}
.theme-switch-state{font-size:12px; color:var(--muted)}

.premii-matrix-page {
  width: 80vw;
  max-width: 80vw;
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (max-width: 980px) {
  .premii-export-card {
    width: 100%;
  }
  .premii-matrix-page {
    width: 100%;
    max-width: 100%;
  }
}
