:root {
    --bg-color: #0f172a;
    --card-bg: rgba(15, 23, 42, 0.78);
    --card-border: rgba(148, 163, 184, 0.2);
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5f5;
    --danger: #f87171;
    --success: #4ade80;
    --warning: #facc15;
    --muted: rgba(148, 163, 184, 0.35);
    --radius: 18px;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.55);
    --font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background: radial-gradient(circle at top left, #1e293b 0%, #0f172a 45%, #020617 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
}

header {
    padding: 28px 20px 12px;
}

header .wrapper {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

h1 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 700;
    margin: 0;
}

p.subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 720px;
}

main {
    flex: 1;
    padding: 0 20px 40px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card h2,
.card h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.card h2 {
    font-size: 22px;
}

.card h3 {
    font-size: 18px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.btn {
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #021627;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 40px rgba(14, 165, 233, 0.45);
}

.btn.secondary {
    background: transparent;
    border: 1px solid var(--muted);
    color: var(--text-secondary);
    box-shadow: none;
}

.btn.danger {
    background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
    color: #fff;
    box-shadow: 0 12px 30px rgba(244, 63, 94, 0.3);
}

.range-wrap {
    display: grid;
    gap: 12px;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid rgba(255, 255, 255, 0.9);
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(56, 189, 248, 0.45);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    cursor: pointer;
}

.slider-value {
    font-weight: 600;
    font-size: 16px;
    color: var(--accent);
}

textarea,
input[type="text"],
input[type="password"] {
    width: 100%;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.4;
    resize: vertical;
    min-height: 110px;
}

textarea:focus,
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.list-item .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.badge {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
}

.vote-btn {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.08);
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.vote-btn.active {
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.7);
    transform: translateY(-1px);
}

.vote-btn span {
    font-size: 15px;
}

.status-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.status-pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 13px;
}

.links-area {
    min-height: 120px;
    white-space: pre-wrap;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(15, 23, 42, 0.92);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.5);
    animation: fade-in 0.25s ease;
    z-index: 999;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid {
    display: grid;
    gap: 20px;
}

.grid.two {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid.two-up {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
    .grid.two-up {
        grid-template-columns: repeat(2, minmax(320px, 1fr));
    }
}

#slider-row .card {
    height: 100%;
}
.mini-chart-title h2 {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.heading-count {
    font-size: 16px;
    color: var(--accent);
    font-weight: 600;
}

.meta-line {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.controls.inline {
    display: flex;
    gap: 12px;
}

.controls.inline .btn {
    margin: 0;
}

body.admin.locked header,
body.admin.locked main,
body.admin.locked #toast-container {
    display: none;
}

body.admin.locked .overlay {
    display: flex;
}

.table-like .row.pulse-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.pulse-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pulse-pill-list .status-pill {
    margin: 0;
}

.mini-chart-title + .meta-line {
    margin-top: -6px;
}

.grid.two-up {
    gap: 16px;
}

#suggestion-form {
    margin-top: 10px;
}
.pulse-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pulse-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pulse-option:hover {
    border-color: rgba(56, 189, 248, 0.6);
}

.pulse-option.active {
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 16px 30px rgba(14, 165, 233, 0.3);
    transform: translateY(-1px);
}

.pulse-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.overlay-card {
    width: min(420px, calc(100% - 48px));
    padding: 32px;
    gap: 18px;
}

.overlay-card h2 {
    text-align: center;
}

.overlay-card .subtitle {
    text-align: center;
}

.overlay-card input[type="password"] {
    min-height: 48px;
    font-size: 16px;
    padding: 16px 18px;
}

.overlay-card .controls {
    justify-content: flex-end;
}

.overlay-card .btn {
    min-width: 120px;
}
.overlay.hidden {
    display: none !important;
}
.poll-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.poll-form input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-primary);
    font-size: 15px;
}

.poll-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.poll-question {
    font-weight: 600;
}

.poll-stats {
    display: flex;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 13px;
    flex-wrap: wrap;
}

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

.poll-actions .btn {
    min-width: 110px;
}

.student-poll-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.student-poll-actions .btn {
    min-width: 120px;
}

.student-poll-actions .btn.vote-selected {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.55);
    color: var(--accent);
}

.student-poll-stats {
    color: var(--text-secondary);
    font-size: 13px;
}

.polls-empty,
.student-polls-empty {
    color: var(--text-secondary);
}
