:root {
    color-scheme: dark;
    --bg: #090b0f;
    --surface: #12161d;
    --surface-2: #191f28;
    --line: #29335f;
    --text: #f3f7fb;
    --muted: #a7b1d6;
    --cyan: #22e7ff;
    --violet: #b44cff;
    --pink: #ff3df2;
    --green: #39ff99;
    --red: #ff5c7a;
    --blue: #4aa3ff;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 8%, rgba(34, 231, 255, 0.2), transparent 28%),
        radial-gradient(circle at 88% 10%, rgba(180, 76, 255, 0.22), transparent 30%),
        linear-gradient(180deg, #070812, var(--bg));
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 4px;
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1;
}

h2 {
    margin-bottom: 0;
    font-size: 24px;
}

h3 {
    margin-bottom: 12px;
    font-size: 18px;
}

.muted,
.hint,
small {
    color: var(--muted);
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(480px, 100%);
    padding: 30px;
    border: 1px solid rgba(34, 231, 255, 0.34);
    border-radius: 8px;
    background: rgba(11, 14, 30, 0.94);
    box-shadow: 0 0 42px rgba(34, 231, 255, 0.12), 0 24px 80px rgba(0, 0, 0, 0.35);
}

.login-logo {
    width: min(260px, 82%);
    display: block;
    margin: 0 auto 22px;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 24px;
    border-right: 1px solid var(--line);
    background: rgba(8, 10, 24, 0.96);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand img {
    width: 92px;
    height: 44px;
    object-fit: contain;
}

.side-nav {
    display: grid;
    gap: 8px;
}

.side-nav a {
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
}

.side-nav a.active,
.side-nav a:hover {
    border-color: rgba(34, 231, 255, 0.4);
    background: linear-gradient(135deg, rgba(34, 231, 255, 0.12), rgba(180, 76, 255, 0.12));
    color: var(--text);
}

.user-box {
    margin-top: auto;
    display: grid;
    gap: 6px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.content {
    min-width: 0;
    padding: 28px;
}

.topbar,
.section-head,
.schedule-head,
.slot-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.role-pill,
.slot-count {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid rgba(34, 231, 255, 0.42);
    border-radius: 999px;
    color: var(--cyan);
    font-weight: 800;
    box-shadow: 0 0 18px rgba(34, 231, 255, 0.12);
}

.panel {
    margin-top: 20px;
    padding: 22px;
    border: 1px solid rgba(72, 91, 162, 0.78);
    border-radius: 8px;
    background: rgba(12, 15, 32, 0.92);
    box-shadow: 0 0 30px rgba(180, 76, 255, 0.06);
}

.create-day {
    margin-top: 18px;
}

.create-day-panel {
    margin-top: 0;
}

.event-admin-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
}

.event-name-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid rgba(34, 231, 255, 0.24);
    border-radius: 8px;
    background: rgba(8, 12, 24, 0.72);
}

.event-admin-tools > form:not(.event-name-form) {
    justify-self: end;
}

.shift-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.shift-times span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(34, 231, 255, 0.34);
    border-radius: 999px;
    color: var(--cyan);
    font-weight: 800;
}

.availability-panel,
.staff-status-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(34, 231, 255, 0.24);
    border-radius: 8px;
    background: rgba(8, 12, 24, 0.72);
}

.availability-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}

.choice-card {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(72, 91, 162, 0.86);
    border-radius: 8px;
    background: #090d13;
    cursor: pointer;
}

.choice-card input {
    width: auto;
    min-height: 0;
}

.choice-card span {
    margin: 0;
    color: var(--text);
    font-weight: 800;
}

.staff-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.staff-status {
    display: grid;
    gap: 5px;
    min-height: 92px;
    padding: 12px;
    border: 1px solid rgba(72, 91, 162, 0.7);
    border-radius: 8px;
    background: rgba(9, 13, 19, 0.86);
}

.staff-status span {
    font-weight: 900;
}

.staff-status.available span {
    color: var(--cyan);
}

.staff-status.unavailable span {
    color: var(--red);
}

.staff-status.unavailable {
    border-color: rgba(255, 92, 122, 0.78);
    background: linear-gradient(135deg, rgba(255, 92, 122, 0.2), rgba(9, 13, 19, 0.9));
    box-shadow: 0 0 24px rgba(255, 92, 122, 0.14);
}

.staff-status.unavailable strong::after {
    content: "FREI";
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-left: 8px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 92, 122, 0.18);
    color: #ffd7df;
    font-size: 11px;
    font-weight: 900;
}

.staff-status.planned {
    border-color: rgba(57, 255, 153, 0.58);
}

.staff-status.planned span {
    color: var(--green);
}

.staff-status.missing span {
    color: var(--muted);
}

