:root {
    --navy: #154172;
    --gold: #c9b66f;
    --ivory: #f5f3eb;
    --ink: #f5f5f5;
    --muted: #9ca3af;
    --line: rgba(255, 255, 255, 0.12);

    --green: #22c55e;
    --green-bg: #123b27;

    --red: #ef4444;
    --red-bg: #4a171b;

    --blue: #3b82f6;
    --blue-bg: #123a72;

    --dark: #141414;
    --dark-2: #191919;
    --dark-3: #202020;
    --dark-4: #252525;

    --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #141414;
    color: #f5f5f5;

    font-family:
        Poppins,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    min-width: 0;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;

    background:
        radial-gradient(circle at 10% 20%,
            rgba(33, 142, 182, 0.07),
            transparent 30%),
        radial-gradient(circle at 90% 70%,
            rgba(255, 200, 0, 0.045),
            transparent 28%);
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.container {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
}

.page {
    padding: 28px 0 50px;
}

.grid {
    display: grid;
    gap: 18px;
}

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

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

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* =========================================================
   TOP BAR
   ========================================================= */

.topbar {
    background: #171717;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 15px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

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

.brand span {
    display: block;
}

.brand small {
    display: block;
    margin-top: 1px;
    color: #8f8f8f;
    font-size: 0.72rem;
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    border: 1px solid transparent;
    border-radius: 13px;

    padding: 11px 16px;

    font-weight: 800;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        opacity 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--navy);
    color: #fff;
}

.btn-primary:hover {
    background: #1d528d;
}

.btn-gold {
    background: var(--gold);
    color: #171717;
}

.btn-gold:hover {
    background: #d6c47d;
}

.btn-light {
    background: #242424;
    color: #f5f5f5;
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-light:hover {
    background: #2d2d2d;
}

.btn-danger {
    background: #42191d;
    color: #ffb4b9;
    border-color: rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: #551d23;
}

/* =========================================================
   CARDS / SECTIONS
   ========================================================= */

.card {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;

    box-shadow: var(--shadow);
}

.section {
    padding: 22px;
}

.page-title {
    margin: 0;

    color: #f8f8f8;

    font-size: clamp(1.8rem, 4vw, 2.7rem);
    line-height: 1.05;
}

.kicker {
    color: #24a9d5;
    font-size: 0.73rem;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.16em;
}

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

/* =========================================================
   FORMS
   ========================================================= */

.label {
    display: block;

    margin-bottom: 7px;

    color: #aaa;

    font-size: 0.72rem;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.input,
.select {
    width: 100%;

    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;

    background: #222;
    color: #f5f5f5;

    padding: 12px 14px;

    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.input::placeholder {
    color: #89909a;
}

.input:focus,
.select:focus {
    border-color: #229bcc;

    box-shadow:
        0 0 0 3px rgba(34, 155, 204, 0.13);

    background: #252525;
}

.select {
    cursor: pointer;
}

.select option {
    background: #202020;
    color: #fff;
}

/* =========================================================
   STAT CARDS
   ========================================================= */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stat {
    padding: 18px;

    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;

    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.22);
}

.stat .num {
    margin-top: 4px;

    color: #f4f4f4;

    font-size: 1.9rem;
    font-weight: 900;
}

.stat .muted {
    color: #999;
}

/* =========================================================
   CATEGORY CARDS
   ========================================================= */

.category-card {
    padding: 18px;

    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
}

.category-card strong {
    display: block;

    color: #f5f5f5;

    font-size: 1.5rem;
    font-weight: 900;
}

/* =========================================================
   TOOLBAR
   ========================================================= */

.toolbar {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 0.9fr 0.9fr;
    gap: 12px;
}

/* =========================================================
   NOTICES
   ========================================================= */

.notice {
    padding: 12px 14px;

    border-radius: 14px;

    margin: 12px 0;

    font-size: 0.92rem;
    font-weight: 600;
}

.notice.error {
    background: #35171a;
    color: #ffb9be;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.notice.ok {
    background: #12311f;
    color: #a7e8ba;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* =========================================================
   HIDDEN
   ========================================================= */

.hidden {
    display: none !important;
}

/* =========================================================
   SEAT SECTION
   ========================================================= */

.seat-box {
    padding: 20px;

    background: #1a1a1a;
    border-radius: 22px;
}

.seat-header {
    display: flex;
    justify-content: space-between;
    align-items: end;

    gap: 12px;

    flex-wrap: wrap;
}

.seat-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;

    margin: 14px 0;
}

.pill {
    padding: 7px 11px;

    border-radius: 999px;

    background: #212121;
    border: 1px solid rgba(255, 255, 255, 0.1);

    color: #c4c4c4;

    font-size: 0.78rem;
    font-weight: 800;
}

.seat-stat {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: #aaa;

    font-size: 0.84rem;
    font-weight: 700;
}

.seat-dot {
    width: 8px;
    height: 8px;

    display: inline-block;

    border-radius: 50%;
}

.seat-dot.available {
    background: var(--green);
}

.seat-dot.booked {
    background: var(--red);
}

.seat-dot.selected {
    background: var(--blue);
}

/* =========================================================
   SEAT GRID
   ========================================================= */

.seat-grid {
    display: grid;

    grid-template-columns:
        repeat(10, minmax(0, 1fr));

    gap: 8px;

    padding: 12px;

    background: #181818;

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 18px;
}

/* =========================================================
   AVAILABLE SEAT
   ========================================================= */

.seat {
    min-height: 42px;

    padding: 6px 4px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #2ea866;
    border-radius: 10px;

    background: #164a30;

    color: #eafff1 !important;

    font-size: 0.82rem;
    font-weight: 900;

    text-align: center;

    cursor: pointer;

    text-shadow: none !important;

    transition:
        transform 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}

.seat:hover {
    background: #1b5e3d;

    border-color: #43c77b;

    transform: translateY(-1px);
}

.seat:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 1px;
}

/* =========================================================
   BOOKED SEAT
   ========================================================= */

.seat.booked {
    background: #4a1b1e !important;

    border-color: #a93a42 !important;

    color: #ffd7da !important;

    cursor: not-allowed;

    opacity: 1;
}

/* =========================================================
   SELECTED SEAT
   ========================================================= */

.seat.selected {
    background: #215fb8 !important;

    border-color: #5f9ee8 !important;

    color: #ffffff !important;

    box-shadow:
        0 0 0 2px rgba(59, 130, 246, 0.35),
        0 8px 25px rgba(37, 99, 235, 0.2);
}

.seat.selected:hover {
    background: #286bc9 !important;
}

.seat.booked.selected {
    background: #215fb8 !important;
    border-color: #5f9ee8 !important;
    color: #fff !important;
}

/* =========================================================
   TABLES
   ========================================================= */

.table-wrap {
    overflow: auto;

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 16px;

    background: #1b1b1b;
}

.table {
    width: 100%;

    min-width: 850px;

    border-collapse: collapse;
}

.table th,
.table td {
    padding: 11px 12px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.07);

    text-align: left;

    white-space: nowrap;
}

.table th {
    background: #222;

    color: #999;

    font-size: 0.73rem;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.table td {
    color: #ddd;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 0.74rem;
    font-weight: 800;
}

.badge.green {
    background: #123b27;
    color: #9ee7b4;
}

.badge.red {
    background: #42191d;
    color: #ffb4b9;
}

/* =========================================================
   ID CARD
   ========================================================= */

.id-card {
    width: min(430px, 100%);

    overflow: hidden;

    border-radius: 28px;

    background: #fff;

    color: #172033;

    border: 1px solid #d8dee8;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.3);
}

.id-head {
    padding: 18px;

    background:
        linear-gradient(135deg,
            #154172,
            #1d6098);

    color: #fff;
}

.id-head img {
    width: 54px;
}

.id-body {
    padding: 18px;
}

.id-name {
    color: #111827;

    font-size: 1.45rem;
    font-weight: 900;
}

.id-row {
    display: flex;
    justify-content: space-between;

    gap: 12px;

    padding: 10px 0;

    border-bottom: 1px solid #e5e7eb;
}

.id-label {
    color: #94a3b8;

    font-size: 0.72rem;

    text-transform: uppercase;

    letter-spacing: 0.12em;

    font-weight: 800;
}

.id-value {
    color: #172033;

    font-weight: 900;
}

/* =========================================================
   SUCCESS
   ========================================================= */

.success {
    padding: 18px;

    border-radius: 20px;

    background: #102b1d;

    color: #c8f5d6;

    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* =========================================================
   MODAL
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;

    background: rgba(0, 0, 0, 0.72);

    backdrop-filter: blur(5px);
}

.modal-card {
    width: min(660px, 100%);

    max-height: calc(100vh - 36px);

    overflow: auto;

    padding: 22px;

    background: #1c1c1c;

    border: 1px solid rgba(255, 255, 255, 0.11);

    border-radius: 22px;

    box-shadow: var(--shadow);
}

/* =========================================================
   LOADING
   ========================================================= */

.loading {
    padding: 34px;

    text-align: center;

    color: #929292;
}

/* =========================================================
   LOGIN
   ========================================================= */

.login-shell {
    min-height: 100vh;

    display: grid;

    place-items: center;

    padding: 20px;

    background:
        radial-gradient(circle at top left,
            rgba(32, 146, 185, 0.08),
            transparent 30%),
        radial-gradient(circle at bottom right,
            rgba(201, 182, 111, 0.07),
            transparent 30%),
        #141414;
}

.login-card {
    width: min(460px, 100%);

    padding: 28px;

    background: #1c1c1c;

    border: 1px solid rgba(255, 255, 255, 0.11);

    border-radius: 24px;

    box-shadow: var(--shadow);
}

.login-logo {
    display: block;

    width: 78px;

    margin: 0 auto 12px;
}

/* =========================================================
   ACTIONS
   ========================================================= */

.actions {
    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    padding: 26px 0;

    color: #777;

    text-align: center;

    font-size: 0.86rem;
}

/* =========================================================
   REGISTRATION PAGE SPECIFIC
   ========================================================= */

#registrationPanel {
    background: transparent;
}

#successView {
    color: #fff;
}

#successView .card {
    background: #1b1b1b;
}

