:root {
  --bg-1: #082032;
  --bg-2: #2c394b;
  --bg-3: #ff4c29;
  --card: #f7f8fb;
  --ink: #112031;
}

body {
  font-family: 'Barlow', sans-serif;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 8% 20%, rgba(255, 76, 41, 0.26), transparent 35%),
              radial-gradient(circle at 90% 15%, rgba(255, 196, 0, 0.16), transparent 30%),
              linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 16px, transparent 16px 32px);
  opacity: 0.25;
}

.app-nav {
  backdrop-filter: blur(8px);
  background: rgba(7, 20, 31, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.8px;
}

.brand-art {
  width: 132px;
  max-width: 38vw;
  height: auto;
  display: block;
}

.robot-icon {
  font-size: 1.05rem;
  margin-right: 4px;
}

.panel {
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  padding: 1.25rem;
}

.panel h2,
.panel h3,
.panel h4 {
  font-family: 'Oswald', sans-serif;
}

.first-access-panel {
  border: 2px solid rgba(17, 32, 49, 0.22);
  position: relative;
  overflow: hidden;
}

.first-access-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #112031, #2c394b);
}

.first-access-top {
  background: #e9edf3;
  border: 1px solid #c8d0db;
  border-radius: 12px;
  padding: 14px;
}

.first-access-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #112031;
  color: #fff;
  margin-bottom: 8px;
}

.first-access-note {
  border-left: 4px solid #112031;
  background: #f1f4f8;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.access-ok-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #112031;
  color: #fff;
  margin-right: 8px;
  vertical-align: middle;
}

