:root {
    --ink: #172033;
    --muted: #667085;
    --line: #dfe5ee;
    --bg: #f5f7fb;
    --card: #fff;
    --blue: #2563eb;
    --blue-soft: #eaf1ff;
    --red: #dc2626;
    --red-soft: #fff0f0;
    --green: #0f766e;
    --shadow: 0 12px 35px rgba(23, 32, 51, .08);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}


/* =========================================================
   BODY
   ========================================================= */

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 Inter, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px max(24px, calc((100vw - 1400px) / 2));
    background: #13213d;
    color: #fff;
}

.topbar h1 {
    margin: 2px 0 0;
    font-size: 26px;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: .16em;
    opacity: .7;
}

.account-box {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: right;
}


/* =========================================================
   CONTAINER
   ========================================================= */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}


/* =========================================================
   COMMON PANELS
   ========================================================= */

.toolbar,
.booking-panel,
.student-panel,
.guide {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
}


/* =========================================================
   TOOLBAR
   ========================================================= */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}


/* =========================================================
   BUTTON
   ========================================================= */

.button {
    border: 0;
    border-radius: 9px;
    padding: 10px 15px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: var(--blue);
    color: #fff;
}

.button.secondary {
    background: #eef2f7;
    color: var(--ink);
}

.button.danger {
    background: var(--red);
    color: #fff;
}


/* =========================================================
   NOTICE
   ========================================================= */

.notice {
    padding: 13px 16px;
    border-radius: 10px;
    background: #fff4d5;
    color: #875d00;
    margin-bottom: 16px;
}


/* =========================================================
   STUDENT
   ========================================================= */

.student-panel {
    margin-bottom: 16px;
}

.student-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.student-grid strong {
    display: block;
    font-size: 18px;
}

.student-basic {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}


/* Không còn gạch dưới ở Tên / Năm sinh / Điện thoại */

.student-basic div {
    display: flex;
    gap: 12px;
    padding: 8px 0;
}

.student-basic strong {
    width: 32%;
}

.student-basic span {
    font-weight: 600;
}


/* =========================================================
   STUDENT TABLE
   ========================================================= */

.student-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.student-table th,
.student-table td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.student-table th {
    width: 32%;
    background: #f8fafc;
    color: var(--ink);
}


/* =========================================================
   TEXT
   ========================================================= */

.muted {
    color: var(--muted);
}


/* =========================================================
   BOOKING TARGET
   ========================================================= */

.booking-target {
    background: var(--blue-soft);
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    padding: 12px;
    margin-bottom: 16px;
}


/* =========================================================
   CALENDAR
   ========================================================= */

.calendar {
    display: grid;
    grid-template-columns: repeat(
        7,
        minmax(150px, 1fr)
    );
    gap: 12px;
    align-items: start;
}

.day-column {
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.day-header {
    padding: 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.day-header strong {
    display: block;
}

.day-header small {
    color: var(--muted);
}

.day-header.past {
    opacity: .65;
}

.day-body {
    padding: 10px;
}


/* =========================================================
   SLOT
   ========================================================= */

.slot {
    position: relative;
    min-height: 76px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 9px;
    cursor: pointer;
    background: #fff;
    transition: .15s;
}

.slot:last-child {
    margin-bottom: 0;
}

.slot:hover {
    border-color: var(--blue);
    background: #f9fbff;
}

.slot .slot-title {
    font-weight: 800;
    font-size: 13px;
}

.slot .slot-time {
    font-size: 12px;
    color: var(--muted);
}

.slot.empty {
    min-height: 58px;
}

.slot.occupied {
    border-style: solid;
    cursor: pointer;
}

.slot.locked {
    background: var(--red-soft);
    border-color: #fecaca;
    color: var(--red);
}

.slot.mine {
    background: var(--blue-soft);
    border-color: #a9c4ff;
    color: #1647a2;
}

.slot.selected {
    outline: 3px solid #93c5fd;
    background: #eff6ff;
}

.slot.dat {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff8e6;
    border-color: #f2c66d;
}


/* =========================================================
   ADMIN SLOT
   ========================================================= */

.slot-admin {
    position: absolute;
    right: 7px;
    top: 7px;
    display: flex;
    gap: 4px;
}

.icon-button {
    border: 0;
    border-radius: 6px;
    padding: 3px 6px;
    cursor: pointer;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 4px #0002;
}


/* =========================================================
   BOOKING PANEL
   ========================================================= */

.booking-panel {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.booking-panel h2,
.guide h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* =========================================================
   SELECTION
   ========================================================= */

.selection-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef4ff;
    border-radius: 8px;
    padding: 7px 10px;
    margin: 5px 6px 0 0;
}

.selection-item button {
    border: 0;
    background: none;
    cursor: pointer;
}


/* =========================================================
   CHOICE
   ========================================================= */

.choice-grid {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(260px, 1fr)
    );
    gap: 8px;
}

.choice-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.choice-item select {
    margin-left: auto;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 6px;
}


/* =========================================================
   GUIDE
   ========================================================= */

.guide {
    margin-top: 16px;
    color: var(--muted);
}

.guide p {
    margin: 5px 0;
}


/* =========================================================
   MODAL
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .58);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 10;
}

.modal[hidden] {
    display: none;
}

.modal-card {
    position: relative;
    width: min(100%, 500px);
    background: #fff;
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 25px 70px #0004;
}

.modal-close {
    position: absolute;
    right: 14px;
    top: 10px;
    border: 0;
    background: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--muted);
}

.modal-card h2 {
    margin: 0 0 18px;
}

.modal-card form {
    display: grid;
    gap: 14px;
}

.modal-card label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.modal-card input,
.modal-card select {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
}


/* =========================================================
   FORM / CONFIRM
   ========================================================= */

.form-error {
    white-space: pre-line;
    color: var(--red);
    min-height: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.confirm-row {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.modal-message {
    white-space: pre-line;
    margin-bottom: 18px;
}


/* =========================================================
   RESPONSIVE - TABLET
   ========================================================= */

@media (max-width: 1050px) {

    .calendar {
        overflow-x: auto;
        grid-template-columns: repeat(7, 190px);
        padding-bottom: 8px;
    }

    .toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   RESPONSIVE - MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .topbar {
        padding: 18px;
        align-items: flex-start;
        flex-direction: column;
    }

    .container {
        padding: 14px;
    }

    .account-box {
        text-align: left;
    }

    .toolbar {
        padding: 12px;
    }

    .toolbar .button {
        padding: 8px 9px;
        font-size: 12px;
    }

    .booking-panel {
        flex-direction: column;
    }

    .panel-actions {
        justify-content: flex-end;
    }
}