#myStudents,
#myStudentsSection {
    background: #1a1a1a;
}

#myStudentsList {
    color: #ddd;
}

#myStudentsList table {
    background: #1b1b1b;
    color: #ddd;
}

#myStudentsList th {
    background: #222;
    color: #999;
}

#myStudentsList td {
    border-color: rgba(255, 255, 255, 0.07);
    color: #ddd;
}

/* =========================================================
   ADMIN DASHBOARD
   ========================================================= */

#dashboard {
    background: transparent;
}

#dashboard .page {
    background: transparent;
}

#dashboard .stats .stat,
#dashboard .stat {
    background: #1b1b1b;
    color: #fff;
}

#dashboard .card {
    background: #1a1a1a;
    color: #fff;
}

#dashboard .table-wrap {
    background: #1b1b1b;
}

#dashboard .input,
#dashboard .select {
    background: #222;
    color: #f5f5f5;
}

#dashboard .system-notes,
#dashboard .notes {
    background: #1b1b1b;
    color: #ddd;
}

/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 900px) {

    .grid-4,
    .stats {
        grid-template-columns: 1fr 1fr;
    }

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

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

    .seat-grid {
        grid-template-columns:
            repeat(8, minmax(0, 1fr));
    }
}

/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 640px) {
    .container {
        width: min(100% - 18px, 1180px);
    }

    .nav {
        align-items: flex-start;
    }

    .nav-actions {
        width: 100%;
    }

    .nav-actions .btn {
        flex: 1;
    }

    .grid-4,
    .stats,
    .grid-3,
    .grid-2,
    .toolbar {
        grid-template-columns: 1fr;
    }

    .seat-grid {
        grid-template-columns:
            repeat(5, minmax(0, 1fr));

        gap: 7px;

        padding: 9px;
    }

    .seat {
        min-height: 40px;

        padding: 5px 3px;

        font-size: 0.72rem;
    }

    .page {
        padding-top: 18px;
    }

    .section,
    .seat-box,
    .login-card {
        padding: 17px;
    }

    .table {
        min-width: 780px;
    }

    .modal {
        padding: 10px;
    }

    .modal-card {
        padding: 17px;
        max-height: calc(100vh - 20px);
    }
}