/* ============================================================
   Football Manager — единый базовый слой
   ============================================================ */

:root {
  --bg:           #0e1218;
  --bg-elev:      #161c25;
  --bg-elev-2:    #1e2530;
  --bg-hover:     #232c38;
  --border:       #232c38;
  --border-hi:    #2f3946;
  --text:         #e6edf3;
  --text-dim:     #8b96a4;
  --text-mute:    #5a6776;
  --accent:       #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft:  #1e3a5f;
  --success:      #22c55e;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
  --shadow:       0 1px 2px rgba(0,0,0,0.25);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02','cv03','cv04','cv11','ss01';
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; color: var(--text); }
h4 { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #60a5fa; }

.container { max-width: 1280px; margin: 0 auto; padding: 20px 24px; }

/* === NAVBAR === */
#topnav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 4px;
  padding: 0 20px; height: 52px;
}
#topnav .brand {
  font-weight: 700; font-size: 15px; color: var(--text);
  margin-right: 20px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
#topnav a {
  color: var(--text-dim);
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
#topnav a:hover { background: var(--bg-elev-2); color: var(--text); }
#topnav a.active { background: var(--accent-soft); color: #93c5fd; }
#topnav .spacer { flex: 1; }
#topnav .user { color: var(--text-dim); font-size: 12px; padding: 0 10px; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-hi); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: #7f1d1d; color: #fecaca; border-color: #7f1d1d; }
.btn-danger:hover { background: #991b1b; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-elev-2); }

/* === CARDS === */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

/* === TABLES === */
.table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
}
.table th {
  background: #121820;
  color: var(--text-dim);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--bg-elev-2); }
.table .num { font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.table .me { background: var(--accent-soft); }

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-size: 11px; font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-danger  { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-muted   { background: var(--bg-elev-2); color: var(--text-dim); }
.badge-accent  { background: var(--accent-soft); color: #93c5fd; }

/* === MESSAGES === */
.msg { padding: 10px 14px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 13px; display: none; }
.msg.is-on { display: block; }
.msg-info { background: var(--accent-soft); color: #93c5fd; border: 1px solid #2a4a70; }
.msg-ok   { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.msg-err  { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }

/* === EMPTY STATE === */
.empty {
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}

/* === TABS === */
.tabs {
  display: flex; gap: 2px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.tabs button {
  background: transparent;
  color: var(--text-dim);
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* === INPUTS === */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit; font-size: 13px;
  transition: border-color 0.12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* === LOGIN === */
#login-screen {
  max-width: 400px;
  margin: 100px auto;
  padding: 32px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
#login-screen h1 { text-align: center; font-size: 22px; margin-bottom: 24px; }
#login-screen input { width: 100%; margin-bottom: 10px; }
#login-screen button { width: 100%; margin-top: 4px; padding: 10px; }
#login-screen .divider { text-align: center; color: var(--text-mute); margin: 18px 0 12px; font-size: 12px; position: relative; }
#login-screen .divider::before, #login-screen .divider::after {
  content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border);
}
#login-screen .divider::before { left: 0; }
#login-screen .divider::after { right: 0; }

/* === UTILITY === */
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--text-dim); }
.hint { color: var(--text-mute); font-size: 12px; }
.spacer-y { height: 20px; }