/* Johan — AI Football Coach : Design System */
:root {
  --bg-primary: #0a0e0d;
  --bg-secondary: #101614;
  --surface: #151d1a;
  --surface-2: #1c2622;
  --border: #26332e;
  --border-strong: #34473f;
  --text-primary: #f2f6f4;
  --text-secondary: #9db0a8;
  --text-muted: #6c7f77;
  --accent: #1f7a5c;
  --accent-bright: #29c37f;
  --accent-glow: rgba(41, 195, 127, 0.15);
  --success: #29c37f;
  --warning: #e8b13a;
  --danger: #e5544b;
  --info: #4a9be8;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }

/* Layout shell */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  display: grid; place-items: center; font-weight: 800; color: #06120d; font-size: 19px;
}
.brand-name { font-size: 16px; font-weight: 800; }
.brand-sub { font-size: 11px; color: var(--text-muted); }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface); color: var(--text-primary); }
.nav a.active { background: var(--accent-glow); color: var(--accent-bright); }
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-foot { padding: 12px 8px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(232,177,58,0.12); color: var(--warning);
  border: 1px solid rgba(232,177,58,0.3);
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 20px;
}

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(10,14,13,0.85); backdrop-filter: blur(10px); z-index: 30;
}
.topbar h1 { font-size: 20px; }
.content { padding: 24px 28px 90px; max-width: 1400px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-primary); font-weight: 600; font-size: 14px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent-bright), var(--accent)); border-color: transparent; color: #06120d; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.danger { border-color: rgba(229,84,75,.4); color: var(--danger); }
.btn.danger:hover { background: rgba(229,84,75,.12); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.icon { padding: 9px; }
.btn svg { width: 16px; height: 16px; }

/* Cards / surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card.pad-sm { padding: 14px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; margin-bottom: 12px; }

/* Stat card */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 30px; font-weight: 800; margin: 6px 0 2px; }
.stat .delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); }

/* Forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
input, textarea, select {
  width: 100%; padding: 10px 12px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 14px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }

/* Chips / tags / badges */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); }
.chip.accent { color: var(--accent-bright); border-color: rgba(41,195,127,.3); background: var(--accent-glow); }
.pos-badge { display:inline-grid; place-items:center; min-width:34px; height:22px; padding:0 7px; border-radius:6px; font-size:11px; font-weight:700; background:var(--surface-2); border:1px solid var(--border); }
.pos-GK{color:#e8b13a;} .pos-DF{color:#4a9be8;} .pos-MF{color:#29c37f;} .pos-FW{color:#e5544b;}

/* Table */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; }
td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
tr.clickable:hover td { background: var(--surface-2); cursor: pointer; }

/* Avatar */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--surface-2), var(--border)); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--text-primary); flex-shrink: 0; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; }

/* Progress bar */
.bar { height: 7px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); border-radius: 6px; }

/* Mobile bottom nav */
.mobile-nav { display: none; }

/* Toast */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-primary); padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; z-index: 100; font-size: 14px; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; padding: 24px; box-shadow: var(--shadow); }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.grow { flex: 1; } .right { margin-left: auto; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.hidden { display: none !important; }

@media (max-width: 1024px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 18px 16px 90px; }
  .topbar { padding: 14px 16px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    justify-content: space-around; padding: 8px 4px;
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--text-muted); padding: 4px 8px; }
  .mobile-nav a.active { color: var(--accent-bright); }
  .mobile-nav a svg { width: 20px; height: 20px; }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn { display: none; }
