@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0d0f14;
  --bg-card: #161921;
  --bg-elevated: #1e2230;
  --border: #2a2f3d;
  --border-subtle: #1e2230;
  --accent: #4f8ef7;
  --accent-hover: #3a78e8;
  --accent-glow: rgba(79, 142, 247, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --text: #f0f2f8;
  --text-muted: #7c859e;
  --text-dim: #4a5268;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 14px;
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ===== SIDEBAR ===== */
.sidebar-brand {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.brand-logo span {
  color: var(--accent);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 8px 20px 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-right: 2px solid var(--accent);
}

.nav-link .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

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

.avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), #72aaff);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; /* Squircle style */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(79, 142, 247, 0.2);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.user-role {
  font-size: 11px;
  color: var(--text-dim);
}

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.page-sub {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-top: 4px;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  font-weight: 600;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-top: 6px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== TABLES ===== */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

tbody tr:hover {
  background: var(--bg-elevated);
}

tbody td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-blue { background: rgba(79,142,247,0.12); color: var(--accent); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-yellow { background: var(--warning-bg); color: var(--warning); }
.badge-gray { background: var(--bg-elevated); color: var(--text-muted); }

/* ===== RISK BARS ===== */
.risk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.risk-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.risk-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s;
}

.risk-high .risk-fill { background: var(--danger); }
.risk-medium .risk-fill { background: var(--warning); }
.risk-low .risk-fill { background: var(--success); }

.risk-pct {
  font-size: 13px;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  user-select: none;
  padding: 4px;
  transition: color 0.15s;
}

.password-toggle:hover {
  color: var(--text);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79, 142, 247, 0.35);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-full { width: 100%; justify-content: center; }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.3);
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 480px;
  max-width: 90vw;
  transform: translateY(16px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

/* ===== FILTERS BAR ===== */
.filters-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filters-bar select,
.filters-bar input {
  width: auto;
  min-width: 140px;
}

/* ===== TOGGLE/SWITCH ===== */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.toggle-label {
  font-size: 13.5px;
  color: var(--text);
}

.toggle-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input { display: none; }

.slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s;
}

.slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  transition: transform 0.2s;
}

.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(79,142,247,0.08), transparent 70%), var(--bg);
}

.login-box {
  width: 400px;
  max-width: 90vw;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
}

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

.login-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
}

.page-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  transition: all 0.15s;
}

.page-btn:hover, .page-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ===== PASSWORD STRENGTH ===== */
.strength-bar {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.strength-seg {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.2s;
}

.strength-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== HTMX GLOBAL INDICATOR ===== */
.htmx-indicator-global {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
}
.htmx-indicator-global.htmx-request {
    display: block !important;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: htmx-spin 0.8s linear infinite;
}
@keyframes htmx-spin {
    to { transform: rotate(360deg); }
}
/* ===== TOP NAV ===== */
.top-nav {
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(10px);
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    flex-shrink: 0;
}

.live-dot.pulse {
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: var(--accent);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), #72aaff);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: white;
    box-shadow: 0 2px 8px rgba(79, 142, 247, 0.15);
}

/* Performance Dashboard */
.perf-tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.perf-tab { 
    background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 6px 16px; 
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.perf-tab:hover { border-color: var(--primary); color: var(--text); }
.perf-tab.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 0 15px rgba(220, 38, 38, 0.3); }

.type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.type-card { 
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px;
    cursor: pointer; transition: transform 0.2s, border-color 0.2s;
}
.type-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.type-card-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.type-card-value { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.type-card-sub { font-size: 13px; color: var(--text-muted); }
.type-card-pending { font-size: 11px; color: var(--primary); margin-top: 8px; font-weight: 600; }

.perf-overall-bar { 
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); 
    padding: 12px 20px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between;
}

.wr-badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.wr-badge.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.wr-badge.amber { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.wr-badge.grey { background: rgba(107, 114, 128, 0.1); color: #9ca3af; }

.top-singles-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.top-singles-table th { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.top-singles-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.03); }

/* Prediction Indicators */
.match-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 4px 0;
}

.team-box {
    flex: 1;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text); /* Bright text */
}

.team-home { text-align: right; }
.team-away { text-align: left; }

.prediction-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 100px;
}

