:root{
  --bg:#f6f7fb;
  --fg:#101828;
  --muted:#475467;
  --card:#ffffff;
  --line:#e4e7ec;
  --accent:#2563eb;
}

body{
  margin:0;
  font-family:"IBM Plex Sans","Segoe UI","Segoe UI Variable",system-ui,-apple-system,Roboto,Arial,sans-serif;
  font-weight:500;
  background:var(--bg);
  color:var(--fg);
}

.container{
  max-width:100%;
  margin:0 auto;
  padding:12px 22px;
}

.topbar{
  border-bottom:1px solid var(--line);
  background:var(--card);
}

/* Top menu layout (left nav + right tools) */
.topbar .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
  margin-left:auto;
}

.nav{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
}

.brand{
  color:var(--fg);
  text-decoration:none;
  font-weight:800;
  margin-right:16px;
}

.nav a{
  color:var(--muted);
  text-decoration:none;
  margin-right:12px;
  font-weight:600;
}
.nav a:hover{ color:var(--fg); }

.auth{
  display:flex;
  gap:10px;
  align-items:center;
}

.muted{ color:var(--muted); }

.footer{
  border-top:1px solid var(--line);
  margin-top:32px;
  background:transparent;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px;
  margin:16px 0;
  box-shadow: 0 1px 2px rgba(16,24,40,0.06);
}

.grid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:12px;
}
@media(max-width:1100px){ .grid{ grid-template-columns:repeat(3,1fr);} }
@media(max-width:700px){ .grid{ grid-template-columns:1fr; } }

.big{
  font-size:28px;
  font-weight:800;
  margin:8px 0;
}

.table{
  width:100%;
  border-collapse:collapse;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  box-shadow: 0 1px 2px rgba(16,24,40,0.06);
}
.table th,.table td{
  padding:10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:14px;
  vertical-align:top;
}
.table th{
  color:var(--muted);
  font-weight:700;
  background:#fbfcfe;
}

.table th a{
  color:var(--muted);
  text-decoration:none;
}
.table th a:hover{
  color:var(--fg);
  text-decoration:underline;
}

.inline{ display:inline; }

.linkbtn{
  background:transparent;
  border:0;
  color:var(--muted);
  cursor:pointer;
  text-decoration:underline;
  padding:0;
}

code{
  background:#f2f4f7;
  border:1px solid var(--line);
  border-radius:8px;
  padding:2px 6px;
  color:var(--fg);
}

/* Compare / forms */
.grid2{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
}
@media (max-width:900px){
  .grid2{ grid-template-columns:1fr; }
}

label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin-bottom:6px;
  font-weight:700;
}

input[type=text], input[type=number]{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--card);
  color:inherit;
  outline:none;
}
input[type=text]:focus, input[type=number]:focus{
  border-color: rgba(37,99,235,0.45);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.btn{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#f2f4f7;
  color:inherit;
  cursor:pointer;
  font-weight:700;
}
.btn:hover{ background:#e4e7ec; }

.btn-ghost{
  background:transparent;
}
.btn-ghost:hover{
  background: rgba(16,24,40,0.04);
}

.row-selected{
  outline:1px solid rgba(37,99,235,0.25);
  background:rgba(37,99,235,0.04);
}

/* Wide tables */
.table-scroll{
  width:100%;
  overflow-x:auto;
  border-radius:16px;
}

.table-wide{
  min-width: 1600px;
}

/* Compare cell rendering */
.cmp-cell{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:12px;
  line-height:1.2;
}

.cmp-line{
  white-space:nowrap;
}

.cmp-sel{
  display:inline-block;
  min-width:34px;
  font-weight:800;
  color:var(--fg);
}

.cmp-bf, .cmp-bk, .cmp-diff{
  display:inline-block;
  margin-left:6px;
}

.cmp-bf{ color:#1d4ed8; font-weight:700; }
.cmp-bk{ color:#047857; font-weight:700; }
.cmp-diff{ color:var(--muted); font-weight:700; }


/* Form grid */

.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid4 { grid-template-columns: 1fr; } }

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr; } }

.lbl{
  display:block;
  margin:0 0 6px;
  font-size:12px;
  font-weight:800;
  color: var(--muted);
}

.cmp-filter-form{
  border-radius:18px;
  padding:12px;
  margin:0 0 10px;
}

.cmp-options-bar{
  display:flex;
  justify-content:flex-end;
  margin: 0 0 10px;
}

.modal-card.cmp-options-modal{
  max-width: 1180px;
}

.cmp-options-modal .cmp-filter-form{
  margin:0;
}

/* Compare: 5-column filter layout (compact, 27" friendly) */
.cmp-grid5{
  display:grid;
  /* use the available horizontal space (27" friendly) */
  grid-template-columns:
    minmax(210px, 1.05fr)
    minmax(210px, 1.05fr)
    minmax(280px, 1.35fr)
    minmax(240px, 1.20fr)
    minmax(340px, 1.60fr);
  gap:12px;
  align-items:start;
}
@media (max-width: 1400px){
  .cmp-grid5{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px){
  .cmp-grid5{ grid-template-columns: 1fr; }
}

.cmp-filter-form .multi-select{ min-height: 96px; }
.filter-stack .stack-row{ margin-bottom:8px; }

.cmp-form-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  padding-bottom:6px;
  margin-bottom:8px;
  border-bottom:1px solid rgba(16,24,40,0.10);
}

.cmp-form-title{
  font-weight:900;
  font-size:14px;
  letter-spacing:.2px;
  margin-bottom:4px;
}

.cmp-form-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}

.filter-box{
  border:1px solid rgba(16,24,40,0.10);
  background: rgba(255,255,255,0.55);
  border-radius:16px;
  padding:8px;
}

.filter-box-compact{ padding:8px; }

.filter-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
}

.select-sm{
  padding:7px 10px;
  border-radius:10px;
}

.filter-search-inline{ margin:0; width: 55%; min-width: 140px; padding:4px 8px; height:28px; }

.cmp-inline-controls{ display:flex; gap:10px; align-items:flex-end; }
.cmp-inline-controls .mini{ flex:1; min-width:0; }
.lbl-mini{ margin:0 0 4px; font-size:11px; }

.cmp-inline-actions{ display:flex; gap:8px; align-items:center; justify-content:flex-end; }
.cmp-inline-controls .mini-actions{ flex:0 0 auto; min-width: 170px; }

.start-cell{ white-space:nowrap; vertical-align:top; }
.provider-cell{ white-space:nowrap; }
.league-cell{ vertical-align:top; }
.league-cell .cmp-league{ font-weight:600; }
.cmp-event-link{display:block;text-decoration:none;color:inherit;}
.cmp-event-link:hover{cursor:pointer;}
.cmp-event-link:hover .cmp-league,.cmp-event-link:hover strong{text-decoration:underline;}

.cmp-teams{
  margin-top:4px;
  line-height:1.15;
  display:grid;
  grid-template-columns: 1fr 1fr;
  align-items:baseline;
  gap:0;
}
.cmp-teams strong{ font-weight:600; }
.cmp-teams .cmp-home, .cmp-teams .cmp-away{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}
.cmp-teams .cmp-home{ padding-right:10px; }
.cmp-teams .cmp-away{ text-align:right; border-left:1px solid rgba(16,24,40,0.18); padding-left:10px; }

