:root {
    --bg: #0f1320;
    --card: #131930;
    --muted: #9aa3b2;
    --text: #f3f6fd;
    --accent: #6aa2ff;
    --accent-2: #7effce;
    --danger: #ff6b6b;
    --ok: #59e3a7;
    --chip: #1a2243;
    --grid: #0b1024;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    background:
        radial-gradient(1000px 500px at -10% -20%, #132445, transparent),
        radial-gradient(800px 600px at 120% 10%, #1a2b55, transparent),
        linear-gradient(180deg, #0a0d17 0%, #0b1120 100%);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(10, 13, 23, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #9ec3ff);
}

.title h1 {
    font-size: 18px;
    margin: 0
}

.title p {
    margin: 0;
    color: var(--muted);
    font-size: 12px
}

.top-actions {
    display: flex;
    gap: 8px
}

button {
    border: 1px solid var(--border);
    background: var(--chip);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
}

button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05)
}

button.primary {
    background: linear-gradient(135deg, var(--accent), #9ec3ff);
    color: #0a0f1d;
    border: none
}

button.ghost {
    background: transparent
}

button.danger {
    border-color: rgba(255, 107, 107, .4);
    color: #ffb4b4
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.auth {
    display: grid;
    gap: 18px;
    grid-template-columns: 1.2fr .8fr;
    margin: 24px auto;
    max-width: 1100px;
}

.auth-left h2 {
    margin: .2rem 0
}

.muted {
    color: var(--muted)
}

.tiny {
    font-size: 12px
}

.auth-form {
    display: grid;
    gap: 10px;
    margin-top: 12px
}

.auth-form input,
.form input,
.form select {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0c1230;
    color: var(--text);
    outline: none;
}

.auth-right {
    border-left: 1px dashed var(--border);
    padding-left: 18px;
    display: flex;
    align-items: center;
}

.feature-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    gap: 12px
}

.feature-list li {
    background: var(--chip);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 10px;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 74px);
}

.sidebar {
    border-right: 1px solid var(--border);
    padding: 18px;
    position: sticky;
    top: 74px;
    height: calc(100vh - 74px);
    overflow: auto;
}

.user-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #0b1020;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-2), #b2ffe2);
}

.user-meta .muted {
    font-size: 12px
}

.menu {
    margin-top: 16px;
    display: grid;
    gap: 6px
}

.menu button {
    width: 100%;
    text-align: left
}

.menu button.active {
    background: linear-gradient(135deg, #1d2b57, #192651);
    border-color: #32437a
}

.content {
    padding: 22px;
    display: grid;
    gap: 18px
}

.panel .row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

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

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

.mt {
    margin-top: 12px
}

.stat {
    background: linear-gradient(180deg, #0e1636, #0b1231);
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border)
}

.stat-k {
    font-size: 28px;
    font-weight: 800
}

.stat-l {
    color: var(--muted)
}

.form {
    margin: 6px 0 10px
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.chip {
    background: var(--chip);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px
}

.chip small {
    color: var(--muted)
}

.chip .x {
    cursor: pointer;
    opacity: .7
}

.day-checkboxes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 12px
}

.timetable {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    background: #0a0f26;
}

.timetable th,
.timetable td {
    border: 1px solid var(--border);
    padding: 8px;
    vertical-align: top;
    min-width: 140px;
}

.timetable th {
    position: sticky;
    top: 0;
    background: #0d1333;
    z-index: 1
}

.timetable th:first-child {
    left: 0;
    position: sticky;
    z-index: 2;
    background: #0d1333
}

.slot {
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
    border: 1px dashed rgba(255, 255, 255, .1);
    border-radius: 10px;
    min-height: 70px;
    padding: 6px;
    display: grid;
    gap: 6px;
}

.badge {
    font-size: 10px;
    opacity: .8;
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 999px;
    display: inline-block
}

.tile {
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
    padding: 6px;
    background: #131a3a;
    display: grid;
    gap: 4px;
    cursor: grab;
}

.tile:active {
    cursor: grabbing
}

.tile .t1 {
    font-size: 12px;
    font-weight: 700
}

.tile .t2 {
    font-size: 11px;
    color: var(--muted)
}

.tile .t3 {
    font-size: 10px;
    opacity: .9
}

.note {
    font-size: 12px;
    color: var(--muted)
}

.actions {
    align-items: center
}

#toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: grid;
    gap: 8px;
    z-index: 9999
}

.toast {
    background: #0f183b;
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.toast.ok {
    border-color: rgba(89, 227, 167, .5)
}

.toast.err {
    border-color: rgba(255, 107, 107, .5)
}

@media (max-width: 960px) {
    .auth {
        grid-template-columns: 1fr
    }

    .sm-hide {
        display: none
    }

    .layout {
        grid-template-columns: 1fr
    }

    .sidebar {
        position: relative;
        top: 0;
        height: auto
    }

    .timetable {
        min-width: 720px
    }
}