* {
    box-sizing: border-box;
    font-family: "Sarabun", "Tahoma", sans-serif;
}

body {
    margin: 0;
    background: #f4f6f9;
    color: #263238;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: #123c69;
    color: white;
    padding: 24px 18px;
    flex-shrink: 0;
}

.brand h2 {
    margin: 0;
    font-size: 24px;
    color: white;
}

.brand p {
    margin-top: 6px;
    color: #d6e4f0;
    font-size: 14px;
}

.menu {
    margin-top: 30px;
}

.menu a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 15px;
}

.menu a:hover {
    background: #1f5fa8;
}

.menu-title {
    color: #b8d4ee;
    font-size: 13px;
    font-weight: bold;
    margin: 22px 0 8px 12px;
}

.menu a.submenu {
    padding-left: 28px;
    font-size: 15px;
}

.menu a.submenu::before {
    content: "• ";
    color: #d6e4f0;
}

.logout-link {
    background: #dc3545;
    margin-top: 30px;
    font-weight: bold;
}

.logout-link:hover {
    background: #bb2d3b !important;
}

.main-content {
    flex: 1;
    min-height: 100vh;
}

.topbar {
    background: white;
    padding: 22px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
    color: #123c69;
}

.topbar p {
    margin: 6px 0 0;
    color: #666;
}

.user-box {
    text-align: right;
    font-weight: bold;
}

.user-box span {
    color: #666;
    font-size: 14px;
}

/* Page */
.dashboard {
    padding: 30px;
}

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.page-title h2 {
    margin: 0;
    font-size: 26px;
}

.page-title p {
    color: #666;
    margin: 6px 0 0;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 25px;
}

.card,
.panel {
    background: white;
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.card h3 {
    margin: 0;
    color: #555;
    font-size: 17px;
}

.number {
    font-size: 42px;
    font-weight: bold;
    color: #1f5fa8;
    margin-top: 12px;
}

.card p {
    margin-bottom: 0;
    color: #777;
}

.panel {
    margin-top: 28px;
}

/* Quick menu */
.quick-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 18px;
}

.quick-menu a {
    background: #eef4fb;
    color: #123c69;
    padding: 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
}

.quick-menu a:hover {
    background: #1f5fa8;
    color: white;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-grid label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-grid input,
.form-grid select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccd4dd;
    border-radius: 10px;
    font-size: 15px;
}

.form-grid button,
button {
    background: #1f5fa8;
    color: white;
    border: none;
    padding: 13px 22px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
}

.form-grid button {
    margin-top: 24px;
}

.form-grid button:hover,
button:hover {
    background: #123c69;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}

.data-table th {
    background: #123c69;
    color: white;
    padding: 13px;
    text-align: left;
}

.data-table td {
    padding: 13px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.data-table tr:hover {
    background: #f5f9ff;
}

/* Alerts */
.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    padding: 14px 18px;
    border-radius: 10px;
    margin: 20px 0;
}

.alert-error {
    background: #f8d7da;
    color: #842029;
    padding: 14px 18px;
    border-radius: 10px;
    margin: 20px 0;
}

/* Buttons */
.btn-primary-small,
.btn-secondary-small,
.btn-danger-small,
.btn-success-small {
    display: inline-block;
    color: white;
    padding: 7px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.btn-primary-small {
    background: #1f5fa8;
}

.btn-primary-small:hover {
    background: #123c69;
}

.btn-secondary-small {
    background: #6c757d;
}

.btn-secondary-small:hover {
    background: #5c636a;
}

.btn-danger-small {
    background: #dc3545;
}

.btn-danger-small:hover {
    background: #bb2d3b;
}

.btn-success-small {
    background: #198754;
}

.btn-success-small:hover {
    background: #146c43;
}

/* Badges */
.badge-success {
    display: inline-block;
    background: #d1e7dd;
    color: #0f5132;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.badge-warning {
    display: inline-block;
    background: #fff3cd;
    color: #664d03;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

/* Inline edit forms */
.edit-summary {
    cursor: pointer;
    color: #1f5fa8;
    font-weight: bold;
}

.edit-student-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
}

.edit-student-form input,
.edit-student-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccd4dd;
    border-radius: 8px;
    font-size: 14px;
}

.edit-student-form button {
    background: #1f5fa8;
    color: white;
    border: none;
    padding: 9px 13px;
    border-radius: 8px;
    cursor: pointer;
}

.edit-student-form button:hover {
    background: #123c69;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form input,
.inline-form select {
    padding: 9px 10px;
    border: 1px solid #ccd4dd;
    border-radius: 8px;
    font-size: 14px;
}

.inline-form button {
    padding: 9px 13px;
    font-size: 14px;
}

/* Import / code boxes */
.code-box {
    background: #f1f3f5;
    border: 1px solid #d8dee4;
    padding: 16px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 14px;
}

.error-list {
    background: #fff3cd;
    color: #664d03;
    padding: 16px 24px;
    border-radius: 10px;
}

.error-list li {
    margin-bottom: 6px;
}

/* Login page */
body.login-page {
    margin: 0;
    min-height: 100vh;
    background: #eef3f8;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-box {
    background: #ffffff;
    width: 450px;
    max-width: 92%;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.14);
}

.login-header h2 {
    margin: 0;
    color: #123c69;
    font-size: 25px;
    line-height: 1.35;
}

.login-header p {
    color: #666;
    margin-top: 10px;
    margin-bottom: 25px;
}

.login-form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 6px;
    font-weight: bold;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccd4dd;
    border-radius: 10px;
    font-size: 15px;
}

.login-form button {
    width: 100%;
    margin-top: 22px;
    background: #1f5fa8;
    color: white;
    border: none;
    padding: 13px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

.login-form button:hover {
    background: #123c69;
}

/* Responsive */
@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .cards,
    .quick-menu,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        flex-direction: column;
        align-items: flex-start;
    }
}

.alert-info {
    background: #e7f1ff;
    color: #084298;
    padding: 14px 18px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 15px;
}

.pagination {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
}
register
.register-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    margin-top: 20px;
}

.register-choice-card {
    border: 1px solid #d8dee4;
    border-radius: 16px;
    padding: 28px;
    background: #ffffff;
}

.register-choice-card h3 {
    margin-top: 0;
    color: #123c69;
    font-size: 22px;
}

.register-choice-card p {
    color: #666;
    min-height: 48px;
}

.register-choice-button {
    display: inline-block;
    margin-top: 18px;
    background: #1f5fa8;
    color: white;
    padding: 13px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.register-choice-button:hover {
    background: #123c69;
}

.register-choice-button.disabled {
    background: #adb5bd;
    cursor: not-allowed;
}