/* Make multiselects more usable */
.multi-select{ min-height: 120px; }
.grid3{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
}
@media (max-width:900px){
  .grid3{ grid-template-columns:1fr; }
}

.select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--card);
  color:inherit;
  outline:none;
}
.select:focus{
  border-color: rgba(37,99,235,0.45);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.row-group td{ background: #ffffff; }
.row-sub td{ background: #fbfcfe; }

.flag{
  width:32px;
  font-size:18px;
  vertical-align:top;
}

.odd-link{
  text-decoration:none;
  color:inherit;
  cursor:pointer;
}
.odd-link:hover{
  text-decoration:underline;
}

.odd-val{
  padding:1px 5px;
  border-radius:6px;
  display:inline-block;
  line-height:1.2;
}
.odd-high{
  background:#e9fbe9;
  border:1px solid #bfe7bf;
}
.odd-low{
  background: rgba(255,255,255,0.78);
  border:1px solid rgba(0,60,130,0.18);
  color: inherit;
}

.cmp-delta{ display:inline-block; margin-left:6px; font-size:11px; color: var(--muted); font-weight:700; }

/* Mini tables inside modal */
.table-mini{
  box-shadow:none;
  border-radius:12px;
}
.table-mini th,.table-mini td{
  padding:8px 10px;
  font-size:13px;
}

/* Modal */
.modal.hidden{ display:none; }
.modal{
  position:fixed;
  inset:0;
  z-index:9999;
}
.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0, 20, 55, 0.72);
  backdrop-filter: blur(2px);
}
.modal-card{
  position:relative;
  max-width: 860px;
  margin: 6vh auto;
  background: #ffffff;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  box-shadow: 0 10px 30px rgba(16,24,40,0.25);
}
.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background:#fbfcfe;
}
.modal-title{
  font-weight:900;
  font-size:16px;
  margin-bottom:2px;
}
.modal-body{
  padding:14px 16px;
  max-height: 70vh;
  overflow:auto;
}

/* CSV viewer modal */
.csv-modal-card{ max-width: 980px; }
.csv-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}
.csv-text{
  width:100%;
  min-height:56vh;
  height:56vh;
  resize:vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:12.5px;
  line-height:1.35;
  padding:12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#ffffff;
}
.odd-csv-link{
  color: inherit;
  text-decoration: none;
}
.odd-csv-link:hover{ text-decoration: underline; }

.btn-small{
  padding:8px 10px;
  border-radius:10px;
  font-size:13px;
}


/* Compare grouped headers */
.table th.grp-head{
    text-align:center !important;
    font-weight:600;
    white-space:nowrap;
    vertical-align:middle;
    padding:8px 6px;
}
.table th.sel-head{
    text-align:center !important;
    white-space:nowrap;
    font-weight:600;
    font-size:0.95rem;
    vertical-align:middle;
    padding:6px 6px;
}
.table th.sel-head a{
    display:flex;
    justify-content:center;
    align-items:center;
    width:100%;
    text-align:center;
}
.th-flag{ width: 36px; text-align:center; }

/* Compare: keep selection headers aligned with odds columns */
.table-wide th.sel-head,
.table-wide td.odd{
  min-width:72px;
  width:72px;
}


