:root {
    --bg: #0f172a;
    --panel: #1e293b;
    --accent: #38bdf8;
    --success: #16a34a;
    --error: #dc2626;
    --text: #f8fafc;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
    background: #020617;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 1.2rem;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
}

.sidebar h3 {
    margin-top: 0;
    font-size: 1.05rem;
    letter-spacing: .02em;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.sidebar a {
    display: block;
    padding: .55rem .75rem;
    border-radius: .5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.sidebar a:hover,
.sidebar a:focus-visible {
    border-color: rgba(56, 189, 248, 0.6);
    background: rgba(56, 189, 248, 0.12);
}

.sidebar a.active {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.25);
}

.sidebar a:focus-visible {
    outline: none;
}

.content {
    padding: 2rem;
}

.page-header {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: .75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.page-header h1 {
    margin: 0 0 .35rem;
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
}

.user-actions {
    display: flex;
    gap: .75rem;
    align-items: center;
}

.logout-link {
    color: var(--text);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: .35rem .9rem;
    border-radius: .35rem;
}

.logout-link:hover {
    border-color: var(--accent);
}

.section-header h2 {
    margin-bottom: .5rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--panel);
    padding: 1rem;
    border-radius: .75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card h3 {
    margin-top: 0;
}

label {
    display: block;
    margin-bottom: .75rem;
    font-size: .95rem;
}

input, select, textarea, button {
    width: 100%;
    padding: .45rem .6rem;
    border-radius: .35rem;
    border: 1px solid rgba(248, 250, 252, 0.2);
    margin-top: .35rem;
    background: rgba(15, 23, 42, 0.6);
    color: var(--text);
}

button {
    cursor: pointer;
    background: var(--accent);
    color: #0f172a;
    font-weight: bold;
    border: none;
}

button:hover {
    opacity: .9;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.inline-form button {
    width: auto;
    padding-inline: .9rem;
}

.danger {
    background: var(--error);
    color: #fff;
}

.danger:hover {
    opacity: .85;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: .5rem;
}

.text-link {
    color: var(--accent);
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

ul.list-with-actions {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.list-with-actions li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.day-grid {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: .65rem;
    padding: .75rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.day-grid legend {
    font-size: .9rem;
    padding: 0 .35rem;
    color: rgba(248, 250, 252, 0.8);
}

.day-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: .5rem;
    padding: .25rem .6rem;
    font-size: .9rem;
}

.day-chip input {
    width: auto;
    margin-top: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

th, td {
    border-bottom: 1px solid rgba(248, 250, 252, 0.08);
    padding: .5rem;
    text-align: left;
}

.alert {
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border-radius: .35rem;
}

.alert-error {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid var(--error);
}

.alert-success {
    background: rgba(22, 163, 74, 0.2);
    border: 1px solid var(--success);
}

.help-text {
    font-size: .85rem;
    color: rgba(248, 250, 252, 0.7);
    margin: .25rem 0 .5rem;
}

.player-view .card,
.player-view header {
    background: transparent;
    border: none;
}

.player-view .player-meta {
    max-width: 800px;
}

.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
}

.auth-container {
    background: #020617;
    padding: 2.5rem 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: min(420px, 90vw);
}

.auth-container h1 {
    margin-top: 0;
}

.auth-form label {
    display: block;
    margin-bottom: 1rem;
}

.auth-form button {
    width: 100%;
    margin-top: .5rem;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .content {
        padding: 1.25rem;
    }

    .page-header {
        flex-direction: column;
    }
}
