:root {
    --ink: #10233f;
    --ink-soft: #24385a;
    --paper: #eef2f6;
    --card: #ffffff;
    --line: #d8e0ea;
    --muted: #5d6d84;
    --blue: #1d4ed8;
    --blue-deep: #16356d;
    --booked: #66758c;
    --danger: #9f1239;
    --ok: #14532d;
    --ok-bg: #e8f6ee;
    --bad-bg: #fde8ec;
    --shadow: 0 10px 30px rgba(16, 35, 63, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

a { color: var(--blue-deep); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 650; }

button, input, select { font: inherit; }

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--ink);
    color: #e7eef8;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.brand {
    display: grid;
    gap: 4px;
    padding: 0 10px;
}

.brand strong { font-size: 18px; letter-spacing: 0.01em; }
.brand span { color: #9eb0c9; font-size: 13px; }

.nav { display: grid; gap: 6px; }

.nav a {
    color: #d7e3f3;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
}

.nav a.active,
.nav a:hover { background: #1c3f6e; color: white; }

.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.who { color: #9eb0c9; font-size: 13px; word-break: break-all; padding: 0 10px; }

.main { padding: 32px 36px 64px; max-width: 1180px; }

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

.page-head h1 { margin: 0 0 6px; font-size: 32px; }
.lede { margin: 0; color: var(--muted); max-width: 68ch; }

.banner {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.bad { background: var(--bad-bg); color: var(--danger); }
.banner p { margin: 0; }
.banner p + p { margin-top: 4px; }

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}

.panel h2 { margin: 0 0 6px; font-size: 20px; }
.panel h3 { margin: 0; font-size: 18px; }

.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.field { display: grid; gap: 6px; }
.field.grow { flex: 1 1 220px; }
.field span, .check { color: var(--ink-soft); font-size: 14px; font-weight: 600; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
.link-field {
    width: 100%;
    border: 1px solid #c5d0de;
    background: white;
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--ink);
}

input:focus { outline: 2px solid #bfd0ee; border-color: var(--blue); }

.btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--ink);
    color: white;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover { background: #1a3a66; }
.btn.secondary { background: white; color: var(--ink); border: 1px solid #c5d0de; }
.btn.secondary:hover { background: #f6f8fb; }
.btn.danger { background: white; color: var(--danger); border: 1px solid #f3c3ce; }
.btn.danger:hover { background: #fff5f7; }
.btn.small { padding: 7px 10px; font-size: 14px; }

.hours { display: flex; flex-wrap: wrap; gap: 8px; }
.hour {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: #f8fafc;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 600;
}
.hour input { accent-color: var(--blue); }
.tag {
    background: #e8eef8;
    color: var(--blue-deep);
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 11px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    background: #f4f7fb;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 650; }
tr.just-added { background: #eef5ff; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.link-cell { min-width: 320px; }
.link-line { display: flex; gap: 8px; align-items: center; }
.para {
    display: inline-block;
    border: 1px solid #c9d7ee;
    color: var(--blue-deep);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.empty { color: var(--muted); margin: 8px 0 0; }

.check-row { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--blue); }

.login-body {
    display: grid;
    place-items: center;
    background:
        radial-gradient(900px 420px at 10% -10%, rgba(29, 78, 216, 0.35), transparent 60%),
        var(--ink);
}

.login-card {
    width: min(440px, calc(100% - 32px));
    background: white;
    border-radius: 18px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.login-card h1 { margin: 8px 0; font-size: 30px; }
.eyebrow { margin: 0; color: var(--blue); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.login-card .btn { width: 100%; margin-top: 6px; }

.public-wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 48px; }
.event-name { margin: 0 0 18px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.team-name { margin: 0; font-size: 34px; }
.team-meta { margin: 4px 0 0; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 22px 0; font-size: 14px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid #d5dbe3; background: white; }
.swatch.booked { background: var(--booked); border-color: var(--booked); }
.swatch.mine { background: var(--blue); border-color: var(--blue); }

.hall { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow); }
.hall-head { background: #f7f9fc; border-bottom: 1px solid var(--line); padding: 14px 16px; letter-spacing: 0.06em; text-transform: uppercase; }
.hall-body { padding: 16px; display: grid; gap: 18px; }
.day-label { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.hour-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: start; margin-bottom: 10px; }
.hour-label { padding-top: 12px; font-size: 14px; font-weight: 700; }
.mats { display: flex; flex-wrap: wrap; gap: 8px; }

.slot {
    min-width: 104px;
    border-radius: 8px;
    border: 1px solid #d5dbe3;
    background: white;
    color: var(--ink);
    padding: 7px 10px;
    display: grid;
    justify-items: center;
    cursor: pointer;
}
.slot .state { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.slot.booked, .slot.mine { color: white; cursor: default; }
.slot.booked { background: var(--booked); border-color: var(--booked); }
.slot.mine { background: var(--blue); border-color: var(--blue); cursor: pointer; }
.slot.booked .state, .slot.mine .state { color: rgba(255, 255, 255, 0.86); }
.slot.free:hover { border-color: var(--blue); }

.mine-list { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 6px; }
.mine-list li { background: #e8efff; border-radius: 10px; padding: 8px 12px; }

.site-foot {
    background: var(--ink);
    color: #d5e2f2;
    text-align: center;
    padding: 22px 16px;
}

.missing { max-width: 560px; margin: 12vh auto; background: white; border-radius: 16px; padding: 28px; }

@media (max-width: 860px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { gap: 14px; }
    .nav { grid-template-columns: repeat(3, 1fr); }
    .sidebar-foot { margin-top: 0; }
    .main { padding: 20px 16px 48px; }
    .hour-row { grid-template-columns: 1fr; }
    .hour-label { padding-top: 0; }
}
