:root {
    --blue: #1a3e6f;
    --blue-light: #e8eef7;
    --green: #1e7e34;
    --red: #c62828;
    --border: #d7dde5;
    --bg: #f5f7fa;
    --text: #1e2530;
    --muted: #6b7686;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }

.topbar { display: flex; align-items: center; gap: 24px; background: var(--blue); color: #fff; padding: 10px 24px; }
.topbar .brand a { color: #fff; text-decoration: none; font-weight: 700; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar nav a { color: #dbe6f7; text-decoration: none; font-size: 0.9rem; }
.topbar nav a:hover { color: #fff; }
.user-menu { font-size: 0.85rem; color: #cfe0f5; }
.user-menu a { color: #fff; }

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

h1 { margin-top: 0; }
.muted { color: var(--muted); font-size: 0.9em; }
.badge { background: var(--blue-light); color: var(--blue); border-radius: 4px; padding: 1px 6px; font-size: 0.75em; }

.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.actions, .matchday-nav { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { display: inline-block; background: #fff; border: 1px solid var(--border); color: var(--text); padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 0.9rem; cursor: pointer; }
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.small { padding: 2px 8px; font-size: 0.8rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .two-col, .three-col { grid-template-columns: 1fr; } }

section { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; margin-bottom: 20px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.comp-card { display: block; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; text-decoration: none; color: var(--text); }
.comp-card h2 { margin: 0 0 4px; font-size: 1.1rem; color: var(--blue); }
.comp-card.inactive { opacity: 0.6; }
.comp-card.new { display: flex; align-items: center; justify-content: center; color: var(--muted); border-style: dashed; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table th, table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
table.standings tbody tr:hover, table.match-entry tbody tr:hover { background: var(--blue-light); }

.standings.compare tr.up td.pos-arrow, .standings.compare tr.up td:last-child { color: var(--green); }
.standings.compare tr.down td.pos-arrow, .standings.compare tr.down td:last-child { color: var(--red); }

.form-cell { white-space: nowrap; }
.form-badge { display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 3px; font-size: 0.7rem; font-weight: 700; color: #fff; margin-right: 2px; }
.form-badge.W { background: var(--green); }
.form-badge.D { background: #b0862b; }
.form-badge.L { background: var(--red); }

.match-entry input[type=number] { width: 3.5em; text-align: center; }
.match-list { list-style: none; padding: 0; }
.match-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.match-list .matchday { color: var(--muted); font-size: 0.8em; margin-right: 6px; }

.topscorer-list { padding-left: 20px; }

form label { display: block; margin-bottom: 10px; font-size: 0.9rem; }
form input, form select { display: block; width: 100%; margin-top: 2px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.9rem; }
form.inline { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
form.inline input { width: auto; margin: 0; }

.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box { background: #fff; padding: 32px; border-radius: 8px; border: 1px solid var(--border); width: 320px; }
.login-box h1 { font-size: 1.3rem; text-align: center; }
.error { color: var(--red); }
.flash { background: #e6f4ea; color: var(--green); padding: 8px 12px; border-radius: 6px; }

tr.former { opacity: 0.55; }
