/* QuantumFlow Admin — shared styles */
:root {
  --bg: #F8F6F3;
  --surface: #FFFFFF;
  --text: #2D2D2D;
  --muted: #6B6B6B;
  --accent: #4A7C8F;
  --accent-2: #8B6F9E;
  --gold: #C49A6C;
  --success: #5E8E6F;
  --border: #E5E0D8;
  --danger: #B85450;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
header.topbar .brand {
  font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
}
header.topbar .brand .dot { color: var(--gold); }
header.topbar nav a {
  margin-left: 20px; color: var(--muted); font-weight: 500;
}
header.topbar nav a.active { color: var(--text); }
header.topbar .logout {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}

main { max-width: 1280px; margin: 0 auto; padding: 28px; }

h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 0 0 12px; }
.subtitle { color: var(--muted); margin: 0 0 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
}

.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.stat .label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.stat .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table th, table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table tbody tr:hover { background: #FAFAF7; }

button.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
button.btn:hover { background: #3E6A7B; }
button.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
button.btn.danger { background: var(--danger); }
button.btn.gold   { background: var(--gold); color: #2B1F12; }

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
textarea { resize: vertical; min-height: 72px; }
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.rank-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rank-pill.Graduate   { background: #E6E6EA; color: #4A4A55; }
.rank-pill.ProMaster  { background: #F1E2CE; color: #5C3F1F; }
.rank-pill.Master     { background: #E3DAEE; color: #3F2958; }

.badge-ok   { color: var(--success); font-weight: 600; }
.badge-off  { color: var(--muted); }

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F8F6F3 0%, #EFEAE2 100%);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.login-card h1 { text-align: center; margin-bottom: 4px; }
.login-card .subtitle { text-align: center; }
.login-card button { width: 100%; margin-top: 8px; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px;
  max-width: 600px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
}
.modal h2 { margin-bottom: 16px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