.prediction-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
}

.arrow-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    width: 60px;
}

.arrow-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.draw-indicator {
    background: var(--bg-elevated);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 800;
    font-size: 11px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    box-shadow: 0 0 8px var(--accent-glow);
}

.arrow-left-icon, .arrow-right-icon {
    font-size: 16px;
    color: var(--accent);
    font-weight: 900;
}

.risk-summary {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

/* Single line filters */
.prediction-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.prediction-filters select, 
.prediction-filters input {
    height: 32px;
    padding: 4px 10px;
    font-size: 12px;
    width: auto;
    min-width: 120px;
}

.date-presets-mini {
    display: flex;
    gap: 4px;
}

.date-presets-mini button {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.date-presets-mini button:hover {
    background: var(--border);
    color: var(--text);
}

/* ===== TOOLTIPS (app-wide) ===== */
/* Tooltips — rendered via JS into #az-tooltip (position:fixed) so they
   are never clipped by overflow:auto card containers. */
[data-tip] { cursor: help; }

#az-tooltip {
    position: fixed;
    z-index: 99999;
    background: #1e2230;
    color: #f0f2f8;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    padding: 5px 9px;
    border-radius: 5px;
    border: 1px solid #2a2f3d;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    max-width: 240px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: normal;
}

/* ===== DASHBOARD SPECIFIC STYLES ===== */

.dash-search-wrap {
  position: relative;
  margin-bottom: 16px;
}

#dash-search {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

#dash-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#dash-search::placeholder {
  color: var(--text-dim);
}

.dash-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.dash-search-results.hidden {
  display: none;
}

.search-team {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

.search-team:hover {
  background: rgba(255,255,255,0.02);
}

.search-team:last-child {
  border-bottom: none;
}

.search-team-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text);
}

.search-fixture {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-empty {
  padding: 24px;
  color: var(--text-dim);
  text-align: center;
  font-size: 14px;
}

/* Navigator */
.dash-nav-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.dash-nav-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-nav-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.dash-nav-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 142, 247, 0.3);
}

.dash-nav-btn.conservative {
  border-color: var(--warning);
  color: var(--warning);
}

.dash-nav-btn.conservative:hover {
  background: var(--warning-bg);
}

.dash-nav-btn.conservative.active {
  background: var(--warning);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 20px;
  max-height: 350px;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Pick rows */
.dash-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-pick-row:last-child {
  border-bottom: none;
}

.dash-pick-row.multi {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.dash-pick-teams {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  min-width: 200px;
  color: var(--text);
}

.vs {
  color: var(--text-dim);
  font-weight: 400;
  margin: 0 4px;
  font-style: italic;
}

.dash-conf {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.dash-kick {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 500;
}

.dash-multi-sel {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  width: 100%;
  padding: 4px 0;
}

.dash-combined {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
  padding-top: 6px;
  letter-spacing: 0.2px;
}

/* Confidence columns */
.dash-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 960px) {
  .dash-columns {
    grid-template-columns: 1fr;
  }
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dash-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.01);
  border-bottom: 1px solid var(--border-subtle);
}

.dash-card-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.2px;
}

.dash-card-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.8px;
  cursor: help;
  text-transform: uppercase;
}

/* ── Shared result badge system ──────────────────────────────────────────── */
/* Base class — apply alongside badge-win / badge-loss / badge-draw          */
.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1;
}

.badge-win  { background: var(--success-bg);  color: var(--success); }
.badge-loss { background: var(--danger-bg);   color: var(--danger);  }
.badge-draw { background: var(--accent-glow); color: var(--accent);  }

/* ── Glass panel — shared card surface ───────────────────────────────────── */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dash-card-body {
  padding: 0 14px 10px;
  max-height: 300px;
  overflow-y: auto;
}

.dash-conf-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-conf-row:last-child {
  border-bottom: none;
}

.dash-conf-team {
  font-weight: 700;
  font-size: 14px;
  grid-column: 1;
  color: var(--text);
}

.dash-conf-meta {
  font-size: 11px;
  color: var(--text-muted);
  grid-column: 1;
}

.dash-conf-pct {
  font-size: 15px;
  font-weight: 850;
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  letter-spacing: -0.5px;
}

