/* ===================================================
   Gestor de Liga de Sóftbol — Estilos de App
   =================================================== */

:root {
  --primary:         #238636;
  --primary-hover:   #2ea043;
  --primary-dark:    #145a24;
  --red:             #da3633;
  --red-hover:       #f85149;
  --gold:            #e3b341;
  --blue:            #1f6feb;
  --bg:              #0d1117;
  --bg-2:            #161b22;
  --bg-3:            #1c2128;
  --border:          #30363d;
  --border-muted:    #21262d;
  --text:            #e6edf3;
  --text-2:          #c9d1d9;
  --text-muted:      #8b949e;
  --sidebar-w:       260px;
  --topbar-h:        58px;
  --radius:          8px;
  --radius-sm:       5px;
  --shadow:          0 4px 20px rgba(0,0,0,.5);
  --live-color:      #f85149;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ── SCREENS ─────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; min-height: 100vh; }

/* ── LOGIN ───────────────────────────────────────── */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #1a3a1a 0%, var(--bg) 70%);
  padding: 20px;
}

.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo { margin-bottom: 20px; }
.login-logo .logo-svg {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
}
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.login-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }

.form-group { text-align: left; margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  transition: border-color .2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(35,134,54,.2); }
.form-group select option { background: var(--bg-3); }
.form-group textarea { resize: vertical; min-height: 70px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.error-msg {
  color: var(--red-hover);
  font-size: 13px;
  background: rgba(218,54,51,.1);
  border: 1px solid rgba(218,54,51,.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.login-hint { color: var(--text-muted); font-size: 12px; margin-top: 16px; }

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all .15s;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; border-color: rgba(240,246,252,.1); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--red-hover); }

.btn-secondary { background: var(--bg-3); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-2); border-color: var(--text-muted); }

.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); }

.btn-outline-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.btn-outline-sm:hover { border-color: var(--text-muted); color: var(--text); }

.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 6px 8px; font-size: 16px; line-height: 1; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.btn-spinner { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateX(0);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  padding-top: env(safe-area-inset-top, 0px);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #1a3a1a, var(--bg-2));
  flex-shrink: 0;
}
.sidebar-logo { width: 34px; height: 34px; flex-shrink: 0; }
.sidebar-league-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.sidebar-season { font-size: 11px; color: var(--text-muted); }
.sidebar-close-btn {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px;
  line-height: 1;
}