.slot-group {
    margin-top: 24px;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.slot-card {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0f141b;
}

.slot-card.filled {
    border-color: rgba(79, 219, 138, 0.42);
    background: linear-gradient(135deg, rgba(57, 255, 153, 0.1), #0f141b 70%);
}

.slot-title span {
    color: var(--muted);
}

.assigned-name {
    min-height: 34px;
    display: flex;
    align-items: center;
    color: var(--green);
    font-size: 20px;
    font-weight: 800;
}

.assigned-shift {
    width: max-content;
    max-width: 100%;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(34, 231, 255, 0.32);
    border-radius: 999px;
    color: var(--cyan);
    font-size: 13px;
    font-weight: 900;
}

.slot-card:not(.filled) .assigned-name {
    color: var(--muted);
}

.stack,
.assign-form {
    display: grid;
    gap: 12px;
}

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

label span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid rgba(72, 91, 162, 0.86);
    border-radius: 6px;
    background: #090d13;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(34, 231, 255, 0.12);
}

textarea {
    resize: vertical;
}

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    color: #ffffff;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    white-space: normal;
}

.button.ghost {
    border-color: rgba(34, 231, 255, 0.32);
    background: rgba(19, 24, 52, 0.9);
    color: var(--text);
}

.button.danger {
    border-color: rgba(255, 92, 122, 0.52);
    background: rgba(255, 92, 122, 0.12);
    color: #ffd7df;
}

.button.small {
    min-height: 36px;
}

.link-button {
    width: max-content;
    padding: 0;
    border: 0;
    background: none;
    color: var(--blue);
    font: inherit;
    cursor: pointer;
}

.calendar-panel {
    margin-bottom: 20px;
}

.month-nav,
.copy-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}

.calendar-weekday {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.calendar-empty,
.calendar-day {
    min-height: 116px;
    padding: 10px;
    border: 1px solid rgba(72, 91, 162, 0.72);
    border-radius: 8px;
    background: rgba(8, 12, 24, 0.88);
}

.calendar-day {
    position: relative;
    display: grid;
    align-content: start;
    gap: 6px;
    text-decoration: none;
}

.planned-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border: 1px solid rgba(57, 255, 153, 0.58);
    border-radius: 999px;
    background: rgba(57, 255, 153, 0.13);
    color: var(--green);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.calendar-day strong {
    font-size: 20px;
}

.calendar-day span {
    min-height: 18px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.calendar-day.has-event {
    border-color: rgba(34, 231, 255, 0.38);
}

.calendar-day.has-plan {
    background: linear-gradient(135deg, rgba(34, 231, 255, 0.13), rgba(180, 76, 255, 0.1));
}

.calendar-day.own-plan {
    border-color: rgba(57, 255, 153, 0.8);
    background: linear-gradient(135deg, rgba(57, 255, 153, 0.24), rgba(34, 231, 255, 0.08));
    box-shadow: 0 0 22px rgba(57, 255, 153, 0.16);
}

.calendar-day.selected {
    outline: 2px solid var(--pink);
}

.muted-day {
    opacity: 0.45;
}

.link-button.danger {
    color: var(--red);
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-pill {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-pill.active {
    border: 1px solid rgba(57, 255, 153, 0.5);
    color: var(--green);
    background: rgba(57, 255, 153, 0.08);
}

.status-pill.pending {
    border: 1px solid rgba(34, 231, 255, 0.5);
    color: var(--cyan);
    background: rgba(34, 231, 255, 0.08);
}

.status-pill.blocked {
    border: 1px solid rgba(255, 92, 122, 0.58);
    color: #ffd7df;
    background: rgba(255, 92, 122, 0.14);
}

.notice {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.notice.success {
    border-color: rgba(79, 219, 138, 0.48);
}

.notice.error {
    border-color: rgba(255, 92, 122, 0.58);
    color: #ffd7df;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.empty-state {
    padding: 28px;
    border: 1px dashed var(--line);
    border-radius: 8px;
}

@media (max-width: 1100px) {
    .app-shell,
    .event-admin-tools,
    .event-name-form,
    .availability-form,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        gap: 14px;
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .brand {
        justify-content: space-between;
    }

    .brand img {
        width: 76px;
        height: 36px;
    }

    .side-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .side-nav a {
        text-align: center;
    }

    .user-box {
        margin-top: 0;
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .content {
        padding: 14px;
    }

    h1 {
        font-size: 34px;
    }

    .panel {
        padding: 16px;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .calendar-weekday,
    .calendar-empty,
    .calendar-day.muted-day {
        display: none;
    }

    .calendar-day {
        min-height: 0;
        grid-template-columns: 48px 1fr;
        align-items: center;
        gap: 6px 12px;
        padding-right: 86px;
    }

    .calendar-day strong {
        grid-row: 1 / span 3;
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        border-radius: 8px;
        background: rgba(34, 231, 255, 0.1);
    }

    .calendar-day span,
    .calendar-day small {
        min-height: 0;
    }

    .event-admin-tools > form:not(.event-name-form) {
        justify-self: stretch;
    }

    .event-admin-tools > form:not(.event-name-form) .button {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .content,
    .sidebar,
    .login-page {
        padding: 16px;
    }

    .topbar,
    .section-head,
    .schedule-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .slot-grid {
        grid-template-columns: 1fr;
    }

    .topbar .role-pill,
    .slot-count,
    .month-nav,
    .month-nav .button,
    .event-name-form .button,
    .availability-form .button,
    .create-day .button,
    .assign-form .button {
        width: 100%;
    }

    .month-nav {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: stretch;
        text-align: center;
    }

    .shift-times span {
        width: 100%;
        justify-content: center;
    }

    .slot-card {
        min-height: 0;
    }
}
