:root { --primary:#1565c0; --primary-dark:#0d47a1; --bg-light:#eef4fc; --danger:#d10000; --warn:#e07b00; --accent:#0d1b2a; }
* { box-sizing:border-box; }
body { font-family:Arial, sans-serif; margin:0; background:var(--bg-light); color:#1a1a1a; }
header.topbar { background:var(--primary); color:white; padding:12px 20px; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; }
header.topbar .brand { font-weight:bold; font-size:1.25em; display:flex; align-items:center; gap:8px; }
header.topbar .brand img { height:36px; width:36px; border-radius:50%; background:white; padding:2px; }
nav.mainnav { display:flex; flex-wrap:wrap; gap:4px; }
nav.mainnav a { color:white; text-decoration:none; padding:6px 10px; border-radius:6px; font-size:0.9em; }
nav.mainnav a:hover, nav.mainnav a.active { background:var(--primary-dark); }
.userbox { font-size:0.85em; text-align:right; }
main { max-width:1100px; margin:20px auto; padding:0 15px 40px; }
.card { background:white; border-radius:10px; padding:18px; margin-bottom:18px; box-shadow:0 2px 8px rgba(0,0,0,0.06); }
h2, h3 { color:var(--primary-dark); }
table { width:100%; border-collapse:collapse; margin-top:10px; font-size:0.92em; }
th, td { padding:8px 10px; text-align:left; border-bottom:1px solid #eee; }
th { background:#f2f7fd; color:var(--primary-dark); }
tr:hover td { background:#fafcff; }
label { display:block; font-weight:600; margin-top:12px; color:var(--primary-dark); font-size:0.9em; }
input, select, textarea { width:100%; padding:9px; margin-top:5px; border:1px solid #ccc; border-radius:6px; font-size:0.95em; font-family:inherit; }
button, .btn { background:var(--primary); color:white; border:none; padding:10px 16px; border-radius:6px; cursor:pointer; font-size:0.95em; text-decoration:none; display:inline-block; }
button:hover, .btn:hover { background:var(--primary-dark); }
.btn.danger { background:var(--danger); }
.btn.danger:hover { background:#a10000; }
.btn.secondary { background:white; color:var(--primary-dark); border:2px solid var(--primary); }
.pill { display:inline-block; padding:3px 9px; border-radius:20px; font-size:0.78em; font-weight:bold; }
.pill.ok { background:#e3f0ff; color:var(--primary-dark); }
.pill.low { background:#fff1d6; color:var(--warn); }
.pill.admin { background:#e3e8ff; color:#2d3bb5; }
.pill.staff { background:#f0f0f0; color:#555; }
.alert { padding:12px 14px; border-radius:8px; margin-bottom:15px; font-size:0.92em; }
.alert.error { background:#ffe9e9; color:#8a0000; border:1px solid #f3b3b3; }
.alert.success { background:#e3f0ff; color:var(--primary-dark); border:1px solid #b7d3f7; }
.alert.warn { background:#fff6e5; color:var(--warn); border:1px solid #ffdca0; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.thumb { width:70px; height:70px; object-fit:cover; border-radius:6px; border:1px solid #ddd; }
.login-wrap { max-width:380px; margin:80px auto; }
.login-wrap .logo { display:block; margin:0 auto 10px; height:90px; }
.hint { font-size:0.82em; color:#666; margin-top:4px; }

/* ---- Gamification ---- */
.leaderboard-row { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid #f0f0f0; }
.leaderboard-row:last-child { border-bottom:none; }
.medal { font-size:1.3em; margin-right:8px; }
.progress-bar-track { background:#e5eefc; border-radius:20px; height:16px; overflow:hidden; margin-top:6px; }
.progress-bar-fill { background:linear-gradient(90deg, var(--primary), #42a5f5); height:100%; border-radius:20px; transition:width 0.4s ease; }

@media (max-width:700px) {
  .grid-2 { grid-template-columns:1fr; }
  table, thead, tbody, th, td, tr { display:block; }
  thead { display:none; }
  tr { border-bottom:2px solid var(--primary); margin-bottom:8px; }
  td { border:none; padding:4px 0; }
  td::before { content: attr(data-label); font-weight:bold; color:var(--primary-dark); display:block; font-size:0.8em; }
}
