/* ── Lay Back Scanner – Design System ─────────────────────── */

:root {
  --gold:        #DF9625;
  --gold-hover:  #c8831a;
  --gold-glow:   rgba(223, 150, 37, 0.18);
  --gold-dim:    rgba(223, 150, 37, 0.08);
  --bg:          #0e0e0e;
  --surface:     #161616;
  --surface-2:   #1e1e1e;
  --surface-3:   #252525;
  --border:      #2a2a2a;
  --border-soft: #222222;
  --text:        #e2e2e2;
  --text-muted:  #777777;
  --text-soft:   #aaaaaa;
  --success:     #4caf6e;
  --warning:     #e0a030;
  --danger:      #e05252;
  --info:        #5b9bd5;
  --sidebar-w:   240px;
}

* { box-sizing: border-box; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  margin: 0;
}

/* ── App shell ───────────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 300;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-brand img {
  height: 30px;
  width: auto;
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  line-height: 1.25;
}

.sidebar-brand .brand-name span {
  color: var(--gold);
}

.sidebar-section {
  padding: 1rem 0.75rem 0.25rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}

.sidebar-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background-color: var(--surface-3);
  color: var(--text);
}

.sidebar-link.active {
  background-color: var(--gold-dim);
  color: var(--gold);
  font-weight: 600;
}

.sidebar-link.active i {
  color: var(--gold);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0.75rem;
}

.sidebar-badge {
  margin-left: auto;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .1rem .4rem;
  border-radius: 999px;
  background: rgba(223,150,37,.15);
  color: var(--gold);
  border: 1px solid rgba(223,150,37,.3);
}

.sidebar-footer {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--surface-2);
  margin-bottom: 0.4rem;
}

.sidebar-user i {
  color: var(--gold);
  font-size: 1.1rem;
}

.sidebar-user .user-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--danger);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.sidebar-logout:hover {
  background-color: rgba(224, 82, 82, 0.1);
  color: var(--danger);
}

/* ── Main wrapper ────────────────────────────────────────── */

.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top header ──────────────────────────────────────────── */

.top-header {
  height: 56px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-toggle {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 1.2rem;
  padding: 0.25rem;
  cursor: pointer;
  display: none;
}

.header-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.header-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.header-pill i { color: var(--gold); }

/* ── Page content ────────────────────────────────────────── */

.page-content {
  flex: 1;
  padding: 1.75rem 1.5rem;
}

/* ── Stat cards ──────────────────────────────────────────── */

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  border-color: rgba(223,150,37,0.3);
  box-shadow: 0 0 0 1px rgba(223,150,37,0.06);
}

.stat-card .stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.stat-card .stat-body {}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Generic panel card ──────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title i { color: var(--gold); }

.panel-body { padding: 1.25rem; }

/* ── Table ───────────────────────────────────────────────── */

.opp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.opp-table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.opp-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.1s;
}

.opp-table tbody tr:last-child { border-bottom: none; }

.opp-table tbody tr:hover { background: var(--surface-2); }

.opp-table td {
  padding: 0.7rem 1rem;
  color: var(--text);
  vertical-align: middle;
}

.opp-table td.time { color: var(--text-muted); white-space: nowrap; }
.opp-table td.game { font-weight: 600; }
.opp-table td.odd  { font-variant-numeric: tabular-nums; font-weight: 600; }

.odd-back { color: var(--info); }
.odd-lay  { color: #e07b5b; }

/* ── Status badges ───────────────────────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25em 0.65em;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.status-good     { background: rgba(76,175,110,0.15); color: var(--success); border: 1px solid rgba(76,175,110,0.3); }
.status-moderate { background: rgba(223,150,37,0.15); color: var(--gold);    border: 1px solid rgba(223,150,37,0.3); }
.status-wait     { background: rgba(119,119,119,0.12); color: var(--text-muted); border: 1px solid rgba(119,119,119,0.25); }

/* ── Market badge ────────────────────────────────────────── */

.market-badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-soft);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ── Login page ──────────────────────────────────────────── */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #1c1608 0%, #0e0e0e 70%);
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 0 1px rgba(223,150,37,0.07);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo img {
  height: 60px;
  width: auto;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 2px 10px rgba(223,150,37,0.3));
}

.login-logo h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.2rem;
}

.login-logo h1 span { color: var(--gold); }

.login-logo p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

/* ── Form controls ───────────────────────────────────────── */

.form-control {
  background-color: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  border-radius: 6px;
}

.form-control:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(223,150,37,0.2) !important;
  outline: none;
}

.form-control::placeholder { color: var(--text-muted) !important; }

.input-group-text {
  background-color: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
}

.form-label {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn-gold {
  background-color: var(--gold);
  border-color: var(--gold);
  color: #111;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-gold:hover, .btn-gold:focus {
  background-color: var(--gold-hover);
  border-color: var(--gold-hover);
  color: #111;
}

/* ── Alert ───────────────────────────────────────────────── */

.alert-danger {
  background: rgba(224,82,82,0.1) !important;
  border-color: rgba(224,82,82,0.3) !important;
  color: #e07070 !important;
}

/* ── Page header ─────────────────────────────────────────── */

.page-heading {
  margin-bottom: 1.5rem;
}

.page-heading h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.15rem;
}

.page-heading p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

/* ── Footer ──────────────────────────────────────────────── */

.app-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}

/* ── Scrollbar ───────────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .header-toggle {
    display: block;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 290;
  }
  .sidebar-overlay.open { display: block; }
}