.nav-list { list-style: none; padding: 8px 0; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  transition: all .15s;
  border-left: 3px solid transparent;
  position: relative;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active {
  background: rgba(35,134,54,.15);
  color: #3fb950;
  border-left-color: var(--primary);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-card { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; }
.user-role  { font-size: 11px; color: var(--text-muted); }

/* ── MAIN APP BODY ───────────────────────────────── */
.app-body {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s;
}

/* ── TOP BAR ─────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(13,17,23,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  padding-right: 20px;
  z-index: 100;
  flex-shrink: 0;
}
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px; height: 16px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.menu-btn span {
  display: block;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all .2s;
}
.topbar-title { font-size: 17px; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.live-pill {
  background: var(--live-color);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .05em;
  animation: pulse-live 2s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

/* ── PAGE CONTENT ────────────────────────────────── */
.page-content { flex: 1; padding: 24px; max-width: 1400px; }
.page-loading {
  display: flex; align-items: center; justify-content: center;
  height: 200px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── CARDS ───────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.card-title { font-size: 15px; font-weight: 700; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body--np { padding: 0; }

/* ── PAGE HEADER ─────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header h3 { font-size: 22px; font-weight: 800; }
.page-header p  { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.page-header-actions { display: flex; gap: 8px; align-items: flex-start; flex-shrink: 0; }

/* ── GRID LAYOUTS ────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

/* ── TABLES ──────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table th {
  background: var(--bg-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-muted);
  color: var(--text-2);
  white-space: nowrap;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--bg-3); }
table .td-actions { display: flex; gap: 6px; justify-content: flex-end; }
.th-right, .td-right { text-align: right; }
.th-center, .td-center { text-align: center; }

/* ── STANDINGS ───────────────────────────────────── */
.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.team-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.team-abbr-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .04em;
}
.rank-1 .team-name-cell { color: var(--gold); }
.pct-cell { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── STAT CARD ───────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.stat-box {
  background: var(--bg-3);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* ── TEAM CARD ───────────────────────────────────── */
.team-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.team-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.team-card-banner {
  height: 8px;
}
.team-card-body { padding: 16px; }
.team-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.team-card-abbr {
  font-size: 22px; font-weight: 900; color: var(--text);
  letter-spacing: -.02em;
}
.team-card-wl { font-size: 13px; color: var(--text-muted); }
.team-card-name { font-size: 15px; font-weight: 700; }
.team-card-city { font-size: 12px; color: var(--text-muted); }
.team-card-mgr  { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.team-card-footer {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-muted);
}

/* ── PLAYER LIST ─────────────────────────────────── */
.pos-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.pos-P { color: #58a6ff; border-color: #58a6ff33; background: #58a6ff11; }
.pos-C { color: #d29922; border-color: #d2992233; background: #d2992211; }

/* ── SCOREBOARD ──────────────────────────────────── */
.scoreboard {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.scoreboard table { width: 100%; }
.scoreboard th, .scoreboard td {
  padding: 8px 10px;
  text-align: center;
  min-width: 32px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-muted);
}
.scoreboard .team-col { text-align: left; font-weight: 700; padding-left: 14px; min-width: 120px; }
.scoreboard .total-col { font-weight: 800; font-size: 15px; color: var(--text); border-left: 1px solid var(--border); }
.scoreboard .inning-header { color: var(--text-muted); font-size: 11px; }
.scoreboard .active-inning { background: rgba(35,134,54,.15); color: var(--primary-hover); font-weight: 700; }
.scoreboard tr:last-child td { border-bottom: none; }
.scoreboard .away-row { background: rgba(255,255,255,.02); }

/* ── GAME CARD ───────────────────────────────────── */
.game-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .15s;
}
.game-card:hover { border-color: var(--text-muted); }
.game-card.status-live { border-color: var(--live-color); }
.game-card.status-live .game-status { color: var(--live-color); animation: pulse-live 2s infinite; }

.game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.game-date  { font-size: 12px; color: var(--text-muted); }
.game-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.status-scheduled { color: var(--text-muted); }
.status-live      { color: var(--live-color); }
.status-final     { color: var(--primary-hover); }
.status-postponed { color: var(--gold); }

.game-matchup { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.game-team { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.game-team-abbr { font-size: 22px; font-weight: 900; }
.game-team-name { font-size: 11px; color: var(--text-muted); }
.game-score { font-size: 28px; font-weight: 900; color: var(--text); padding: 0 8px; text-align: center; }
.game-vs { font-size: 14px; color: var(--text-muted); font-weight: 700; }
.game-time { font-size: 13px; color: var(--text-muted); }
.game-footer {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-muted);
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── LIVE SCOREBOARD ─────────────────────────────── */
.live-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.live-badge {
  background: var(--live-color);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: .08em;
  animation: pulse-live 2s infinite;
}
.live-inning { font-size: 13px; color: var(--text-muted); }

/* ── FILTER BAR ──────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-bar select,
.filter-bar input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--primary); }

/* ── TABS ────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── SETTINGS SECTION ────────────────────────────── */
.settings-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.settings-section-title {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.settings-section-body { padding: 20px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 14px; }
.empty-state h4 { font-size: 16px; color: var(--text-2); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; margin-bottom: 18px; }

/* ── DASHBOARD ───────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.dashboard-main { min-width: 0; }
.dashboard-side { display: flex; flex-direction: column; gap: 20px; }

.recent-game-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-muted);
  font-size: 13px;
}
.recent-game-row:last-child { border-bottom: none; }
.rg-teams { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rg-team-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rg-team-name { font-weight: 600; }
.rg-score { font-weight: 800; font-size: 15px; }
.rg-score.winner { color: var(--gold); }
.rg-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.upcoming-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-muted);
  font-size: 13px;
}
.upcoming-row:last-child { border-bottom: none; }
.upcoming-matchup { font-weight: 600; }
.upcoming-date { font-size: 11px; color: var(--text-muted); text-align: right; }

/* ── MODAL ───────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.modal-box {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 90%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  animation: modal-in .2s ease;
}
.modal-box--sm { max-width: 380px; }
@keyframes modal-in {
  from { opacity: 0; transform: scale(.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close-btn {
  background: none; border: none;
  color: var(--text-muted); font-size: 18px;
  padding: 2px 6px; border-radius: 4px;
  line-height: 1;
}
.modal-close-btn:hover { color: var(--text); background: var(--bg-3); }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
}

/* ── TOASTS ──────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-in .3s ease;
  max-width: 320px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.toast-out { animation: toast-out .3s ease forwards; }
@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}
.toast-success { background: #1a3a1a; border: 1px solid #2ea043; color: #3fb950; }
.toast-error   { background: #3a1a1a; border: 1px solid #da3633; color: #f85149; }
.toast-info    { background: #0d2a3a; border: 1px solid #1f6feb; color: #58a6ff; }

/* ── HELPERS ─────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--primary-hover); }
.text-danger  { color: var(--red-hover); }
.text-gold    { color: var(--gold); }
.fw-bold { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.section-gap { margin-bottom: 24px; }
.inline-flex { display: inline-flex; align-items: center; gap: 6px; }
.color-swatch {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.1);
}
input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 4px;
  cursor: pointer;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row label { margin: 0; cursor: pointer; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }
  .sidebar-close-btn { display: block; }
  .app-body { margin-left: 0; }
  .menu-btn { display: flex; }
  .page-content { padding: 14px; }
  .grid-2  { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .page-header-actions { width: 100%; }
  .filter-bar { gap: 6px; }
  #toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}

@media (max-width: 480px) {
  .modal-box { width: 95%; }
  .grid-4 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── PWA SAFE AREA ───────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar-footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  #toast-container { bottom: calc(24px + env(safe-area-inset-bottom)); }
  .page-content {
    padding-left:  calc(24px + env(safe-area-inset-left, 0px));
    padding-right: calc(24px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 768px) {
  @supports (padding: env(safe-area-inset-bottom)) {
    .page-content {
      padding-left:  calc(14px + env(safe-area-inset-left, 0px));
      padding-right: calc(14px + env(safe-area-inset-right, 0px));
      padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
  }
}

/* ── SCROLLBAR ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── PRINT ───────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, #toast-container { display: none !important; }
  .app-body { margin: 0; }
  .page-content { padding: 0; }
  body { background: white; color: black; }
}

/* ── 5" PHONE OPTIMIZATIONS (360px target) ────────── */
@media (max-width: 400px) {
  :root { --sidebar-w: 80vw; }
  .topbar { padding: 0 10px; min-height: 48px; }
  .topbar-title { font-size: 15px; }
  .page-content { padding: 10px; }
  .team-card-body { padding: 10px 12px 12px; }
  .team-card-abbr { font-size: 22px; }
  .team-card-name { font-size: 14px; }
  .btn { font-size: 13px; padding: 7px 12px; }
  .btn-sm { font-size: 12px; padding: 5px 9px; }
  .modal-box { width: 97%; max-height: 90vh; }
  .modal-header { padding: 12px 14px; }
  .modal-body { padding: 12px 14px; }
  .form-group label { font-size: 12px; }
  input, select, textarea { font-size: 14px !important; }
  table { font-size: 12px; }
  th, td { padding: 6px 6px; }
  .page-header h3 { font-size: 18px; }
  .sidebar { width: var(--sidebar-w); }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar select,
  .filter-bar input { min-width: 0; font-size: 13px; }
}

/* ── ROSTER SECTION STYLES ───────────────────────── */
.roster-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.team-abbr-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  letter-spacing: .05em;
}
.pos-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── PHOTO CAPTURE UI ────────────────────────────── */
#camera-video {
  width: 100%;
  border-radius: 8px;
  max-height: 220px;
  object-fit: cover;
  background: #000;
}
#photo-preview {
  border: 2px solid var(--border);
  border-radius: 50%;
  object-fit: cover;
}

/* Manager's own team highlight */
.team-card--mine {
  box-shadow: 0 0 0 2px var(--primary), var(--shadow);
}