/* Compare: single-row per event (B/P within cell) */
.odd-pair{display:flex;flex-direction:column;gap:2px;line-height:1.15}
.odd-line{white-space:nowrap}
.tag{display:inline-block;min-width:18px;padding:1px 6px;border-radius:10px;font-size:11px;font-weight:700;vertical-align:middle}
.tag-b{background:#eef2ff;color:#1e3a8a;border:1px solid #c7d2fe}
.tag-p{background:#ecfeff;color:#155e75;border:1px solid #a5f3fc}
.cmp-delta{font-size:11px;margin-left:6px}

.row-provider td:not([rowspan]) { vertical-align: middle; }
.row-provider td[rowspan] { vertical-align: top; padding-top:8px; }

/* Compare: filters + alternating event stripes */
.filter-search{ margin-bottom:8px; }

.table tbody tr.cmp-even td{ background:#ffffff; }
.table tbody tr.cmp-odd td{ background:#f7f9fc; }

/* Compare: highlight Betfair row (exclude rowspan cells to avoid coloring the whole group) */
.table tbody tr.bf-row td:not([rowspan]){
  background: rgba(219, 234, 254, 0.55) !important;
  border-bottom-color: rgba(37,99,235,0.18);
}
.table tbody tr.bf-row td.muted{
  font-weight:900;
}

/* Compare: make odds columns tighter */
.table-wide td.odd{ padding:6px 6px; text-align:center; }
.table-wide td.muted.provider-cell{ font-weight:700; }

/* Compare: accordion providers (collapse non-essential rows) */
.cmp-accordion-row td{
  padding-top:4px !important;
  padding-bottom:4px !important;
}
.cmp-accordion-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:12px;
  border:1px solid rgba(0,60,130,0.20);
  background: rgba(224,242,250,0.55);
  color: rgba(0,60,130,0.95);
  font-weight:800;
  cursor:pointer;
}
.cmp-accordion-btn:hover{ border-color: rgba(0,60,130,0.35); }
.cmp-accordion-hint{ font-size:12px; }

tr.cmp-collapsible.cmp-collapsed td{
  padding-top:0 !important;
  padding-bottom:0 !important;
  border-top:0 !important;
  border-bottom:0 !important;
  height:0 !important;
  line-height:0 !important;
  font-size:0 !important;
}
tr.cmp-collapsible.cmp-collapsed td > *{ display:none !important; }
tr.cmp-collapsible.cmp-collapsed td.sep-left{ border-left:0 !important; }

/* Stronger borders between event groups */
.table tbody tr.event-start td{ border-top:2px solid rgba(16,24,40,0.12); }
.table tbody tr.event-end td{ border-bottom:0; }
.table tbody tr.event-divider td{
  padding:0 !important;
  height:0;
  border-bottom:3px solid rgba(16,24,40,0.14);
  background:transparent !important;
}


/* Toolbar + pager (liste + comparazione) */
.toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.toolbar-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.toolbar-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}

/* Compact toolbars: keep everything on one line (wrap only on small screens) */
.toolbar.toolbar-compact{ flex-wrap:nowrap; }
.toolbar-compact .toolbar-left,
.toolbar-compact .toolbar-right{ flex-wrap:nowrap; }
@media (max-width: 900px){
  .toolbar.toolbar-compact{ flex-wrap:wrap; }
  .toolbar-compact .toolbar-left,
  .toolbar-compact .toolbar-right{ flex-wrap:wrap; }
}

.card-compact{ padding:8px 10px; margin:8px 0; }
.toolbar-compact{ gap:8px; }
.form-inline{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:0; }
.toolbar-compact .pager-inline a,
.toolbar-compact .pager-inline span.active{ padding:5px 9px; border-radius:10px; }

.pager{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.pager-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.pager-right,
.pager-inline{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}

.pager-right a,
.pager-inline a{
  display:inline-block;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.03);
  text-decoration:none;
  color:var(--text);
}
.pager-right a:hover,
.pager-inline a:hover{
  border-color:rgba(255,255,255,.35);
}

.pager-right a.disabled,
.pager-inline a.disabled{
  pointer-events:none;
  opacity:.45;
}

.pager-right span.active,
.pager-inline span.active{
  display:inline-block;
  padding:6px 10px;
  border:1px solid rgba(255,255,255,.35);
  border-radius:10px;
  background:rgba(255,255,255,.08);
  font-weight:700;
}

.ellipsis{padding:0 6px; color: var(--muted);}

/* separatore verticale tra gruppi mercato */
.table th.sep-left,
.table td.sep-left{
  border-left:2px solid var(--line) !important;
}

/* Page head (title + actions) */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 10px;}
.page-head h1{margin:0;}
.page-head .page-sub{margin-top:4px;}
.page-head-actions{margin:0;}

/* --- UI tightening / top spacing --- */
main.container{ padding-top:8px; }
h1{ margin:2px 0 8px; font-size:22px; }
p{ margin:4px 0 8px; }

/* Clickable rows (Surebet/Valuebet) */
.clickable-row{ cursor:pointer; }

/* Modal provider tables */
.providers-box{ margin-top:8px; }
.providers-table{ width:100%; border-collapse:collapse; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.providers-table th, .providers-table td{ padding:8px 10px; border-bottom:1px solid var(--line); font-size:13px; }
.providers-table thead th{ background:#fbfcfe; color:var(--muted); font-weight:700; }
.providers-table tbody tr:last-child td{ border-bottom:none; }

/* Modal: highlight best odd row */
.providers-table-modal tr.best-odd-row td{
  background: rgba(25,159,214,0.10);
}
.providers-table-modal tr.best-odd-row td:nth-child(3) .odd-val{
  background: var(--accent) !important;
  border-color: rgba(0,60,130,0.26) !important;
  color:#fff !important;
}

.sel-block{ margin-bottom:14px; }
.sel-title{ font-weight:800; margin:6px 0; }
header.topbar .container{ padding-top:10px; padding-bottom:10px; min-height:22px; }

/* Badges */
.badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(16,24,40,0.18);
  background: rgba(16,24,40,0.04);
  font-size:12px;
  font-weight:800;
  color: var(--muted);
}
.badge-ok{
  border-color: rgba(22,163,74,0.35);
  background: rgba(22,163,74,0.08);
  color: #166534;
}
.badge-warn{
  border-color: rgba(220,38,38,0.35);
  background: rgba(220,38,38,0.06);
  color: #991b1b;
}

/* Admin mapping (Leagues / Teams) */
.admin-map-layout{
  display:grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap:16px;
  align-items:start;
}
@media (max-width: 1200px){
  .admin-map-layout{ grid-template-columns: 1fr; }
}

.admin-map-stack{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.admin-map-layout .card{
  margin:0;
}

/* Ban leagues list */
.ban-list{
  --ban-cols: 4;
  display:grid;
  grid-template-columns: repeat(var(--ban-cols, 4), minmax(0, 1fr));
  gap:8px;
  padding:10px;
}
@media (max-width: 1400px){
  .ban-list{ --ban-cols: 3; }
}
@media (max-width: 1100px){
  .ban-list{ --ban-cols: 2; }
}
@media (max-width: 800px){
  .ban-list{ --ban-cols: 1; }
}
.ban-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:1px solid rgba(16,24,40,0.10);
  border-radius:12px;
  background: rgba(255,255,255,0.55);
  cursor:pointer;
}
.ban-item input{ cursor:pointer; }
.ban-name{ font-weight:800; color: var(--fg); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Ban leagues: controls */
.ban-controls{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.ban-pager{
  display:flex;
  gap:6px;
  align-items:center;
}
.ban-page-info{
  min-width:140px;
  text-align:center;
}

/* Vertical scroll area for long tables */
.table-scroll-y{
  width:100%;
  overflow:auto;
  max-height: min(520px, calc(100vh - 320px));
  border-radius:14px;
}
.table-scroll-y--tall{
  max-height: min(720px, calc(100vh - 220px));
}
.table-scroll-y thead th{
  position:sticky;
  top:0;
  z-index:2;
}


/* Mapping context (disambiguation) */
.sug-actions{
  display:flex;
  gap:6px;
  flex-wrap:nowrap;
  align-items:center;
}
.sug-actions form{ margin:0; }
.sug-actions .btn{ white-space:nowrap; }

.sug-details-row td{
  background: rgba(16,24,40,0.02);
}

.ctx-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.ctx-grid--manual{ grid-template-columns: 1fr 1fr; }
@media (max-width: 900px){
  .ctx-grid, .ctx-grid--manual{ grid-template-columns: 1fr; }
}

.ctx-panel{
  border:1px solid rgba(16,24,40,0.12);
  background: rgba(16,24,40,0.02);
  border-radius:14px;
  padding:10px;
}
.ctx-h{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  font-weight:900;
  margin-bottom:6px;
}
.ctx-muted{
  color: var(--muted);
  font-weight:900;
  font-size:12px;
}
.ctx-kv{ margin-bottom:8px; }
.ctx-k{ color: var(--muted); font-weight:900; }
.ctx-v{ font-weight:900; }
.ctx-sub{
  margin-top:10px;
  font-size:12px;
  font-weight:900;
  color: var(--muted);
  text-transform:uppercase;
  letter-spacing:0.04em;
}
.ctx-pills{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:6px;
}
.ctx-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid rgba(16,24,40,0.14);
  background: rgba(16,24,40,0.02);
  font-size:12px;
  font-weight:900;
  color: var(--fg);
}
.ctx-pill--pick{
  cursor:pointer;
}
.ctx-pill--pick:hover{
  background: rgba(16,24,40,0.06);
}
.ctx-pill--selected{
  border-color: rgba(37,99,235,0.55);
  background: rgba(37,99,235,0.10);
}
.ctx-pill-muted{
  color: var(--muted);
  font-weight:900;
}
.ctx-list{
  margin:6px 0 0 18px;
  padding:0;
}
.ctx-list li{ margin:3px 0; }
.ctx-when{ color: var(--muted); font-weight:900; }
.ctx-league{ color: var(--muted); font-weight:900; }

/* Inline team mapping (Leagues/Teams context) */
.ctx-teammap{ border-top:1px solid rgba(16,24,40,0.08); padding-top:10px; }
.ctx-teammap-h{ display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; }
.ctx-teammap-form{ margin-top:8px; display:flex; flex-direction:column; gap:8px; }
.ctx-teammap-picked{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.ctx-teammap-pill{
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:999px;
  border:1px dashed rgba(16,24,40,0.25);
  background: rgba(16,24,40,0.02);
  font-weight:900;
  font-size:12px;
  color: var(--fg);
}
.ctx-teammap-arrow{ color: var(--muted); font-weight:900; }
.ctx-teammap-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.ctx-teammap-radio{ display:flex; gap:12px; align-items:center; color: var(--fg); font-weight:900; }
.ctx-teammap-radio label{ margin:0; display:flex; gap:8px; align-items:center; }

/* =====================================================
   NAPOLI THEME (GLOBAL) — applied site-wide
   ===================================================== */
:root{
  --bg:#e0f2fa;
  --bg2:#f7fbff;
  --fg:#0f172a;
  --muted:#334155;
  --card:rgba(255,255,255,0.84);
  --line:rgba(0,60,130,0.16);
  --navy:#003c82;
  --navy2:#002f66;
  --accent:#199fd6;
  --danger:#ef4444;
  --text:#0f172a; /* compatibility */
}

body{
  background:
    radial-gradient(1100px 420px at 12% -10%, rgba(25,159,214,0.22), transparent 60%),
    radial-gradient(900px 340px at 90% 0%, rgba(0,60,130,0.18), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color:var(--fg);
}

/* Topbar */
.topbar{
  background: linear-gradient(180deg, rgba(0,60,130,0.96), rgba(0,47,102,0.96));
  border-bottom:1px solid rgba(255,255,255,0.16);
  box-shadow: 0 10px 26px rgba(0,60,130,0.22);
}

.brand{
  color:#fff;
  font-weight:900;
  letter-spacing:-0.3px;
  font-size:22px;
}
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}
.brand.brand-logo{
  display:inline-flex;
  align-items:center;
  line-height:0;
}
.brand-logo-img{
  display:block;
  height:44px;
  width:auto;
}
.brand .brand-odds{ color:#fff; }
.brand .brand-grid{ color:var(--accent); }

.nav a{
  color:rgba(255,255,255,0.88);
  font-weight:800;
  letter-spacing:0.1px;
}
.nav a:hover{ color:#fff; text-decoration:underline; text-underline-offset:6px; }

/* Buttons */
.btn{
  background: rgba(255,255,255,0.92);
  border:1px solid rgba(0,60,130,0.18);
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(0,60,130,0.10);
}
.btn:hover{
  background:#fff;
  border-color: rgba(0,60,130,0.28);
}
.btn-ghost{ background: transparent; }

.topbar .btn,
.topbar a.btn,
.topbar button.btn{
  background: rgba(255,255,255,0.14);
  border:1px solid rgba(255,255,255,0.22);
  color:#fff;
  box-shadow:none;
}
.topbar .btn:hover,
.topbar a.btn:hover,
.topbar button.btn:hover{
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.30);
}

.btn-top{ border-radius:999px; padding-left:14px; padding-right:14px; }

.user-pill{
  display:inline-flex;
  align-items:center;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  font-weight:800;
  font-size:13px;
}

/* Cards */
.card{
  background: var(--card);
  border-color: rgba(0,60,130,0.14);
  border-radius:18px;
  box-shadow: 0 14px 40px rgba(0,60,130,0.10);
}

/* Tables */
.table{
  border-color: rgba(0,60,130,0.14);
  border-radius:18px;
  box-shadow: 0 14px 40px rgba(0,60,130,0.10);
}

.table thead tr:first-child th{
  background: rgba(0,60,130,0.96);
  color:#fff;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}

.table thead tr:nth-child(2) th{
  background: rgba(255,255,255,0.86);
  color: var(--fg);
  border-bottom: 1px solid rgba(0,60,130,0.12);
}

.sort-link{ color: inherit; text-decoration:none; font-weight:800; }
.sort-link:hover{ text-decoration:underline; text-underline-offset:4px; }

.table th a{ color: inherit; }

.table th.sep-left,
.table td.sep-left{
  border-left:1px solid rgba(0,60,130,0.22) !important;
}

/* Provider pill */
.provider-pill{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(0,60,130,0.18);
  background: rgba(255,255,255,0.72);
  color: var(--navy);
  font-weight:700;
}

/* Odds chips */
.odd-val{
  padding:4px 9px;
  border-radius:10px;
  border:1px solid rgba(0,60,130,0.18);
  background: rgba(255,255,255,0.78);
  font-weight:700;
}
.odd-high{
  background: var(--accent) !important;
  border-color: rgba(0,60,130,0.26) !important;
  color:#fff !important;
}
.odd-low{
  background: rgba(255,255,255,0.78) !important;
  border-color: rgba(0,60,130,0.18) !important;
  color: inherit !important;
}

/* Compare striping */
.table tbody tr.cmp-even td{ background: rgba(255,255,255,0.86) !important; }
.table tbody tr.cmp-odd td{ background: rgba(255,255,255,0.70) !important; }

.table tbody tr:hover td{ background: rgba(25,159,214,0.08) !important; }

/* Betfair row highlight */
.table tbody tr.bf-row td:not([rowspan]){
  background: rgba(224,242,250,0.92) !important;
  border-bottom-color: rgba(0,60,130,0.16);
}

/* Event separators */
.table tbody tr.event-start td{ border-top:2px solid rgba(0,60,130,0.16) !important; }
.table tbody tr.event-divider td{ border-bottom:3px solid rgba(0,60,130,0.18) !important; }

/* Pager */
.pager-right a,
.pager-inline a{
  background: rgba(255,255,255,0.78);
  border-color: rgba(0,60,130,0.14);
  color: var(--navy);
}
.pager-right a:hover,
.pager-inline a:hover{
  border-color: rgba(0,60,130,0.26);
}
.pager-right span.active,
.pager-inline span.active{
  background: rgba(25,159,214,0.16);
  border-color: rgba(0,60,130,0.20);
  color: var(--navy);
}

/* Modal */
.modal-head{ background: rgba(255,255,255,0.92); }
.modal-card{ border-color: rgba(0,60,130,0.14); }


/* Compact page heads for list pages */
.page-head.page-head-compact{
  align-items:center;
  justify-content:space-between;
  gap:10px 14px;
  margin:0 0 8px;
}
.page-head-compact .page-head-actions-inline{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-left:auto;
  justify-content:flex-end;
}
.page-head-compact .page-head-actions-inline .form-inline{ margin:0; }
.page-head-compact .page-head-actions-inline label{ margin:0; }
.page-head-compact .page-sub{ margin-top:2px; }
@media (max-width: 1100px){
  .page-head.page-head-compact{ align-items:flex-start; }
  .page-head-compact .page-head-actions-inline{ margin-left:0; justify-content:flex-start; }
}


/* Auth / user management */
.auth-shell{
  min-height: calc(100vh - 180px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px 12px;
}
.auth-card{
  width:min(860px, 100%);
  background:var(--card);
  border:1px solid rgba(0,60,130,0.14);
  border-radius:22px;
  box-shadow:0 20px 50px rgba(0,60,130,0.12);
  padding:28px;
}
.auth-card-compact{ width:min(460px, 100%); }
.auth-brand{
  font-size:28px;
  font-weight:900;
  margin-bottom:10px;
}
.auth-brand-logo{
  display:flex;
  justify-content:center;
  align-items:center;
}
.auth-brand-logo-img{
  display:block;
  width:min(300px, 100%);
  height:auto;
}
.auth-form{
  display:grid;
  gap:16px;
  margin-top:18px;
}
.auth-form-grid{
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:16px;
}
.auth-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.auth-actions-span{ grid-column:1 / -1; }
.btn-primary{
  background: var(--navy);
  color:#fff;
  border-color: rgba(0,60,130,0.18);
}
.btn-primary:hover{ background:#003a7d; }
.btn-block{ justify-content:center; }
.auth-alert{
  border:1px solid rgba(190,30,45,0.18);
  background:#fff4f4;
  color:#8a1c1c;
  border-radius:14px;
  padding:12px 14px;
  font-weight:700;
}
.auth-alert-ok{
  border-color: rgba(22,120,68,0.18);
  background:#ecfdf3;
  color:#166534;
}
.checkbox-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0;
}
.checkbox-inline input{ width:16px; height:16px; }
.select-like,
select.select-like{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--card);
  color:inherit;
}
.table-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.field-validation-error{
  color:#b42318;
  font-size:12px;
  font-weight:700;
}
@media (max-width: 820px){
  .auth-form-grid{ grid-template-columns:1fr; }
}


/* Neon auth theme */
.auth-shell-neon{
  position:relative;
  min-height:calc(100vh - 180px);
  overflow:hidden;
  padding:40px 14px;
}
.auth-shell-neon::before,
.auth-shell-neon::after{
  content:"";
  position:fixed;
  inset:auto;
  width:42vw;
  height:42vw;
  pointer-events:none;
  filter:blur(56px);
  opacity:.22;
  z-index:0;
}
.auth-shell-neon::before{
  top:110px;
  left:-8vw;
  background:radial-gradient(circle, rgba(0,255,255,.95) 0%, rgba(0,255,255,0) 68%);
}
.auth-shell-neon::after{
  right:-10vw;
  bottom:4vh;
  background:radial-gradient(circle, rgba(255,0,170,.95) 0%, rgba(255,0,170,0) 70%);
}
.auth-card-neon{
  position:relative;
  z-index:1;
  background:linear-gradient(180deg, rgba(8,12,34,.96), rgba(10,18,46,.94));
  color:#e7f7ff;
  border:1px solid rgba(58,232,255,.48);
  box-shadow:0 0 0 1px rgba(255,0,170,.16), 0 0 24px rgba(58,232,255,.24), 0 0 58px rgba(255,0,170,.14), 0 28px 70px rgba(0,0,0,.38);
}
.auth-card-neon::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  padding:1px;
  background:linear-gradient(135deg, rgba(58,232,255,.9), rgba(255,0,170,.65), rgba(58,232,255,.85));
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  pointer-events:none;
  opacity:.9;
}
.auth-card-neon h1,
.auth-card-neon h2,
.auth-card-neon h3,
.auth-card-neon label,
.auth-card-neon .muted,
.auth-card-neon p,
.auth-card-neon a{
  color:#e7f7ff;
}
.auth-card-neon .muted{
  color:#9fb8d3;
}
.auth-card-neon .auth-brand{
  font-size:34px;
  letter-spacing:.2px;
  text-shadow:0 0 12px rgba(58,232,255,.42);
}
.auth-card-neon .brand-odds{ color:#ffffff; }
.auth-card-neon .brand-grid{ color:#39e7ff; text-shadow:0 0 14px rgba(57,231,255,.8); }
.auth-card-neon .field-validation-error{ color:#ff7ccf; }
.auth-card-neon label{
  display:block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:#9feeff;
}
.auth-card-neon input,
.auth-card-neon select,
.auth-card-neon textarea{
  width:100%;
  background:rgba(8,15,40,.84);
  color:#f8fdff;
  border:1px solid rgba(58,232,255,.34);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.02), 0 0 0 rgba(0,0,0,0);
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.auth-card-neon input::placeholder,
.auth-card-neon textarea::placeholder{ color:#7f9bb8; }
.auth-card-neon input:focus,
.auth-card-neon select:focus,
.auth-card-neon textarea:focus{
  outline:none;
  border-color:rgba(255,0,170,.72);
  box-shadow:0 0 0 3px rgba(255,0,170,.14), 0 0 18px rgba(58,232,255,.18);
}
.auth-card-neon .btn{
  min-height:48px;
  border-radius:14px;
  font-weight:900;
  letter-spacing:.02em;
}
.auth-card-neon .btn-primary{
  background:linear-gradient(135deg, #00d8ff, #0066ff);
  color:#061120;
  border-color:rgba(58,232,255,.65);
  box-shadow:0 0 18px rgba(0,216,255,.28);
}
.auth-card-neon .btn-primary:hover{
  background:linear-gradient(135deg, #29e2ff, #2c7dff);
}
.auth-card-neon .btn-ghost{
  background:rgba(255,255,255,.04);
  color:#fff;
  border-color:rgba(255,0,170,.36);
  box-shadow:0 0 18px rgba(255,0,170,.10);
}
.auth-card-neon .btn-ghost:hover{
  background:rgba(255,0,170,.10);
  border-color:rgba(255,0,170,.56);
}
.auth-card-neon .auth-alert{
  border-color:rgba(255,0,170,.36);
  background:rgba(255,0,170,.10);
  color:#ffd6ef;
}
.auth-neon-caption{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  margin-bottom:18px;
  border-radius:999px;
  border:1px solid rgba(58,232,255,.24);
  background:rgba(255,255,255,.03);
  color:#9feeff;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.10em;
}
.auth-neon-caption::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#39e7ff;
  box-shadow:0 0 12px #39e7ff;
}
@media (max-width: 820px){
  .auth-shell-neon{ padding:26px 10px; }
  .auth-card-neon{ padding:20px; }
  .auth-card-neon .auth-brand{ font-size:30px; }
}


/* Glass neon auth refresh */
.auth-shell-login-glass{
  padding:28px 12px;
}
.auth-card-login-glass{
  width:min(520px,100%);
  padding:22px 28px 28px;
  border-radius:28px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.01) 34%),
    linear-gradient(180deg, rgba(18,18,24,.96), rgba(7,10,18,.98));
  border:1px solid rgba(255,255,255,.20);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 0 0 1px rgba(73,237,255,.18),
    0 0 24px rgba(73,237,255,.20),
    0 22px 48px rgba(0,0,0,.48);
  overflow:hidden;
}
.auth-card-admin-glass{ width:min(700px,100%); }
.auth-card-login-glass::before{
  background:linear-gradient(135deg, rgba(255,255,255,.32), rgba(73,237,255,.92), rgba(255,255,255,.08), rgba(73,237,255,.86));
  opacity:.88;
}
.auth-card-login-glass::after{
  content:"";
  position:absolute;
  inset:12px;
  border-radius:22px;
  border:1px solid rgba(73,237,255,.60);
  box-shadow:0 0 18px rgba(73,237,255,.22), inset 0 0 12px rgba(73,237,255,.10);
  pointer-events:none;
}
.auth-card-login-glass .auth-brand-login{
  margin-bottom:8px;
  text-align:left;
  font-size:32px;
  font-weight:900;
}
.auth-login-subtitle{
  margin-bottom:16px;
  color:#dbeeff;
  font-size:16px;
  font-weight:800;
  letter-spacing:.02em;
}
.auth-login-note{
  margin:0 0 10px;
  font-size:13px;
  line-height:1.45;
}
.auth-form-login-compact{
  gap:12px;
  margin-top:4px;
}
.auth-form-admin-glass{
  gap:12px 16px;
  margin-top:6px;
}
.auth-card-login-glass .auth-field-block label{
  margin-bottom:6px;
  font-size:12px;
  letter-spacing:.03em;
}
.auth-card-login-glass input,
.auth-card-login-glass select,
.auth-card-login-glass textarea{
  min-height:42px;
  padding:10px 14px;
  border-radius:12px;
  background:rgba(255,255,255,.96);
  color:#0c1424;
  border:1px solid rgba(255,255,255,.85);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    0 0 0 1px rgba(73,237,255,.10);
}
.auth-card-login-glass input:focus,
.auth-card-login-glass select:focus,
.auth-card-login-glass textarea:focus{
  border-color:rgba(73,237,255,.92);
  box-shadow:0 0 0 3px rgba(73,237,255,.16), 0 0 20px rgba(73,237,255,.26);
}
.auth-inline-row-login{
  align-items:center;
  justify-content:flex-start;
  min-height:20px;
}
.auth-checkbox-neon{
  gap:10px;
  color:#e9f7ff;
  font-size:13px;
  font-weight:700;
}
.auth-checkbox-neon input{
  width:16px !important;
  height:16px !important;
  min-height:16px !important;
  accent-color:#56edff;
  box-shadow:none !important;
  background:transparent !important;
  border:none !important;
  padding:0 !important;
}
.auth-actions-login{
  margin-top:2px;
}
.auth-actions-equal{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
.auth-card-login-glass .auth-actions-equal .btn{
  width:100%;
  min-height:50px;
  justify-content:center;
  border-radius:14px;
}
.auth-card-login-glass .btn-primary{
  background:linear-gradient(180deg, rgba(8,10,12,.98), rgba(0,0,0,.98));
  color:#fff;
  border-color:rgba(73,237,255,.80);
  box-shadow:0 0 0 1px rgba(73,237,255,.24) inset, 0 0 20px rgba(73,237,255,.42);
}
.auth-card-login-glass .btn-primary:hover{
  background:linear-gradient(180deg, rgba(10,14,18,1), rgba(0,0,0,1));
}
.auth-card-login-glass .btn-ghost{
  background:rgba(255,255,255,.04);
  color:#eefbff;
  border-color:rgba(255,255,255,.18);
  box-shadow:0 0 0 1px rgba(255,255,255,.06) inset;
}
.auth-card-login-glass .btn-ghost:hover{
  background:rgba(255,255,255,.09);
  border-color:rgba(73,237,255,.55);
}
.auth-card-login-glass .field-validation-error{
  display:block;
  margin-top:4px;
  color:#ff99d7;
}
@media (max-width: 700px){
  .auth-card-login-glass{ padding:18px 18px 22px; border-radius:22px; }
  .auth-card-login-glass::after{ inset:10px; border-radius:16px; }
  .auth-actions-equal{ grid-template-columns:1fr; }
  .auth-card-admin-glass{ width:min(520px,100%); }
}


/* Auth compact glass/neon refinements */
.auth-shell-login-glass{
  padding:22px 12px;
}
.auth-card-login-glass{
  width:min(430px,100%);
  padding:18px 22px 22px;
  border-radius:24px;
}
.auth-card-admin-glass{
  width:min(620px,100%);
}
.auth-card-login-glass::after{
  inset:10px;
  border-radius:18px;
}
.auth-card-login-glass .auth-brand-login{
  margin-bottom:6px;
  font-size:28px;
}
.auth-login-subtitle{
  margin-bottom:10px;
  font-size:14px;
}
.auth-login-note{
  margin:0 0 8px;
  font-size:12px;
}
.auth-form-login-compact{
  max-width:300px;
  gap:10px;
  margin-top:6px;
}
.auth-form-admin-glass{
  gap:10px 12px;
  margin-top:6px;
}
.auth-card-login-glass .auth-field-block label{
  margin-bottom:5px;
  font-size:11px;
}
.auth-card-login-glass input,
.auth-card-login-glass select,
.auth-card-login-glass textarea{
  min-height:34px;
  padding:8px 12px;
  border-radius:10px;
  font-size:14px;
}
.auth-inline-row-login{
  margin-top:2px;
  min-height:16px;
}
.auth-checkbox-neon{
  gap:8px;
  font-size:12px;
}
.auth-checkbox-neon input{
  width:14px !important;
  height:14px !important;
  min-height:14px !important;
}
.auth-actions-login{
  margin-top:4px;
  max-width:300px;
}
.auth-actions-equal{
  gap:10px;
}
.auth-card-login-glass .auth-actions-equal .btn{
  min-height:40px;
  padding:0 14px;
  font-size:14px;
  border-radius:12px;
}
@media (max-width: 700px){
  .auth-card-login-glass{ width:min(400px,100%); padding:16px 16px 18px; }
  .auth-card-admin-glass{ width:min(520px,100%); }
  .auth-form-login-compact,
  .auth-actions-login{ max-width:none; }
}


/* Auth layout polish 0040 */
.auth-card-login-glass{
  width:min(460px,100%);
}
.auth-card-login-glass .auth-brand-login,
.auth-card-login-glass .auth-login-subtitle,
.auth-card-login-glass .auth-login-note,
.auth-card-login-glass .auth-alert{
  max-width:320px;
  margin-left:auto;
  margin-right:auto;
}
.auth-card-login-glass .auth-brand-login,
.auth-card-login-glass .auth-login-subtitle,
.auth-card-login-glass .auth-login-note,
.auth-card-login-glass .auth-alert{
  text-align:left;
}
.auth-form-login-compact,
.auth-actions-login{
  width:min(320px,100%);
  max-width:320px;
  margin-left:auto;
  margin-right:auto;
}
.auth-form-login-compact .auth-field-block,
.auth-form-admin-glass .auth-field-block{
  width:100%;
}
.auth-form-login-compact input,
.auth-form-admin-glass input{
  width:100%;
}
.auth-form-admin-glass{
  display:grid;
  grid-template-columns:repeat(2, minmax(260px, 260px));
  justify-content:center;
  align-items:start;
  width:max-content;
  max-width:100%;
  margin:8px auto 0;
  gap:12px 18px;
}
.auth-card-admin-glass .auth-login-subtitle,
.auth-card-admin-glass .auth-login-note,
.auth-card-admin-glass .auth-alert{
  max-width:540px;
}
.auth-card-admin-glass .auth-actions-span{
  grid-column:1 / -1;
  width:min(538px,100%);
  max-width:538px;
  margin:2px auto 0;
}
.auth-card-admin-glass .auth-actions-span .btn{
  min-width:260px;
}
.auth-card-admin-glass input,
.auth-card-admin-glass select,
.auth-card-admin-glass textarea{
  min-height:40px;
}
@media (max-width: 700px){
  .auth-card-login-glass{
    width:min(400px,100%);
  }
  .auth-form-login-compact,
  .auth-actions-login,
  .auth-card-login-glass .auth-brand-login,
  .auth-card-login-glass .auth-login-subtitle,
  .auth-card-login-glass .auth-login-note,
  .auth-card-login-glass .auth-alert{
    max-width:none;
    width:100%;
  }
  .auth-form-admin-glass{
    grid-template-columns:1fr;
    width:100%;
    gap:10px;
  }
  .auth-card-admin-glass .auth-actions-span{
    width:100%;
    max-width:none;
  }
  .auth-card-admin-glass .auth-actions-span .btn{
    min-width:0;
  }
}

/* Auth layout fix 0041 */
.auth-card-login-glass,
.auth-card-admin-glass,
.auth-form-login-compact,
.auth-form-admin-glass,
.auth-field-block,
.auth-actions-login,
.auth-actions-span,
.auth-card-login-glass input,
.auth-card-login-glass select,
.auth-card-login-glass textarea,
.auth-card-admin-glass input,
.auth-card-admin-glass select,
.auth-card-admin-glass textarea,
.auth-card-login-glass .btn,
.auth-card-admin-glass .btn{
  box-sizing:border-box;
}

.auth-card-login-glass{
  width:min(520px, calc(100vw - 36px));
  padding:24px 28px 26px;
}
.auth-card-login-glass .auth-brand-login,
.auth-card-login-glass .auth-login-subtitle,
.auth-card-login-glass .auth-login-note,
.auth-card-login-glass .auth-alert,
.auth-form-login-compact,
.auth-actions-login{
  width:min(348px, 100%);
  max-width:348px;
  margin-left:auto;
  margin-right:auto;
}
.auth-form-login-compact{
  gap:12px;
}
.auth-form-login-compact .auth-field-block{
  width:100%;
  min-width:0;
}
.auth-form-login-compact input{
  width:100%;
  min-height:38px;
}
.auth-inline-row-login{
  width:min(348px, 100%);
  max-width:348px;
  margin-left:auto;
  margin-right:auto;
}
.auth-actions-login{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
.auth-card-login-glass .auth-actions-login .btn{
  width:100%;
  min-width:0;
  min-height:42px;
}

.auth-card-admin-glass{
  width:min(760px, calc(100vw - 36px));
  padding:24px 28px 26px;
}
.auth-card-admin-glass .auth-brand-login,
.auth-card-admin-glass .auth-login-subtitle,
.auth-card-admin-glass .auth-login-note,
.auth-card-admin-glass .auth-alert{
  width:min(620px, 100%);
  max-width:620px;
  margin-left:auto;
  margin-right:auto;
}
.auth-form-admin-glass{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  width:min(620px, 100%);
  max-width:620px;
  margin:10px auto 0;
  gap:14px 18px;
}
.auth-form-admin-glass .auth-field-block{
  width:100%;
  min-width:0;
}
.auth-form-admin-glass .auth-field-block label{
  width:100%;
}
.auth-form-admin-glass input,
.auth-form-admin-glass select,
.auth-form-admin-glass textarea{
  width:100%;
  min-width:0;
  min-height:40px;
}
.auth-card-admin-glass .auth-actions-span{
  grid-column:1 / -1;
  width:100%;
  max-width:none;
  margin:2px 0 0;
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
.auth-card-admin-glass .auth-actions-span .btn{
  width:100%;
  min-width:0;
  min-height:42px;
}

@media (max-width: 700px){
  .auth-card-login-glass,
  .auth-card-admin-glass{
    width:min(100%, calc(100vw - 24px));
    padding:18px 18px 20px;
  }
  .auth-card-login-glass .auth-brand-login,
  .auth-card-login-glass .auth-login-subtitle,
  .auth-card-login-glass .auth-login-note,
  .auth-card-login-glass .auth-alert,
  .auth-form-login-compact,
  .auth-inline-row-login,
  .auth-actions-login,
  .auth-card-admin-glass .auth-brand-login,
  .auth-card-admin-glass .auth-login-subtitle,
  .auth-card-admin-glass .auth-login-note,
  .auth-card-admin-glass .auth-alert,
  .auth-form-admin-glass{
    width:100%;
    max-width:none;
  }
  .auth-actions-login,
  .auth-card-admin-glass .auth-actions-span,
  .auth-form-admin-glass{
    grid-template-columns:1fr;
  }
}


/* Auth layout polish 0042 */
.auth-card-login-glass .auth-alert,
.auth-card-login-glass .auth-alert-validation,
.auth-card-login-glass .validation-summary-errors{
  width:min(360px,100%);
  max-width:360px;
  margin-left:auto;
  margin-right:auto;
  box-sizing:border-box;
}
.auth-card-login-glass .auth-alert-validation:empty,
.auth-card-login-glass .validation-summary-valid{
  display:none;
}
.auth-form-login-compact,
.auth-actions-login{
  width:min(360px,100%);
  max-width:360px;
  margin-left:auto;
  margin-right:auto;
}
.auth-form-login-compact .auth-field-block,
.auth-form-login-compact .auth-inline-row-login,
.auth-actions-login .btn{
  width:100%;
}
.auth-form-login-compact .auth-inline-row-login{
  justify-content:flex-start;
}
.auth-card-admin-glass{
  width:min(760px,100%);
}
.auth-form-admin-glass{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  width:min(620px,100%);
  max-width:620px;
  margin:8px auto 0;
  gap:12px 18px;
  justify-content:center;
  box-sizing:border-box;
}
.auth-card-admin-glass .auth-field-block,
.auth-card-admin-glass .auth-field-block input,
.auth-card-admin-glass .auth-field-block select,
.auth-card-admin-glass .auth-field-block textarea{
  width:100%;
  box-sizing:border-box;
}
.auth-card-admin-glass .auth-login-subtitle,
.auth-card-admin-glass .auth-login-note,
.auth-card-admin-glass .auth-alert,
.auth-card-admin-glass .auth-alert-validation,
.auth-card-admin-glass .validation-summary-errors{
  width:min(620px,100%);
  max-width:620px;
  margin-left:auto;
  margin-right:auto;
  box-sizing:border-box;
}
.auth-card-admin-glass .auth-actions-span{
  grid-column:1 / -1;
  width:min(620px,100%);
  max-width:620px;
  margin:2px auto 0;
}
.auth-card-admin-glass .auth-actions-span .btn{
  min-width:0;
  width:100%;
}
@media (max-width: 700px){
  .auth-card-login-glass .auth-alert,
  .auth-card-login-glass .auth-alert-validation,
  .auth-card-login-glass .validation-summary-errors,
  .auth-form-login-compact,
  .auth-actions-login,
  .auth-card-admin-glass .auth-login-subtitle,
  .auth-card-admin-glass .auth-login-note,
  .auth-card-admin-glass .auth-alert,
  .auth-card-admin-glass .auth-alert-validation,
  .auth-card-admin-glass .validation-summary-errors,
  .auth-form-admin-glass,
  .auth-card-admin-glass .auth-actions-span{
    width:100%;
    max-width:none;
  }
  .auth-form-admin-glass{
    grid-template-columns:1fr;
  }
}


/* Auth layout polish 0044 */
.auth-card-login-glass{
  width:min(560px, calc(100% - 24px));
  padding:28px 30px 30px;
}
.auth-card-admin-glass{
  width:min(820px, calc(100% - 24px));
}
.auth-card-login-glass .auth-brand-login,
.auth-card-login-glass .auth-login-subtitle,
.auth-card-login-glass .auth-login-note,
.auth-card-login-glass .auth-alert,
.auth-card-login-glass .auth-alert-validation,
.auth-card-login-glass .validation-summary-errors{
  width:min(380px,100%);
  max-width:380px;
  margin-left:auto;
  margin-right:auto;
  box-sizing:border-box;
}
.auth-form-login-compact,
.auth-actions-login{
  width:min(380px,100%);
  max-width:380px;
  margin-left:auto;
  margin-right:auto;
}
.auth-form-login-compact .auth-field-block,
.auth-form-login-compact .auth-inline-row-login,
.auth-actions-login .btn{
  width:100%;
  box-sizing:border-box;
}
.auth-form-login-compact input{
  width:100%;
}
.auth-form-login-compact .auth-inline-row-login{
  justify-content:flex-start;
}
.auth-form-admin-glass{
  grid-template-columns:minmax(0, 320px) minmax(0, 320px);
  width:min(658px,100%);
  max-width:658px;
  margin:8px auto 0;
  gap:14px 18px;
  justify-content:center;
  box-sizing:border-box;
}
.auth-card-admin-glass .auth-login-subtitle,
.auth-card-admin-glass .auth-login-note,
.auth-card-admin-glass .auth-alert,
.auth-card-admin-glass .auth-alert-validation,
.auth-card-admin-glass .validation-summary-errors,
.auth-card-admin-glass .auth-actions-span{
  width:min(658px,100%);
  max-width:658px;
  margin-left:auto;
  margin-right:auto;
  box-sizing:border-box;
}
.auth-card-admin-glass .auth-field-block,
.auth-card-admin-glass .auth-field-block input,
.auth-card-admin-glass .auth-field-block select,
.auth-card-admin-glass .auth-field-block textarea{
  width:100%;
  box-sizing:border-box;
}
.auth-card-admin-glass .auth-actions-span{
  grid-column:1 / -1;
  margin-top:4px;
}
.auth-card-admin-glass .auth-actions-span .btn{
  width:100%;
  min-width:0;
}
.auth-alert-list{
  margin:0;
  padding-left:18px;
}
.auth-alert-list li + li{
  margin-top:4px;
}
@media (max-width: 760px){
  .auth-card-login-glass,
  .auth-card-admin-glass{
    width:min(100%, calc(100% - 20px));
    padding:20px 18px 22px;
  }
  .auth-card-login-glass .auth-brand-login,
  .auth-card-login-glass .auth-login-subtitle,
  .auth-card-login-glass .auth-login-note,
  .auth-card-login-glass .auth-alert,
  .auth-card-login-glass .auth-alert-validation,
  .auth-card-login-glass .validation-summary-errors,
  .auth-form-login-compact,
  .auth-actions-login,
  .auth-card-admin-glass .auth-login-subtitle,
  .auth-card-admin-glass .auth-login-note,
  .auth-card-admin-glass .auth-alert,
  .auth-card-admin-glass .auth-alert-validation,
  .auth-card-admin-glass .validation-summary-errors,
  .auth-card-admin-glass .auth-actions-span,
  .auth-form-admin-glass{
    width:100%;
    max-width:none;
  }
  .auth-form-admin-glass{
    grid-template-columns:1fr;
    gap:12px;
  }
}

/* Admin users page */
.admin-users-layout{
  display:grid;
  grid-template-columns:minmax(0, 1.65fr) minmax(260px, .55fr);
  gap:16px;
  align-items:stretch;
}

.admin-users-card{
  padding:18px 18px 20px;
}

.admin-users-alert,
.admin-users-validation{
  max-width:860px;
}

.admin-users-validation{
  margin:0 0 8px;
}

.admin-users-validation:empty{
  display:none;
}

.admin-user-form{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px 22px;
  align-items:start;
}

.admin-user-field{
  min-width:0;
}

.admin-user-field label{
  margin-bottom:8px;
  font-size:14px;
  font-weight:800;
  color:var(--fg);
}

.admin-user-field input,
.admin-user-field select,
.admin-user-select{
  width:100%;
  min-width:0;
  height:48px;
  padding:0 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#f8fafc;
  color:var(--fg);
  outline:none;
  box-sizing:border-box;
  font-size:15px;
  font-weight:600;
}

.admin-user-field input:focus,
.admin-user-field select:focus,
.admin-user-select:focus{
  border-color:rgba(37,99,235,.45);
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
  background:#fff;
}

.admin-user-actions{
  grid-column:1 / -1;
  display:flex;
  justify-content:flex-start;
  align-items:center;
  padding-top:2px;
}

.admin-user-actions .btn{
  min-width:160px;
  height:46px;
  border-radius:14px;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.admin-users-side-card{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}

.admin-users-side-card h3,
.admin-users-create-card h3{
  margin:0 0 18px;
}

.admin-users-perms{
  margin:0;
  padding-left:20px;
  line-height:1.6;
}

.admin-users-perms li + li{
  margin-top:8px;
}

@media (max-width: 1100px){
  .admin-users-layout{
    grid-template-columns:1fr;
  }
}

@media (max-width: 760px){
  .admin-user-form{
    grid-template-columns:1fr;
    gap:14px;
  }

  .admin-user-actions{
    justify-content:stretch;
  }

  .admin-user-actions .btn{
    width:100%;
  }
}

.topbar-right .btn-top,
.topbar-right .user-pill{
  height:38px;
  min-height:38px;
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
}
.topbar-right .btn-top{ padding:0 16px !important; }
.topbar-right .user-pill{ padding:0 16px; min-width:76px; }


.topbar-right{ gap:10px; }
.topbar-right .btn-top,
.topbar-right .user-pill{
  min-height:38px;
  height:38px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
}
.topbar-right .btn-top{ min-width:86px; }

/* =====================================================
   STICKY MAIN NAV + DROPDOWN
   ===================================================== */
.topbar{
  position:sticky;
  top:0;
  z-index:1400;
  backdrop-filter:saturate(140%) blur(10px);
}

.topbar .container{
  min-height:22px;
}

.nav.nav-main{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.nav.nav-main .nav-link,
.nav.nav-main .nav-dropbtn{
  display:inline-flex;
  border:0;
  background:transparent;
  align-items:center;
  min-height:40px;
  padding:0 14px;
  border-radius:999px;
  font-weight:800;
  color:rgba(255,255,255,.92);
  text-decoration:none;
  cursor:pointer;
  transition:background .16s ease, color .16s ease, box-shadow .16s ease;
}

.nav.nav-main .nav-link:hover,
.nav.nav-main .nav-dropbtn:hover,
.nav.nav-main .nav-dropdown:hover > .nav-dropbtn,
.nav.nav-main .nav-dropdown:focus-within > .nav-dropbtn{
  color:#fff;
  background:rgba(255,255,255,.14);
  text-decoration:none;
}

.nav-dropdown{
  position:relative;
}

.nav-dropdown-menu{
  position:absolute;
  left:0;
  top:calc(100% + 8px);
  min-width:210px;
  padding:8px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(8,22,54,.96);
  box-shadow:0 18px 34px rgba(0,0,0,.24);
  display:none;
}

.nav-dropdown-menu-wide{
  min-width:240px;
  max-width:300px;
}

.nav-dropdown-menu a{
  display:flex;
  align-items:center;
  min-height:38px;
  margin:2px 0;
  padding:0 12px;
  border-radius:12px;
  color:rgba(255,255,255,.9);
  text-decoration:none;
  font-weight:800;
}

.nav-dropdown-menu a:hover{
  color:#fff;
  background:rgba(255,255,255,.10);
  text-decoration:none;
}

.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu{
  display:block;
}

@media (max-width: 980px){
  .topbar .container{
    align-items:flex-start;
  }

  .nav.nav-main{
    gap:6px;
  }

  .nav.nav-main .nav-link,
  .nav.nav-main .nav-dropbtn{
    min-height:36px;
    padding:0 12px;
    font-size:13px;
  }
}

@media (max-width: 700px){
  .brand-logo-img{ height:38px; }
  .auth-brand-logo-img{ width:min(250px, 100%); }
}