.win-pct  { color: var(--success); text-shadow: 0 0 10px rgba(34, 197, 94, 0.2); }
.loss-pct { color: var(--danger);  text-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }
.draw-pct { color: var(--accent);  text-shadow: 0 0 10px rgba(79, 142, 247, 0.2); }

.signal-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Custom Scrollbar for Dashboard Containers */
.dash-panel::-webkit-scrollbar,
.dash-card-body::-webkit-scrollbar,
.dash-acca-body::-webkit-scrollbar {
  width: 5px;
}
.dash-panel::-webkit-scrollbar-track,
.dash-card-body::-webkit-scrollbar-track,
.dash-acca-body::-webkit-scrollbar-track {
  background: transparent;
}
.dash-panel::-webkit-scrollbar-thumb,
.dash-card-body::-webkit-scrollbar-thumb,
.dash-acca-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}
.dash-panel::-webkit-scrollbar-thumb:hover,
.dash-card-body::-webkit-scrollbar-thumb:hover,
.dash-acca-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ── Main 2-column row: nav panel + accumulator ── */
.dash-main-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .dash-main-row {
    grid-template-columns: 1fr;
  }
}

.dash-nav-panel {
  min-width: 0;
}

.dash-panel {
  margin-bottom: 0;
}

/* Multi-row fix: tight spacing, no extra gaps */
.dash-pick-row.multi {
  gap: 0;
  padding: 8px 0;
}

.dash-multi-sel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
}

.dash-multi-sel:last-of-type {
  border-bottom: none;
}

.dash-multi-match {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-multi-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Accumulator card ── */
.dash-acca-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-acca-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.01);
  border-bottom: 1px solid var(--border-subtle);
}

.dash-acca-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-acca-tab {
  flex: 1;
  padding: 7px 0;
  background: none;
  border: none;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.dash-acca-tab:last-child {
  border-right: none;
}

.dash-acca-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.02);
}

.dash-acca-tab.active {
  color: var(--accent);
  background: rgba(79, 142, 247, 0.06);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}

.dash-acca-body {
  padding: 0 14px 10px;
  max-height: 420px;
  overflow-y: auto;
}

.acca-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.acca-row:last-child {
  border-bottom: none;
}

