@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');
:root {
    --bg: #111315;
    --bg-2: #171a1d;
    --panel: #1b1f23;
    --panel-2: #22272c;
    --line: rgba(255, 255, 255, .08);
    --ink: #f4f1ea;
    --muted: #a59d92;
    --accent: #0f7c7a;
    --accent-deep: #095856;
    --accent-soft: rgba(15, 124, 122, .14);
    --gold: #c9a65b;
    --success: #6ea05a;
    --danger: #d36a8d;
    --shadow-sm: 0 10px 25px rgba(0, 0, 0, .24);
    --shadow-md: 0 24px 60px rgba(0, 0, 0, .34);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    scroll-behavior: smooth
}

body {
    min-height: 100vh;
    background: linear-gradient(180deg, #0f1113 0%, #15181b 100%);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    line-height: 1.6
}

a {
    text-decoration: none;
    color: inherit;
    transition: .25s ease
}

button,
input,
select,
textarea {
    font: inherit
}

button {
    border: none;
    cursor: pointer
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #171a1d;
    color: var(--ink);
    outline: none;
    transition: .2s ease
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 124, 122, .16)
}

textarea {
    min-height: 110px;
    resize: vertical
}

img,
svg {
    display: block;
    max-width: 100%
}

.layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh
}

.sidebar {
    background: rgba(22, 25, 28, .92);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--line);
    padding: 28px;
    position: sticky;
    top: 0;
    height: 100vh
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 34px
}

.mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), #31a19c);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 700;
    box-shadow: var(--shadow-sm)
}

.brand strong {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: .02em
}

.brand span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px
}

.nav-title {
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #8a8379;
    margin: 18px 0 12px
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 15px;
    border-radius: 16px;
    color: var(--muted);
    margin-bottom: 8px;
    font-size: 15px
}

.nav a:hover,
.nav a.active {
    background: var(--panel-2);
    color: var(--ink);
    box-shadow: var(--shadow-sm)
}

.main {
    padding: 28px
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    background: rgba(27, 31, 35, .95);
    border: 1px solid var(--line);
    border-radius: 32px;
    padding: 28px;
    box-shadow: var(--shadow-sm)
}

.topbar h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 50px;
    line-height: .95;
    font-weight: 600;
    letter-spacing: .01em
}

.topbar p {
    color: var(--muted);
    margin-top: 8px;
    max-width: 58ch
}

.top-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 14px;
    font-weight: 600;
    transition: .2s ease
}

.btn-primary {
    background: var(--accent);
    color: #fff
}

.btn-primary:hover {
    background: var(--accent-deep)
}

.btn-secondary {
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--ink)
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(211, 106, 141, .24)
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px
}

.stat {
    background: rgba(27, 31, 35, .94);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow-sm)
}

.stat span {
    display: block;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #8c857b
}

.stat strong {
    display: block;
    margin-top: 10px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 40px;
    font-weight: 600
}

.section-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 24px;
    margin-top: 24px
}

.card {
    background: rgba(27, 31, 35, .96);
    border: 1px solid var(--line);
    border-radius: 30px;
    padding: 24px;
    box-shadow: var(--shadow-sm)
}

.card h2,
.card h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 34px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 8px
}

.sub {
    font-size: 14px;
    color: var(--muted)
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px
}

.login-card {
    width: min(100%, 480px);
    background: rgba(27, 31, 35, .97);
    border: 1px solid var(--line);
    border-radius: 32px;
    padding: 34px;
    box-shadow: var(--shadow-md)
}

.login-card h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 46px;
    font-weight: 600;
    line-height: .95;
    margin-bottom: 10px
}

.login-card p {
    color: var(--muted);
    margin-bottom: 22px
}

.help-text {
    font-size: 13px;
    color: var(--muted);
    margin-top: 10px
}

.msg,
.err {
    padding: 14px 16px;
    border-radius: 14px;
    margin-top: 14px;
    font-size: 14px
}

.msg {
    background: rgba(110, 160, 90, .11);
    color: var(--success);
    border: 1px solid rgba(110, 160, 90, .18)
}

.err {
    background: rgba(211, 106, 141, .08);
    color: var(--danger);
    border: 1px solid rgba(211, 106, 141, .18)
}

.student-list,
.list {
    display: grid;
    gap: 12px;
    margin-top: 18px
}

.student-list {
    max-height: 720px;
    overflow: auto;
    padding-right: 4px
}

.student-item,
.item {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px 18px
}

.student-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center
}

.student-item strong,
.item strong {
    display: block;
    font-size: 16px
}

.student-item span,
.item span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #85d7d3;
    font-weight: 700
}

.score-positive {
    background: rgba(110, 160, 90, .14);
    color: #9ed186
}

.score-negative {
    background: rgba(211, 106, 141, .14);
    color: #f095b3
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px
}

.full {
    grid-column: 1/-1
}

.table-wrap {
    overflow: auto;
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel-2)
}

table {
    width: 100%;
    border-collapse: collapse
}

th,
td {
    padding: 15px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line)
}

th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: #8c857b;
    background: #1d2125
}

tbody tr:hover {
    background: #252b30
}

.rank {
    font-weight: 700;
    color: #7fd0cb
}

.center-empty {
    padding: 28px;
    text-align: center;
    color: var(--muted)
}

.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 18px
}

.podium-card {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm)
}

.podium-card .place {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: #8c857b
}

.podium-card strong {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 30px;
    line-height: 1;
    margin-top: 10px
}

.podium-card span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-top: 5px
}

.podium-card.first {
    border-color: rgba(201, 166, 91, .34);
    background: linear-gradient(180deg, #232019, #1e2126)
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px
}

@media (max-width:1100px) {
    .layout {
        grid-template-columns: 1fr
    }
    .sidebar {
        position: static;
        height: auto
    }
    .section-grid,
    .stats {
        grid-template-columns: 1fr
    }
}

@media (max-width:760px) {
    .main {
        padding: 14px
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start
    }
    .topbar h1 {
        font-size: 40px
    }
    .filters,
    .form-grid,
    .podium {
        grid-template-columns: 1fr
    }
    .student-item {
        grid-template-columns: 1fr
    }
    .stat strong {
        font-size: 32px
    }
    .login-card h1 {
        font-size: 38px
    }
}