.chip-ok-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.first-access-btn {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.summary-card {
  padding: 1rem 1.1rem;
  border: 1px solid #d9e0ea;
}

.summary-label {
  font-size: 0.85rem;
  color: #51647d;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.summary-value {
  margin-top: 2px;
  font-family: 'Oswald', sans-serif;
  font-size: 1.45rem;
  color: #112031;
}

.summary-total {
  border-color: #c9d3e0;
}

.dashboard-tabs {
  border-bottom: 1px solid #ccd6e3;
}

.dashboard-tabs .nav-link {
  color: #334a65;
  font-weight: 600;
}

.dashboard-tabs .nav-link.active {
  color: #112031;
  background: #eef3f9;
  border-color: #ccd6e3 #ccd6e3 #eef3f9;
}

.save-state {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.save-state-ok {
  background: #dff1e5;
  color: #1c5b30;
}

.save-state-warn {
  background: #f6ead7;
  color: #7a4b10;
}

.detail-wrap {
  overflow: auto;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  max-height: 70vh;
}

.detail-table {
  width: max-content;
  min-width: 100%;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.detail-table th,
.detail-table td {
  white-space: nowrap;
  border: 1px solid #d7dee8;
  font-size: 0.79rem;
  vertical-align: middle;
}

.detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.detail-table .sticky-col {
  position: sticky;
  z-index: 3;
  box-shadow: 1px 0 0 #d7dee8;
}

.detail-table thead .col-np,
.detail-table thead .col-alias,
.detail-table thead .col-total {
  color: #ffffff;
  background: #2a3f5a;
  font-weight: 700;
}

.detail-table .col-np {
  left: 0;
  min-width: 56px;
  max-width: 56px;
}

.detail-table tbody .col-np {
  background: #eef3f9;
}

.detail-table .col-alias {
  left: 56px;
  min-width: 190px;
  max-width: 190px;
}

.detail-table tbody .col-alias {
  background: #eef3f9;
  font-weight: 700;
}

.detail-table .col-total {
  left: 246px;
  min-width: 95px;
  max-width: 95px;
}

.detail-table tbody .col-total {
  background: #eef3f9;
  text-align: center;
}

.detail-table .sec-match {
  background: #112031;
  color: #ffffff;
}

.detail-table .sec-final {
  background: #5f4730;
  color: #ffffff;
}

.detail-table .sec-top {
  background: #7a1a3a;
  color: #ffffff;
}

.detail-table td.sec-match-cell {
  box-shadow: inset 0 0 0 9999px rgba(17, 32, 49, 0.02);
}

.detail-table td.sec-final-cell {
  box-shadow: inset 0 0 0 9999px rgba(95, 71, 48, 0.05);
}

.detail-table td.sec-top-cell {
  box-shadow: inset 0 0 0 9999px rgba(122, 26, 58, 0.05);
}

.detail-table .detail-cell {
  min-width: 72px;
}

.detail-table .cell-hit {
  background: #dff1e5;
  color: #0f5132;
  font-weight: 700;
}

.detail-table .cell-miss {
  background: #f8d7da;
  color: #842029;
}

.detail-table .cell-open,
.detail-table .cell-empty {
  background: #eef1f5;
  color: #526173;
}

.detail-table .cell-mark {
  margin-left: 4px;
  font-weight: 700;
}

.detail-table .section-edge-left {
  border-left: 2px solid #7f8fa3 !important;
}

.detail-table .section-edge-right {
  border-right: 2px solid #7f8fa3 !important;
}

.table thead th {
  background: #112031;
  color: #fff;
  border: 0;
}

.match-table tbody tr:nth-child(odd) > td {
  background: #ffffff;
}

.match-table tbody tr:nth-child(even) > td {
  background: #faf8f3;
}

.match-table tbody tr:hover > td {
  background: #ebe4d8;
}

.match-table td,
.match-table th {
  border-color: #ddd5c8;
}

.match-table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid #ddd5c8;
  border-radius: 10px;
}

.match-table-wrap .match-table {
  margin-bottom: 0;
}

.match-table-wrap .match-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.match-cell {
  font-weight: 700;
  color: #0f1f33;
  letter-spacing: 0.1px;
}

.match-cell .home-team,
.match-cell .away-team {
  display: inline-block;
}

.match-cell .vs-sep {
  display: inline-block;
  margin: 0 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e9dbc5;
  color: #5f4730;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: middle;
}

.badge-soft {
  background: rgba(255, 76, 41, 0.16);
  color: #8f2207;
}

.slide-up {
  animation: slideUp .35s ease-out;
}

.robot-box {
  background-color: rgba(248, 249, 250, 0.7);
  border: 1px solid #d6d9df;
  border-radius: 10px;
  padding: 12px 14px;
}

.flipswitch {
  position: relative;
  width: 73px;
  user-select: none;
  display: inline-block;
}

.flipswitch input[type=checkbox] {
  display: none;
}

.flipswitch-label {
  display: block;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #999;
  border-radius: 9px;
  margin: 0;
}

.flipswitch-inner {
  width: 200%;
  margin-left: -100%;
  transition: margin 0.3s ease-in 0s;
}

.flipswitch-inner:before,
.flipswitch-inner:after {
  float: left;
  width: 50%;
  height: 25px;
  line-height: 25px;
  font-size: 14px;
  color: #fff;
  font-family: Arial, sans-serif;
  font-weight: bold;
  box-sizing: border-box;
}

.flipswitch-inner:before {
  content: "SI";
  padding-left: 10px;
  background-color: #666;
  text-align: left;
}

.flipswitch-inner:after {
  content: "NO";
  padding-right: 10px;
  background-color: #7a1a3a;
  text-align: right;
}

.flipswitch-switch {
  width: 27px;
  margin: -2px;
  background: #fff;
  border: 2px solid #999;
  border-radius: 9px;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 52px;
  transition: all 0.3s ease-in 0s;
}

.flipswitch-cb:checked + .flipswitch-label .flipswitch-inner {
  margin-left: 0;
}

.flipswitch-cb:checked + .flipswitch-label .flipswitch-switch {
  right: 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .brand-art {
    width: 104px;
  }

  .navbar-brand span {
    font-size: 0.92rem;
  }
}