.acca-match {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acca-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.acca-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.acca-pick {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* ===== USER DROPDOWN (PHASE 2) ===== */
.user-dropdown {
  position: relative;
  margin-left: 16px;
}

.avatar-circle {
  width: 38px;
  height: 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.avatar-circle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  display: none;
  flex-direction: column;
  padding: 8px;
  z-index: 1000;
  animation: dropdownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-header {
  padding: 12px 16px 8px;
}

.dropdown-user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-role {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.dropdown-item .icon {
  font-size: 15px;
  opacity: 0.6;
}

.dropdown-item.text-danger {
  color: rgba(239, 68, 68, 0.85);
}

.dropdown-item.text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ===== PHASE 5 GOOGLE OAUTH ===== */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider:not(:empty)::before {
  margin-right: 12px;
}

.auth-divider:not(:empty)::after {
  margin-left: 12px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  width: 100%;
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #d2d4d7;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-google img {
  width: 18px;
  height: 18px;
}

/* ===== RETURNS CALCULATOR (PHASE 4) ===== */
.calc-container {
  max-width: 900px;
  margin: 0 auto;
}

.calc-search-box {
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 24px;
  transition: all 0.2s;
  outline: none;
}

.calc-search-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.calc-fixture-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.calc-fixture-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.calc-fixture-info {
  margin-bottom: 12px;
}

.calc-teams {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}

.calc-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.calc-odds-chips {
  display: flex;
  gap: 8px;
}

.odds-chip {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  transition: all 0.2s;
}

.odds-chip:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.odds-chip .label {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 2px;
}

.odds-chip .value {
  font-weight: 700;
  color: var(--accent);
}

.calc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .calc-panel {
    grid-template-columns: 1fr;
  }
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calc-summary {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-result-label {
  font-size: 13px;
  color: var(--text-muted);
}

.calc-result-value {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.calc-result-value.large {
  font-size: 24px;
  color: var(--accent);
}

.calc-edge-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.calc-edge-badge.positive { background: var(--success-bg); color: var(--success); }
.calc-edge-badge.negative { background: var(--danger-bg); color: var(--danger); }
.calc-edge-badge.neutral { background: var(--bg-elevated); color: var(--text-dim); }

/* ===== SYSTEM CONFIG (PHASE 5) ===== */
.intel-config-card {
  margin-top: 24px;
}

.preset-group {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.preset-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.config-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tooltip-icon {
  width: 14px;
  height: 14px;
  background: var(--bg-elevated);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-dim);
  cursor: help;
  transition: all 0.2s;
}

.tooltip-icon:hover {
  background: var(--text-dim);
  color: var(--bg-card);
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE SYSTEM
   Shared breakpoints used by every page:
     ≤ 768px   tablet portrait + phones  (primary mobile breakpoint)
     ≤ 480px   phones only
   Page-specific rules live in each page's <style> block or
   the relevant .css file (signals.css etc).
   ══════════════════════════════════════════════════════════════════ */

/* ─── Mobile nav controls (always in DOM, hidden on desktop) ─── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 9px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 199;
}
.sidebar-overlay.show { display: block; }

/* ─── ≤ 768px: Sidebar collapses, content fills full width ────── */
@media (max-width: 768px) {

  /* Sidebar: hidden off-screen, slides in on .open */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  body.sidebar-open { overflow: hidden; }

  /* Sidebar brand — relative so close button can be absolute */
  .sidebar-brand { position: relative; padding: 20px 16px 16px; }
  .sidebar-brand .brand-sub { display: none; }

  /* Controls visible on mobile */
  .hamburger     { display: flex; }
  .sidebar-close { display: block; }

  /* Hide the "Live Connected" label text — keep the dot */
  .connection-status-text { display: none; }

  /* Main content: no sidebar indent, reduced padding */
  .main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 14px;
  }

  /* Top nav */
  .top-nav { padding: 0 14px; }
  .top-nav-right { gap: 10px; }
  .top-nav-left  { gap: 12px; }

  /* Refresh button: icon only */
  .btn-refresh-label { display: none; }
  .btn-refresh { padding: 7px 10px; }

  /* Dropdown stays inside viewport */
  .dropdown-menu { width: min(220px, calc(100vw - 28px)); }

  /* H2H modal: full-bleed on mobile */
  #h2h-content { padding: 1.25rem; border-radius: var(--radius); }

  /* Shared page header */
  .page-header { margin-bottom: 14px; }
  .page-title  { font-size: 20px; }
  .page-sub    { font-size: 12px; }

  /* Generic cards: full width */
  .card { border-radius: var(--radius); }

  /* ── Dashboard ── */
  .dash-main-row  { grid-template-columns: 1fr !important; }
  .dash-columns   { grid-template-columns: 1fr !important; }
  .dash-nav-btn   { font-size: 11px; padding: 6px 10px; }

  /* Single pick row: wrap teams + meta onto two lines */
  .dash-pick-row {
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: flex-start;
  }
  .dash-pick-teams {
    min-width: 0;
    flex: 1 1 100%;   /* full width first line */
    font-size: 13px;
  }
  .dash-kick { font-size: 11px; }

  /* Multi-fold row */
  .dash-multi-sel   { flex-direction: column; gap: 6px; }
  .dash-multi-right { flex-wrap: wrap; gap: 4px; }
  .dash-multi-match { font-size: 13px; }

  /* Acca row */
  .acca-row { flex-wrap: wrap; gap: 4px; }
  .acca-match { flex: 1 1 100%; }

  /* Calculator */
  .calc-panel { grid-template-columns: 1fr !important; }
}

/* ─── ≤ 480px: Phones — tighten further ─────────────────────── */
@media (max-width: 480px) {
  .main-content { padding: 10px; }
  .top-nav      { height: 52px; padding: 0 10px; }
  .page-title   { font-size: 18px; }

  /* Confidence grid: 2 columns */
  .dash-columns { grid-template-columns: repeat(2, 1fr) !important; }

  /* Confidence summary rows */
  .dash-conf-row { grid-template-columns: 1fr auto; }
  .dash-conf-meta { font-size: 10px; }

  /* Nav link tap area */
  .nav-link { min-height: 44px; align-items: center; }
}
