:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #1d2733;
    --muted: #667085;
    --border: #dfe4ea;
    --primary: #155eef;
    --danger: #b42318;
    --success: #027a48;
    --warning: #b54708;
    --red-team: #c62828;
    --green-team: #16833c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

a { color: var(--primary); text-decoration: none; }

.topbar { background: #101828; color: white; }

.topbar__inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand { color: white; font-weight: 700; }

.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: #d0d5dd; }
.nav a:hover { color: white; }

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 60px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}

.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .04);
}

.card h1, .card h2, .card h3 { margin-top: 0; }
.stat { font-size: 1.7rem; font-weight: 700; }
.muted { color: var(--muted); }
.team-red { color: var(--red-team); font-weight: 700; }
.team-green { color: var(--green-team); font-weight: 700; }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    background: #e9eef5;
    color: var(--text);
}

.btn:hover { filter: brightness(.97); }
.btn--primary { background: var(--primary); color: white; }
.btn--danger { background: var(--danger); color: white; }
.btn--success { background: var(--success); color: white; }
.btn--warning { background: var(--warning); color: white; }
.btn--small { padding: 7px 10px; font-size: .84rem; }

label { display: block; margin-bottom: 6px; font-weight: 700; }

input, select {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
    align-items: end;
}

.form-field { grid-column: span 4; }
.form-field--wide { grid-column: span 8; }

.table-wrap { width: 100%; overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

th, td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th { background: #f8fafc; font-size: .85rem; color: var(--muted); }
.inline-form { display: inline-flex; gap: 6px; margin: 2px; }

.alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.alert--success { color: #05603a; background: #ecfdf3; border-color: #abefc6; }
.alert--error { color: #912018; background: #fef3f2; border-color: #fecdca; }
.alert--warning { color: #93370d; background: #fffaeb; border-color: #fedf89; }
.alert--info { color: #1849a9; background: #eff8ff; border-color: #b2ddff; }

.login-card { width: min(430px, 100%); margin: 70px auto; }
.login-card .form-field { grid-column: span 12; }

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2f6;
    font-size: .8rem;
    font-weight: 700;
}

.badge--open { background: #ecfdf3; color: #027a48; }
.badge--closed { background: #fff4ed; color: #b93815; }
.badge--finished { background: #eef4ff; color: #3538cd; }

.toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.toolbar form { display: flex; gap: 8px; align-items: end; }
.toolbar input { min-width: 170px; }

@media print {
    .topbar, .toolbar form, .btn, form { display: none !important; }
    body { background: white; }
    .container { width: 100%; margin: 0; }
    .card { box-shadow: none; border: 0; }
}

@media (max-width: 800px) {
    .col-6, .col-4, .form-field, .form-field--wide { grid-column: span 12; }

    .topbar__inner {
        padding: 12px 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .nav { gap: 12px; }
}
