:root {
    --color-bg: #f4f6f8;
    --color-card: #ffffff;
    --color-text: #1a2330;
    --color-muted: #6b7785;
    --color-border: #d8dee5;
    --color-primary: #1a73e8;
    --color-in: #1f9d55;
    --color-out: #c0392b;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

.topbar {
    background: var(--color-primary);
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar h1 { margin: 0; font-size: 1.25rem; }
.topbar__link {
    color: #fff;
    text-decoration: underline;
    font-size: 0.95rem;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem;
}

.empty {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: var(--color-muted);
}

.flash {
    background: #e8f4ff;
    border: 1px solid #b9dcff;
    color: #144985;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.card h2 { margin-top: 0; font-size: 1.1rem; }

.swimmer-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.swimmer {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.swimmer.is-in {
    background: #eef9f1;
    border-color: #b8e2c4;
}
.swimmer__name {
    font-size: 1.1rem;
    font-weight: 500;
}

.btn {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: var(--color-primary);
    min-height: 44px;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--in  { background: var(--color-in); }
.btn--out { background: var(--color-out); }
.btn--small { padding: 0.4rem 0.75rem; font-size: 0.9rem; min-height: 0; }

.row-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}
.row-form input[type="text"],
.row-form input[type="number"] {
    padding: 0.55rem 0.65rem;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    min-height: 40px;
}
.row-form input[type="text"] { flex: 1 1 8rem; min-width: 6rem; }
.row-form input[type="number"] { width: 6.5rem; }

.roster-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-top: 1px solid var(--color-border);
}
.roster-row:first-of-type { border-top: 0; }

.status-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}
.status-pill.is-in  { background: var(--color-in); }
.status-pill.is-out { background: var(--color-out); }
