/* ============================================================
   BFF Admin — Brand colors from the Badakhshan Football Federation logo
   Navy #0D1B4B (outer ring) · Red #D42020 (main circle) · Gold #C8A030
   ============================================================ */

:root {
  /* Base */
  --bg:        #070e28;        /* deepest navy */
  --surface:   #0d1b4b;        /* navy from logo outer ring */
  --surface2:  #132060;        /* slightly lighter navy */
  --surface3:  #1a2a72;        /* card hover / raised */
  --border:    rgba(200,160,48,0.18);  /* gold border, subtle */

  /* Brand */
  --red:       #d42020;        /* logo main circle red */
  --red-dark:  #a81818;        /* hover */
  --red-glow:  rgba(212,32,32,0.25);
  --gold:      #c8a030;        /* logo decorative pattern */
  --gold-light:#e8c040;
  --silver:    #8fa8c0;        /* snow leopard grey */

  /* Text */
  --text:       #ffffff;
  --text-muted: rgba(255,255,255,0.45);
  --text-dim:   rgba(255,255,255,0.25);

  /* Status */
  --green:  #4caf50;
  --blue:   #4fc3f7;
  --orange: #ff9800;

  --nav-h: 62px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  min-height: 100vh;
  padding-bottom: var(--nav-h);
}

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

/* ============================================================
   TOP HEADER
   ============================================================ */
.top-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 2px solid var(--red);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  height: 54px;
  box-shadow: 0 2px 16px rgba(212,32,32,0.2);
}

.top-header .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 15px; letter-spacing: 0.5px;
  color: var(--text);
}

.top-header .brand .brand-logo {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.top-header .brand .brand-logo img { width: 100%; height: 100%; object-fit: cover; }

.top-header .brand-name {
  display: flex; flex-direction: column; line-height: 1.1;
}
.top-header .brand-title { font-size: 13px; font-weight: 800; color: var(--gold-light); }
.top-header .brand-sub { font-size: 9px; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; }

.top-header .header-right { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   LANG TOGGLE
   ============================================================ */
.lang-toggle { display: flex; gap: 3px; }
.lang-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); padding: 4px 9px; border-radius: 5px; font-size: 11px;
  font-weight: 600; letter-spacing: 0.5px; transition: all 0.15s;
}
.lang-btn.active {
  background: var(--gold); color: #000;
  border-color: var(--gold); box-shadow: 0 0 8px rgba(200,160,48,0.4);
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface);
  border-top: 2px solid var(--red);
  display: flex; height: var(--nav-h);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  color: var(--text-muted); font-size: 9px; letter-spacing: 0.5px;
  border: none; background: none; padding: 0;
  transition: color 0.15s;
  position: relative;
}
.nav-item .nav-icon { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--gold-light); }
.nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%; height: 2px;
  background: var(--red);
  border-radius: 0 0 3px 3px;
}
.nav-item:active { opacity: 0.7; }

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page { max-width: 480px; margin: 0 auto; padding: 16px; }

/* ============================================================
   HERO / DASHBOARD HEADER CARD
   ============================================================ */
.dashboard-hero {
  background: linear-gradient(135deg, var(--surface2) 0%, #0a1535 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 18px 18px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.dashboard-hero::before {
  content: '';
  position: absolute; top: -30px; right: -30px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
  pointer-events: none;
}
.dashboard-hero .hero-logo {
  width: 60px; height: 60px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--gold); margin-bottom: 10px;
  box-shadow: 0 0 16px rgba(200,160,48,0.3);
}
.dashboard-hero .hero-logo img { width: 100%; height: 100%; object-fit: cover; }
.dashboard-hero .hero-title {
  font-size: 17px; font-weight: 800; color: var(--gold-light);
  letter-spacing: 0.3px; margin-bottom: 2px;
}
.dashboard-hero .hero-sub { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }

.stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s;
}
.stat-card:active { transform: scale(0.97); }
.stat-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
}
.stat-card.red::after  { background: var(--red); }
.stat-card.gold::after { background: var(--gold); }
.stat-card.blue::after { background: var(--blue); }
.stat-card.green::after { background: var(--green); }

.stat-card .stat-icon { font-size: 28px; margin-bottom: 8px; }
.stat-card .stat-num  { font-size: 30px; font-weight: 800; color: var(--gold-light); line-height: 1; }
.stat-card .stat-label { font-size: 10px; color: var(--text-muted); margin-top: 4px; letter-spacing: 0.5px; text-transform: uppercase; }

/* ============================================================
   SECTION LABEL
   ============================================================ */
.section-label {
  font-size: 10px; letter-spacing: 2px; color: var(--gold);
  text-transform: uppercase; margin-bottom: 10px; margin-top: 20px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ============================================================
   LIST CARDS
   ============================================================ */
.list-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.list-card:active { background: var(--surface3); border-color: rgba(200,160,48,0.35); }

.list-card .card-logo {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  background: var(--surface); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.list-card .card-logo img { width: 100%; height: 100%; object-fit: cover; }

.list-card .card-info { flex: 1; min-width: 0; }
.list-card .card-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card .card-sub  { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  border: none; border-radius: 10px; padding: 11px 18px; font-size: 14px;
  font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { opacity: 0.8; transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  box-shadow: 0 3px 12px var(--red-glow);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #000;
  box-shadow: 0 3px 12px rgba(200,160,48,0.3);
}
.btn-danger { background: #7f0000; color: #fff; }
.btn-ghost {
  background: var(--surface3); color: var(--text);
  border: 1px solid var(--border);
}
.btn-icon {
  background: none; border: none; padding: 6px;
  font-size: 16px; color: var(--text-muted);
}
.btn-icon:hover { color: var(--text); }

/* ============================================================
   FAB
   ============================================================ */
.fab {
  position: fixed; bottom: calc(var(--nav-h) + 14px); right: 16px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff; border: none; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px var(--red-glow), 0 0 0 3px rgba(212,32,32,0.15);
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px 11px 38px;
  width: 100%; color: var(--text); font-size: 14px;
  margin-bottom: 14px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  transition: border-color 0.15s;
}
.search-bar:focus { border-color: var(--gold); }

/* ============================================================
   FORM
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-label {
  font-size: 11px; color: var(--gold); margin-bottom: 5px; display: block;
  font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}
.form-input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px; width: 100%;
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--gold); }
select.form-input { appearance: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ============================================================
   MODAL / BOTTOM SHEET
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  z-index: 200; display: flex; align-items: flex-end;
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }

.modal-sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  border-top: 2px solid var(--red);
  width: 100%; max-height: 92vh; overflow-y: auto;
  padding: 6px 16px 36px;
}
.modal-sheet::before {
  content: '';
  display: block; width: 36px; height: 4px;
  background: var(--border); border-radius: 2px;
  margin: 10px auto 16px;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.modal-title { font-size: 17px; font-weight: 800; color: var(--gold-light); }
.modal-close {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 18px;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block; border-radius: 5px; padding: 2px 7px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-active     { background: rgba(76,175,80,0.2);   color: #81c784; }
.badge-finished   { background: rgba(120,120,140,0.2); color: #9ea7b0; }
.badge-live       { background: rgba(212,32,32,0.25);  color: #ff6b6b; animation: pulse-badge 1.5s infinite; }
.badge-scheduled  { background: rgba(79,195,247,0.2);  color: var(--blue); }
.badge-superadmin { background: rgba(200,160,48,0.2);  color: var(--gold-light); }
.badge-editor     { background: rgba(79,195,247,0.2);  color: var(--blue); }
.badge-operator   { background: rgba(76,175,80,0.2);   color: #81c784; }

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================================
   UPLOAD
   ============================================================ */
.upload-preview {
  width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin: 0 auto 10px;
  box-shadow: 0 0 0 4px rgba(200,160,48,0.08);
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-btn-wrap { text-align: center; margin-bottom: 16px; }

/* ============================================================
   MATCH LIVE CONTROLS
   ============================================================ */
.score-control {
  display: flex; align-items: center; gap: 16px;
  justify-content: center; margin: 14px 0;
}
.score-display {
  font-size: 38px; font-weight: 900; min-width: 80px;
  text-align: center; color: var(--gold-light);
  text-shadow: 0 0 20px rgba(200,160,48,0.4);
  font-variant-numeric: tabular-nums;
}
.score-btn {
  width: 48px; height: 48px; border-radius: 50%; border: none;
  font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
}
.score-btn:active { transform: scale(0.9); }
.score-btn-plus { background: var(--red); color: #fff; box-shadow: 0 3px 10px var(--red-glow); }
.score-btn-minus { background: var(--surface3); color: var(--text-muted); }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; gap: 4px; }
.tab {
  padding: 10px 14px; font-size: 12px; font-weight: 700; color: var(--text-muted);
  border: none; background: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; letter-spacing: 0.5px; text-transform: uppercase;
  transition: color 0.15s;
}
.tab.active { color: var(--gold-light); border-bottom-color: var(--red); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  border-radius: 10px; padding: 10px 18px;
  font-size: 13px; font-weight: 600;
  z-index: 300; pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.toast.hidden { display: none; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, #1a2060 0%, var(--bg) 60%);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 24px 28px;
  width: 100%; max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(200,160,48,0.1);
}
.login-logo-wrap {
  display: flex; justify-content: center; margin-bottom: 16px;
}
.login-logo-img {
  width: 90px; height: 90px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 0 30px rgba(212,32,32,0.3), 0 0 0 6px rgba(200,160,48,0.1);
}
.login-logo-img img { width: 100%; height: 100%; object-fit: cover; }
.login-title {
  text-align: center; font-size: 19px; font-weight: 900;
  color: var(--gold-light); margin-bottom: 3px; letter-spacing: 0.5px;
}
.login-sub {
  text-align: center; font-size: 11px; color: var(--text-muted);
  margin-bottom: 24px; letter-spacing: 1px; text-transform: uppercase;
}
.login-divider {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-divider span { font-size: 9px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; }
.login-error {
  background: rgba(212,32,32,0.15); border: 1px solid rgba(212,32,32,0.3);
  color: #ff8080; border-radius: 8px;
  padding: 9px 13px; font-size: 13px; margin-bottom: 12px;
}
.login-footer {
  display: flex; justify-content: center; gap: 8px; margin-top: 20px;
}

/* ============================================================
   POSITION PILL
   ============================================================ */
.pos-pill {
  display: inline-block; border-radius: 5px; padding: 2px 7px; font-size: 10px;
  background: rgba(200,160,48,0.12); color: var(--gold);
  font-weight: 600; letter-spacing: 0.3px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; color: var(--text-dim);
  padding: 50px 20px; font-size: 14px;
}
.empty-state::before { content: '⚽'; display: block; font-size: 36px; margin-bottom: 10px; }

/* ============================================================
   MUST CHANGE PASSWORD BANNER
   ============================================================ */
.must-change-banner {
  background: rgba(212,32,32,0.12);
  border: 1px solid rgba(212,32,32,0.3);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; font-size: 13px;
}

/* ============================================================
   DECORATIVE GOLD LINE (top of page under header)
   ============================================================ */
.gold-stripe {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin-bottom: 16px;
}

/* ============================================================
   MATCH CARD special styling
   ============================================================ */
.match-score {
  font-size: 18px; font-weight: 900; color: var(--gold-light);
  letter-spacing: 2px;
}
.match-vs {
  font-size: 10px; color: var(--text-dim); letter-spacing: 1px;
  text-transform: uppercase;
}

/* ============================================================
   DESKTOP CENTERING
   ============================================================ */
@media (min-width: 520px) {
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
  .fab { right: calc(50% - 240px + 16px); }
  .toast { max-width: 400px; }
}
