/* Deliberately mirrors the Soccabet back office chrome so the tool reads as
   familiar to someone who already uses the platform. Light theme only — the
   real back office has no dark mode and matching it is the point. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #dce6f2;
  color: #222;
  font: 13px/1.45 "Segoe UI", Tahoma, Verdana, sans-serif;
}

/* ---------------------------------------------------------------- chrome */
.topbar {
  background: #404040;
  color: #fff;
  padding: 5px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .sep { opacity: .5; }
.topbar strong { margin-left: auto; font-weight: 600; }
.clock { color: #9fc3e8; }
#userbox { display: flex; align-items: center; gap: 8px; }
.who { color: #9fc3e8; }
.logout {
  background: #6f8fb5; color: #fff; text-decoration: none;
  padding: 2px 9px; border-radius: 2px; font-size: 11.5px;
}
.logout:hover { background: #5b7b9f; }

.mainnav {
  display: flex;
  background: #4a86c8;
  border-bottom: 3px solid #17457e;
  flex-wrap: wrap;
}
.mainnav a {
  flex: 1 1 auto;
  text-align: center;
  padding: 9px 6px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  border-right: 1px solid #6ea3d9;
  white-space: nowrap;
}
.mainnav a:hover { background: #3d76b4; }
.mainnav a.active { background: #17457e; font-weight: 600; }
.mainnav a.locked { opacity: .82; }

main { padding: 14px 16px 40px; }

/* second-level tabs, as the back office shows under a section */
.subnav {
  display: flex;
  gap: 2px;
  margin: -4px 0 12px;
  border-bottom: 1px solid #9bb4d0;
}
.subnav a {
  padding: 5px 15px;
  font-size: 12.5px;
  color: #17457e;
  text-decoration: none;
  background: #c7d8ec;
  border: 1px solid #9bb4d0;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
}
.subnav a:hover { background: #d8e5f4; }
.subnav a.active { background: #fff; font-weight: 700; position: relative; top: 1px; }

h1 {
  color: #17457e;
  font-size: 15px;
  margin: 2px 0 12px;
  font-weight: 700;
}

/* --------------------------------------------------------------- filters */
.filters {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filters select,
.filters input[type=date] {
  font: inherit;
  padding: 3px 5px;
  border: 1px solid #9bb4d0;
  background: #fff;
  border-radius: 2px;
}
.filters button {
  font: inherit;
  padding: 3px 13px;
  border: 1px solid #2f5f9c;
  background: #4a86c8;
  color: #fff;
  border-radius: 2px;
  cursor: pointer;
}
.filters button:hover { background: #3d76b4; }
.filters .to { color: #555; }
.filters .cur {
  margin-left: auto;
  background: #17457e;
  color: #fff;
  padding: 2px 9px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* ---------------------------------------------------------------- tables */
.tablewrap {
  overflow-x: auto;          /* wide reports scroll here, never the page body */
  border: 1px solid #9bb4d0;
  background: #fff;
}
table { border-collapse: collapse; width: 100%; font-size: 12px; }

thead th {
  background: #4a86c8;
  color: #fff;
  font-weight: 600;
  text-align: right;
  padding: 6px 9px;
  white-space: nowrap;
  border-right: 1px solid #6ea3d9;
  position: sticky;
  top: 0;
}
thead th:first-child { text-align: left; }

tbody td {
  padding: 4px 9px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid #e4ecf5;
  font-variant-numeric: tabular-nums;
}
tbody td:first-child { text-align: left; color: #17457e; font-weight: 600; }
tbody tr:nth-child(even) { background: #eef4fb; }
tbody tr:hover { background: #fdf6dc; }

tfoot td {
  padding: 6px 9px;
  text-align: right;
  font-weight: 700;
  background: #d4e2f2;
  border-top: 2px solid #17457e;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
tfoot td:first-child { text-align: left; }

.neg { color: #c0392b; }
.pos { color: #1d7a3e; }
.na  { color: #aaa; }

/* --------------------------------------------------------------- exports */
.exports { margin-top: 12px; display: flex; gap: 9px; }
.exports button {
  font: inherit;
  padding: 7px 20px;
  border: 1px solid #6f6f6f;
  background: #7d7d7d;
  color: #fff;
  border-radius: 2px;
  cursor: pointer;
}
.exports button:hover { background: #6a6a6a; }

.footnote { margin-top: 8px; font-size: 11.5px; color: #5a6a7d; }

/* ------------------------------------------------------------ misc views */
.denied {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid #9bb4d0;
  padding: 22px;
  max-width: 620px;
}
.denied-icon { color: #c0392b; font-size: 34px; line-height: 1; }
.denied p { margin: 0 0 6px; }
.muted { color: #667; font-size: 12px; }

#status-body { background: #fff; border: 1px solid #9bb4d0; padding: 16px; }
#status-body h2 { font-size: 13px; color: #17457e; margin: 16px 0 7px; }
#status-body h2:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 3px 12px; font-size: 12px; }
.kv div:nth-child(odd) { color: #556; }
.warn {
  background: #fff6e0;
  border-left: 4px solid #d79b00;
  padding: 9px 12px;
  margin-top: 10px;
  font-size: 12px;
}

/* ------------------------------------------------------- dashboard & charts */
.pagehead {
  display: flex; align-items: baseline; gap: 18px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.pagehead h1 { margin: 0; }
.filters.compact { margin-bottom: 0; }

.kpis {
  display: grid; gap: 10px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}
.kpi {
  background: #fff; border: 1px solid #9bb4d0; border-top: 3px solid #17457e;
  padding: 11px 14px;
}
.kpi-l {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: #5a6a7d; margin-bottom: 5px;
}
.kpi-v {
  font-size: 19px; font-weight: 700; color: #17457e;
  font-variant-numeric: tabular-nums;
}
.kpi-v.pos { color: #1d7a3e; }
.kpi-v.neg { color: #c0392b; }

.cards {
  display: grid; gap: 12px; margin-bottom: 12px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.card { background: #fff; border: 1px solid #9bb4d0; padding: 12px 14px 14px; min-width: 0; }
.card.wide { grid-column: span 2; }
@media (max-width: 900px) { .card.wide { grid-column: span 1; } }
.card h2 {
  margin: 0 0 10px; font-size: 12.5px; color: #17457e;
  font-weight: 700; letter-spacing: .01em;
}
.chart { min-height: 40px; }
.chart svg { display: block; overflow: visible; }
.nodata { color: #8894a4; font-size: 12px; margin: 18px 0; text-align: center; }

.chartlegend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 8px; font-size: 11.5px; color: #5a6a7d;
}
.chartlegend i, .donutkey i, .charttip i {
  display: inline-block; width: 9px; height: 9px;
  border-radius: 2px; margin-right: 6px; vertical-align: middle;
}

.donutwrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.donutkey { flex: 1 1 150px; font-size: 11.5px; min-width: 0; }
.donutkey > div {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 2px 6px; align-items: baseline; padding: 3px 0;
  border-bottom: 1px solid #eef4fb;
}
.donutkey .k { color: #22303f; font-weight: 600; }
.donutkey .v { color: #5a6a7d; font-variant-numeric: tabular-nums; }
.donutkey .p { grid-column: 2 / 4; color: #8894a4; }

.charttip {
  position: fixed; z-index: 50; pointer-events: none;
  background: #22303f; color: #fff; padding: 7px 10px;
  border-radius: 3px; font-size: 11.5px; line-height: 1.5;
  box-shadow: 0 3px 12px rgba(0,0,0,.25); max-width: 260px;
}
.charttip b { display: block; margin-bottom: 3px; color: #cfe0f2; }
.charttip div { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.charttip span { margin-left: auto; font-variant-numeric: tabular-nums; }

@media print {
  .topbar, .mainnav, .subnav, .filters, .exports { display: none; }
  .card { break-inside: avoid; border-color: #ccc; }
  .tablewrap { border: none; overflow: visible; }
  body { background: #fff; }
}
