:root {
    --color-primary: #1d4ed8;
    --color-primary-dark: #1e3a8a;
    --color-primary-light: #dbeafe;

    --color-success: #166534;
    --color-success-background: #dcfce7;

    --color-danger: #b91c1c;
    --color-danger-background: #fee2e2;

    --color-warning: #92400e;
    --color-warning-background: #fef3c7;

    --color-page: #f4f7fb;
    --color-surface: #ffffff;
    --color-border: #d6deea;
    --color-text: #172033;
    --color-muted: #5d687a;

    --border-radius: 10px;
    --shadow: 0 4px 18px rgb(15 23 42 / 8%);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--color-page);
    color: var(--color-text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.5;
}

main {
    width: min(100% - 2rem, 1100px);
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

header {
    margin-bottom: 1.5rem;
}

h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.2;
}

h1 {
    margin-bottom: 1rem;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
}

h2 {
    margin-bottom: 1rem;
    font-size: clamp(1.3rem, 4vw, 1.75rem);
}

h3 {
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

p {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    font-weight: 600;
    text-underline-offset: 0.15rem;
}

a:hover {
    color: var(--color-primary-dark);
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin: 1rem 0;
}

nav a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    text-decoration: none;
}

nav a:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

section {
    margin: 1.5rem 0;
}

article {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-surface);
}

hr {
    margin: 1.75rem 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

form {
    margin: 1rem 0;
}

form p {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

label {
    font-weight: 700;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    max-width: 520px;
    min-height: 44px;
    padding: 0.7rem 0.8rem;
    border: 1px solid #9aa8bc;
    border-radius: 8px;
    background: #ffffff;
    color: var(--color-text);
    font: inherit;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"],
input[type="hidden"] {
    width: auto;
    min-height: auto;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
    outline: 3px solid rgb(29 78 216 / 25%);
    outline-offset: 2px;
}

button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 8px;
    background: var(--color-primary);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

button:hover {
    background: var(--color-primary-dark);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.errorlist {
    margin: 0.5rem 0;
    padding: 0.75rem 1rem 0.75rem 2rem;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    background: var(--color-danger-background);
    color: var(--color-danger);
}

.helptext {
    display: block;
    margin-top: 0.25rem;
    color: var(--color-muted);
    font-size: 0.9rem;
}

table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    white-space: nowrap;
}

th,
td {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

th {
    background: #eef3f9;
    font-size: 0.9rem;
}

tbody tr:nth-child(even) {
    background: #f8fafc;
}

td form {
    display: inline-block;
    margin: 0.2rem;
}

td button {
    min-height: 38px;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
}

pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 1rem;
    border-radius: 8px;
    background: #111827;
    color: #f8fafc;
}

ul {
    padding-left: 1.5rem;
}

@media (max-width: 640px) {
    body {
        background: var(--color-surface);
    }

    main {
        width: 100%;
        margin: 0;
        padding: 1rem;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    nav {
        align-items: stretch;
        flex-direction: column;
    }

    nav a {
        width: 100%;
    }

    input,
    select,
    textarea,
    button {
        max-width: none;
        width: 100%;
    }

    article form button {
        width: 100%;
    }

    td button {
        width: auto;
    }
}
/* =========================================================
   Authentication and School Access Pages
   ========================================================= */

body.auth-page {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background:
        radial-gradient(
            circle at top left,
            rgba(59, 130, 246, 0.35),
            transparent 38%
        ),
        linear-gradient(
            145deg,
            #0f172a 0%,
            #172554 50%,
            #1e3a8a 100%
        );
}

.auth-page .auth-card {
    width: min(100%, 440px);
    margin: 0;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.35),
        0 4px 12px rgba(15, 23, 42, 0.15);
}

.auth-header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    color: #ffffff;
    background: linear-gradient(
        145deg,
        #2563eb,
        #1d4ed8
    );
    border-radius: 17px;
    box-shadow: 0 10px 22px rgba(29, 78, 216, 0.3);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.auth-eyebrow {
    margin: 0 0 0.45rem;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-header h1 {
    margin: 0;
    color: #172033;
    font-size: clamp(1.8rem, 7vw, 2.2rem);
    line-height: 1.15;
}

.auth-description {
    max-width: 340px;
    margin: 0.75rem auto 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-form {
    margin: 0;
}

.auth-form .form-field {
    margin-bottom: 1.15rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    max-width: none;
    min-height: 52px;
    padding: 0.8rem 0.9rem;
    color: #172033;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 16px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.auth-form input:focus {
    background: #ffffff;
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.auth-submit-button {
    width: 100%;
    min-height: 52px;
    margin-top: 0.35rem;
    padding: 0.8rem 1rem;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );
    border: 0;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.24);
    font-size: 1rem;
    font-weight: 750;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.auth-submit-button:hover {
    background: #1e40af;
    box-shadow: 0 10px 22px rgba(29, 78, 216, 0.3);
}

.auth-submit-button:active {
    transform: translateY(1px);
}

.auth-submit-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.45);
    outline-offset: 3px;
}

.auth-help {
    margin: 1.35rem 0 0;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
}

.form-error-summary,
.field-errors {
    color: #b91c1c;
    font-size: 0.85rem;
}

.form-error-summary {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.field-errors {
    margin-top: 0.4rem;
}

.field-errors ul,
.form-error-summary ul {
    margin: 0;
    padding-left: 1.2rem;
}


/* Keep the authentication card appearance on phones */

@media (max-width: 640px) {
    body.auth-page {
        padding: 1rem;
    }

    .auth-page .auth-card {
        width: 100%;
        margin: 0;
        padding: 1.5rem;
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 18px;
        box-shadow:
            0 20px 45px rgba(15, 23, 42, 0.32),
            0 4px 10px rgba(15, 23, 42, 0.12);
    }

    .auth-header {
        margin-bottom: 1.5rem;
    }

    .auth-mark {
        width: 52px;
        height: 52px;
        border-radius: 15px;
    }
}
.auth-logo {
    display: block;
    width: 90px;
    height: 90px;
    max-width: 100%;
    margin: 0 auto 1rem;
    object-fit: contain;
}
.auth-school-name {
    display: inline-block;
    margin: 0.8rem 0 0;
    padding: 0.45rem 0.75rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.4rem;
}

.auth-links a {
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.auth-links a:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

.auth-links a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 4px;
    border-radius: 4px;
}
.auth-message,
.auth-success-message,
.auth-error-message {
    margin: 0;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-message {
    color: #334155;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

.auth-message p,
.auth-success-message p,
.auth-error-message p {
    margin: 0;
}

.auth-message p + p {
    margin-top: 0.75rem;
}

.auth-success-message {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    text-align: center;
}

.auth-error-message {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.auth-error-message h2 {
    margin: 0 0 0.5rem;
    color: #991b1b;
    font-size: 1.1rem;
}

.success-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin: 0 auto 0.75rem;
    color: #ffffff;
    background: #16a34a;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 800;
}

.auth-primary-link {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
    padding: 0.8rem 1rem;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.24);
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}

.auth-primary-link:hover {
    color: #ffffff;
    background: #1e40af;
}

.password-help {
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
}

.password-help ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

.password-help li + li {
    margin-top: 0.25rem;
}
/* =========================================================
   Teacher Dashboard
   ========================================================= */

.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-header h1 {
    margin-bottom: 1rem;
}

.dashboard-user-information {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    color: #475569;
}

.dashboard-user-information p {
    margin: 0;
}

.dashboard-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.dashboard-navigation a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.dashboard-navigation a:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.dashboard-navigation a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
}

.dashboard-messages {
    margin-bottom: 1rem;
}

.dashboard-message {
    margin: 0 0 0.75rem;
    padding: 0.85rem 1rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}

.dashboard-section {
    padding: 1.75rem 0;
    border-top: 1px solid #d6deea;
}

.dashboard-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-section-heading h2 {
    margin: 0;
}

.section-eyebrow {
    margin: 0 0 0.3rem;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.checkout-count {
    min-width: 48px;
    min-height: 48px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 800;
}

.dashboard-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #d6deea;
    border-radius: 10px;
}

.dashboard-table {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
    padding: 0.8rem;
    border: 1px solid #d6deea;
    text-align: left;
    vertical-align: middle;
}

.dashboard-table th:first-child,
.dashboard-table td:first-child {
    border-left: 0;
}

.dashboard-table th:last-child,
.dashboard-table td:last-child {
    border-right: 0;
}

.dashboard-table thead tr:first-child th {
    border-top: 0;
}

.dashboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-table th {
    color: #334155;
    background: #eff6ff;
    font-size: 0.85rem;
    white-space: nowrap;
}

.dashboard-table td {
    color: #334155;
    background: #ffffff;
}

.dashboard-table a {
    color: #1d4ed8;
    font-weight: 700;
}

.dashboard-empty-state {
    padding: 1rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
}

.dashboard-empty-state p {
    margin: 0;
}

.checkin-form {
    margin: 0;
}

.checkin-button {
    min-height: 42px;
    margin: 0;
    padding: 0.65rem 1rem;
    white-space: nowrap;
}

.dashboard-signout {
    margin-top: 1.5rem;
}

.signout-button {
    color: #b91c1c;
    background: #ffffff;
    border: 1px solid #fecaca;
}

.signout-button:hover {
    color: #ffffff;
    background: #b91c1c;
    border-color: #b91c1c;
}


/* =========================================================
   Mobile Dashboard Cards
   ========================================================= */

@media (max-width: 700px) {
    .dashboard-navigation {
        grid-template-columns: 1fr;
    }

    .dashboard-user-information {
        display: block;
    }

    .dashboard-user-information p + p {
        margin-top: 0.65rem;
    }

    .dashboard-section {
        padding: 1.5rem 0;
    }

    .dashboard-section-heading {
        align-items: flex-start;
    }

    .dashboard-table-wrapper {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .responsive-table tbody {
        display: grid;
        gap: 1rem;
    }

    .responsive-table tbody tr {
        overflow: hidden;
        background: #ffffff;
        border: 1px solid #d6deea;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    }

    .responsive-table tbody tr:last-child td,
    .responsive-table tbody tr td,
    .responsive-table tbody tr td:first-child,
    .responsive-table tbody tr td:last-child {
        display: grid;
        grid-template-columns: minmax(105px, 40%) minmax(0, 60%);
        gap: 0.75rem;
        align-items: start;
        padding: 0.75rem;
        background: #ffffff;
        border: 0;
        border-bottom: 1px solid #e2e8f0;
        overflow-wrap: anywhere;
    }

    .responsive-table tbody tr td:last-child {
        border-bottom: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .responsive-table .checkout-action {
        display: block;
    }

    .responsive-table .checkout-action::before {
        display: none;
    }

    .checkin-form,
    .checkin-button {
        width: 100%;
    }

    .checkin-button {
        min-height: 48px;
    }

    .dashboard-signout,
    .dashboard-signout button {
        width: 100%;
    }
}
/* =========================================================
   Student Scanner
   ========================================================= */

.scanner-header {
    margin-bottom: 1.5rem;
}

.scanner-header h1 {
    margin: 0;
}

.scanner-school {
    display: inline-block;
    margin: 0.75rem 0 0;
    padding: 0.4rem 0.7rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.scanner-description {
    max-width: 600px;
    margin: 0.9rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.scanner-messages {
    margin-bottom: 1rem;
}

.scanner-message {
    margin: 0 0 0.75rem;
    padding: 0.85rem 1rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}

.scanner-search-section {
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #d6deea;
    border-radius: 12px;
}

.scanner-search-form {
    margin: 0;
}

.scanner-search-form p {
    margin: 0 0 1rem;
}

.scanner-search-form label {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.scanner-search-form input:not([type="hidden"]) {
    width: 100%;
    max-width: none;
    min-height: 54px;
    padding: 0.85rem 1rem;
    color: #172033;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 18px;
}

.scanner-search-form input:not([type="hidden"]):focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.scanner-submit-button {
    width: 100%;
    min-height: 52px;
}

.scanner-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.scanner-divider::before,
.scanner-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #d6deea;
}

.scanner-secondary-link {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.scanner-secondary-link:hover {
    color: #ffffff;
    background: #1d4ed8;
}

.student-result {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #d6deea;
}

.student-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.student-result-header h2 {
    margin: 0;
}

.student-result-header h2 a {
    color: #172033;
    text-decoration: none;
}

.student-result-header h2 a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.student-status {
    flex-shrink: 0;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.student-status-in {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.student-status-out {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.student-information,
.checkout-information {
    margin: 0;
}

.student-information {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.student-information div,
.checkout-information div {
    padding: 0.8rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.student-information dt,
.checkout-information dt {
    margin-bottom: 0.25rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.student-information dd,
.checkout-information dd {
    margin: 0;
    color: #172033;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.checkout-status-card,
.checkout-form-card {
    padding: 1.25rem;
    border-radius: 12px;
}

.checkout-status-card {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.checkout-form-card {
    background: #f8fafc;
    border: 1px solid #d6deea;
}

.checkout-status-card h3,
.checkout-form-card h3 {
    margin: 0 0 1rem;
}

.checkout-information {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.student-action-form {
    margin: 0;
}

.student-action-form .form-field {
    margin-bottom: 1rem;
}

.student-action-form label {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.student-action-form select,
.student-action-form textarea,
.student-action-form input:not([type="hidden"]) {
    width: 100%;
    max-width: none;
    min-height: 50px;
    padding: 0.75rem;
    color: #172033;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 16px;
}

.student-action-form textarea {
    min-height: 100px;
    resize: vertical;
}

.student-action-form select:focus,
.student-action-form textarea:focus,
.student-action-form input:not([type="hidden"]):focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.checkout-confirm-button,
.checkin-confirm-button {
    width: 100%;
    min-height: 52px;
    margin-top: 0.25rem;
}

.checkin-confirm-button {
    color: #ffffff;
    background: #16a34a;
    border-color: #16a34a;
}

.checkin-confirm-button:hover {
    background: #15803d;
    border-color: #15803d;
}

.scanner-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #d6deea;
    text-align: center;
}

.scanner-footer a {
    color: #1d4ed8;
    font-weight: 700;
}


/* =========================================================
   Mobile Scanner
   ========================================================= */

@media (max-width: 640px) {
    .scanner-search-section,
    .checkout-status-card,
    .checkout-form-card {
        padding: 1rem;
    }

    .student-result-header {
        display: block;
    }

    .student-status {
        display: inline-block;
        margin-top: 0.75rem;
    }

    .student-information,
    .checkout-information {
        grid-template-columns: 1fr;
    }

    .scanner-footer a {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
/* =========================================================
   Student Search
   ========================================================= */

.student-search-header {
    margin-bottom: 1.5rem;
}

.student-search-header h1 {
    margin: 0;
}

.student-search-school {
    display: inline-block;
    margin: 0.75rem 0 0;
    padding: 0.4rem 0.7rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.student-search-description {
    margin: 0.9rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.student-search-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.student-search-navigation a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.student-search-navigation a:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.student-search-form-section {
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #d6deea;
    border-radius: 12px;
}

.student-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
    margin: 0;
}

.student-search-form .form-field {
    margin: 0;
}

.student-search-form label {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.student-search-form input {
    width: 100%;
    max-width: none;
    min-height: 52px;
    padding: 0.8rem 0.9rem;
    color: #172033;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 16px;
}

.student-search-form input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.student-search-button {
    min-height: 52px;
    margin: 0;
    padding: 0.8rem 1.5rem;
}

.student-search-results {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #d6deea;
}

.student-results-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.student-results-heading h2 {
    margin: 0;
}

.student-result-count {
    min-width: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 13px;
    font-weight: 800;
}

.student-result-grid {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 1rem;
}

.student-result-card {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #d6deea;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.student-result-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.student-initial {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 13px;
    font-size: 0.95rem;
    font-weight: 800;
}

.student-result-name {
    min-width: 0;
}

.student-result-name h3 {
    margin: 0 0 0.3rem;
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.student-result-name h3 a {
    color: #172033;
    text-decoration: none;
}

.student-result-name h3 a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.student-active-label {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    color: #166534;
    background: #dcfce7;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
}

.student-result-information {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 0.65rem;
    margin: 0 0 1rem;
}

.student-result-information div {
    padding: 0.7rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.student-result-information dt {
    margin-bottom: 0.25rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.student-result-information dd {
    margin: 0;
    color: #172033;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.student-select-form {
    margin: auto 0 0;
}

.student-select-button {
    width: 100%;
    min-height: 48px;
    margin: 0;
}

.student-search-empty {
    padding: 1.25rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
}

.student-search-empty h3 {
    margin: 0 0 0.5rem;
    color: #334155;
}

.student-search-empty p {
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}


/* =========================================================
   Mobile Student Search
   ========================================================= */

@media (max-width: 700px) {
    .student-search-navigation,
    .student-search-form,
    .student-result-grid {
        grid-template-columns: 1fr;
    }

    .student-search-form-section {
        padding: 1rem;
    }

    .student-search-button {
        width: 100%;
    }

    .student-result-information {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }
}

@media (max-width: 380px) {
    .student-result-information {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   Student Detail
   ========================================================= */

.student-detail-header {
    margin-bottom: 1.5rem;
}

.student-detail-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-detail-initials {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffffff;
    background: linear-gradient(
        145deg,
        #2563eb,
        #1d4ed8
    );
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.22);
    font-size: 1.15rem;
    font-weight: 800;
}

.student-detail-identity h1 {
    margin: 0;
    overflow-wrap: anywhere;
}

.student-detail-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.record-status {
    display: inline-block;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.record-status-active,
.record-status-in {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.record-status-inactive {
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

.record-status-out {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.student-detail-navigation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.student-detail-navigation a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.student-detail-navigation a:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.student-detail-section {
    padding: 1.5rem 0;
    border-top: 1px solid #d6deea;
}

.student-detail-section-heading {
    margin-bottom: 1rem;
}

.student-detail-section-heading h2 {
    margin: 0;
}

.student-profile-information {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.student-profile-information div,
.current-status-information div {
    padding: 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.student-profile-information dt,
.current-status-information dt {
    margin-bottom: 0.3rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.student-profile-information dd,
.current-status-information dd {
    margin: 0;
    color: #172033;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.current-status-card {
    padding: 1.15rem;
    border-radius: 12px;
}

.current-status-out {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.current-status-in {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.current-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.current-status-header > div {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.status-indicator {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    border-radius: 50%;
}

.status-indicator-out {
    background: #ea580c;
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.15);
}

.status-indicator-in {
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.time-away-badge {
    padding: 0.35rem 0.6rem;
    color: #9a3412;
    background: #ffedd5;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.current-status-information {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.current-status-description {
    margin: 0 0 1rem;
    color: #166534;
}

.student-status-action {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 10px;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}

.student-status-action:hover {
    color: #ffffff;
    background: #1e40af;
}

.student-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.student-summary-card {
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #d6deea;
    border-radius: 11px;
    text-align: center;
}

.student-summary-number {
    display: block;
    color: #1d4ed8;
    font-size: 1.8rem;
    font-weight: 850;
    line-height: 1;
}

.student-summary-label {
    display: block;
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
}

.history-status {
    display: inline-block;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.history-status-complete {
    color: #166534;
    background: #dcfce7;
}

.history-status-active {
    color: #991b1b;
    background: #fee2e2;
}

.student-detail-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.student-detail-pagination p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.pagination-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagination-links a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0.55rem 0.8rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}

.student-detail-empty {
    padding: 1rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
}

.student-detail-empty p {
    margin: 0;
}


/* =========================================================
   Mobile Student Detail
   ========================================================= */

@media (max-width: 700px) {
    .student-detail-navigation,
    .student-profile-information,
    .current-status-information {
        grid-template-columns: 1fr;
    }

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

    .student-detail-pagination {
        display: block;
    }

    .pagination-links {
        margin-top: 0.75rem;
    }

    .pagination-links a {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 430px) {
    .student-detail-identity {
        align-items: flex-start;
    }

    .student-detail-initials {
        width: 54px;
        height: 54px;
        border-radius: 15px;
    }

    .student-summary-grid {
        grid-template-columns: 1fr;
    }

    .current-status-header {
        display: block;
    }

    .time-away-badge {
        display: inline-block;
        margin-top: 0.75rem;
    }
}
/* =========================================================
   Checkout History
   ========================================================= */

.history-header {
    margin-bottom: 1.5rem;
}

.history-header h1 {
    margin: 0;
}

.history-school {
    display: inline-block;
    margin: 0.75rem 0 0;
    padding: 0.4rem 0.7rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.history-description {
    margin: 0.9rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.history-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.history-navigation a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.history-navigation a:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.history-filter-section,
.history-records-section {
    padding: 1.5rem 0;
    border-top: 1px solid #d6deea;
}

.history-section-heading {
    margin-bottom: 1rem;
}

.history-section-heading h2,
.history-records-heading h2 {
    margin: 0;
}

.history-filter-form {
    margin: 0;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #d6deea;
    border-radius: 12px;
}

.history-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.history-filter-form .form-field {
    margin: 0;
}

.history-search-field {
    grid-column: span 2;
}

.history-filter-form label {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
}

.history-filter-form input,
.history-filter-form select {
    width: 100%;
    max-width: none;
    min-height: 50px;
    padding: 0.75rem;
    color: #172033;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 16px;
}

.history-filter-form input:focus,
.history-filter-form select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.history-filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.history-filter-button,
.history-clear-button {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.7rem 1.1rem;
    border-radius: 9px;
    font-weight: 700;
}

.history-clear-button {
    color: #475569;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    text-decoration: none;
}

.history-clear-button:hover {
    color: #1d4ed8;
    border-color: #1d4ed8;
}

.history-records-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.history-record-count {
    min-width: 76px;
    padding: 0.55rem 0.7rem;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 12px;
    text-align: center;
}

.history-record-count span,
.history-record-count small {
    display: block;
}

.history-record-count span {
    font-size: 1.15rem;
    font-weight: 850;
}

.history-record-count small {
    margin-top: 0.1rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.history-pagination p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.history-pagination-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-pagination-links a {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.8rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}

.history-pagination-links a:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.history-empty-state {
    padding: 1.25rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
}

.history-empty-state h3 {
    margin: 0 0 0.5rem;
    color: #334155;
}

.history-empty-state p {
    margin: 0 0 1rem;
}

.history-empty-state a {
    color: #1d4ed8;
    font-weight: 700;
}


/* =========================================================
   Mobile Checkout History
   ========================================================= */

@media (max-width: 800px) {
    .history-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-search-field {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .history-navigation,
    .history-filter-grid {
        grid-template-columns: 1fr;
    }

    .history-search-field {
        grid-column: auto;
    }

    .history-filter-form {
        padding: 1rem;
    }

    .history-filter-actions {
        flex-direction: column;
    }

    .history-filter-button,
    .history-clear-button {
        width: 100%;
    }

    .history-pagination {
        display: block;
    }

    .history-pagination-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 0.75rem;
    }
}
/* =========================================================
   School Management Dashboard
   ========================================================= */

.school-management-header {
    margin-bottom: 1.5rem;
}

.school-management-header h1 {
    margin: 0;
}

.school-management-description {
    margin: 0.75rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.school-management-school {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 0.4rem 0.7rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.management-account-card {
    padding: 1.15rem;
    background: #f8fafc;
    border: 1px solid #d6deea;
    border-radius: 12px;
}

.management-account-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.management-account-initial {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 14px;
    font-weight: 800;
}

.management-account-label {
    margin: 0 0 0.2rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.management-account-heading h2 {
    margin: 0;
    font-size: 1.15rem;
}

.management-account-information {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 0;
}

.management-account-information div {
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.management-account-information dt {
    margin-bottom: 0.25rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.management-account-information dd {
    margin: 0;
    color: #172033;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.management-tools-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #d6deea;
}

.management-section-heading {
    margin-bottom: 1rem;
}

.management-section-heading h2 {
    margin: 0;
}

.management-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.management-tool-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 1rem;
    color: #172033;
    background: #ffffff;
    border: 1px solid #d6deea;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.management-tool-card:hover {
    color: #172033;
    border-color: #2563eb;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.12);
    transform: translateY(-1px);
}

.management-tool-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
}

.management-tool-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 13px;
    font-size: 0.78rem;
    font-weight: 850;
}

.management-tool-content {
    min-width: 0;
}

.management-tool-content strong,
.management-tool-content small {
    display: block;
}

.management-tool-content strong {
    color: #172033;
    font-size: 1rem;
}

.management-tool-content small {
    margin-top: 0.3rem;
    color: #64748b;
    line-height: 1.4;
}

.management-tool-arrow {
    color: #2563eb;
    font-size: 1.3rem;
    font-weight: 800;
}

.school-management-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #d6deea;
    text-align: center;
}

.school-management-footer a {
    color: #1d4ed8;
    font-weight: 700;
}


/* =========================================================
   Mobile School Management
   ========================================================= */

@media (max-width: 700px) {
    .management-tool-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .management-account-information {
        grid-template-columns: 1fr;
    }

    .management-tool-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .management-tool-arrow {
        display: none;
    }

    .school-management-footer a {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
/* =========================================================
   Staff Account Management
   ========================================================= */

.staff-accounts-header {
    margin-bottom: 1.5rem;
}

.staff-accounts-header h1 {
    margin: 0;
}

.staff-accounts-school {
    display: inline-block;
    margin: 0.75rem 0 0;
    padding: 0.4rem 0.7rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.staff-accounts-description {
    margin: 0.9rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.staff-accounts-navigation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.staff-accounts-navigation a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.staff-accounts-navigation a:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.staff-account-messages {
    margin-bottom: 1rem;
}

.staff-account-message {
    margin: 0 0 0.75rem;
    padding: 0.85rem 1rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}

.staff-account-section {
    padding: 1.5rem 0;
    border-top: 1px solid #d6deea;
}

.staff-account-section-heading {
    margin-bottom: 1rem;
}

.staff-account-section-heading h2,
.staff-list-heading h2 {
    margin: 0;
}

.staff-account-section-heading > p:last-child {
    margin: 0.65rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.staff-create-form {
    margin: 0;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #d6deea;
    border-radius: 12px;
}

.staff-create-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.staff-create-form .form-field {
    margin: 0;
}

.staff-create-form label {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
}

.staff-create-form input,
.staff-create-form select {
    width: 100%;
    max-width: none;
    min-height: 50px;
    padding: 0.75rem;
    color: #172033;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 16px;
}

.staff-create-form input:focus,
.staff-create-form select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.staff-create-button {
    width: 100%;
    min-height: 52px;
    margin-top: 1rem;
}

.staff-list-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.staff-count {
    min-width: 80px;
    padding: 0.55rem 0.7rem;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 12px;
    text-align: center;
}

.staff-count span,
.staff-count small {
    display: block;
}

.staff-count span {
    font-size: 1.15rem;
    font-weight: 850;
}

.staff-count small {
    margin-top: 0.1rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.staff-status {
    display: inline-block;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.staff-status-active {
    color: #166534;
    background: #dcfce7;
}

.staff-status-inactive {
    color: #991b1b;
    background: #fee2e2;
}

.staff-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.staff-account-actions form {
    margin: 0;
}

.staff-action-button {
    min-height: 40px;
    margin: 0;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

.staff-deactivate-button {
    color: #b91c1c;
    background: #ffffff;
    border: 1px solid #fecaca;
}

.staff-deactivate-button:hover {
    color: #ffffff;
    background: #b91c1c;
    border-color: #b91c1c;
}

.staff-activate-button {
    color: #166534;
    background: #ffffff;
    border: 1px solid #bbf7d0;
}

.staff-activate-button:hover {
    color: #ffffff;
    background: #16a34a;
    border-color: #16a34a;
}

.staff-password-button {
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #bfdbfe;
}

.staff-password-button:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.protected-account-label {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
}

.staff-empty-state {
    padding: 1.25rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
}

.staff-empty-state h3 {
    margin: 0 0 0.5rem;
    color: #334155;
}

.staff-empty-state p {
    margin: 0;
}


/* =========================================================
   Mobile Staff Accounts
   ========================================================= */

@media (max-width: 760px) {
    .staff-accounts-navigation,
    .staff-create-form-grid {
        grid-template-columns: 1fr;
    }

    .staff-create-form {
        padding: 1rem;
    }

    .responsive-table .staff-actions-cell {
        display: block;
    }

    .responsive-table .staff-actions-cell::before {
        display: block;
        margin-bottom: 0.7rem;
    }

    .staff-account-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .staff-account-actions form,
    .staff-action-button {
        width: 100%;
    }

    .staff-action-button {
        min-height: 48px;
    }
}
/* =========================================================
   Staff CSV Import
   ========================================================= */

.staff-import-header {
    margin-bottom: 1.5rem;
}

.staff-import-header h1 {
    margin: 0;
}

.staff-import-school {
    display: inline-block;
    margin: 0.75rem 0 0;
    padding: 0.4rem 0.7rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.staff-import-description {
    margin: 0.9rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.staff-import-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.staff-import-navigation a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.staff-import-navigation a:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.staff-import-messages {
    margin-bottom: 1rem;
}

.staff-import-message {
    margin: 0 0 0.75rem;
    padding: 0.85rem 1rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}

.staff-import-section {
    padding: 1.5rem 0;
    border-top: 1px solid #d6deea;
}

.staff-import-section-heading {
    margin-bottom: 1rem;
}

.staff-import-section-heading h2 {
    margin: 0;
}

.staff-import-section-heading > p:last-child {
    margin: 0.65rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.csv-format-card {
    margin-bottom: 1rem;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 11px;
}

.csv-format-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.9rem;
    color: #e2e8f0;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    font-size: 0.8rem;
}

.csv-format-heading span {
    padding: 0.2rem 0.45rem;
    color: #bfdbfe;
    background: #1e3a8a;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 800;
}

.csv-format-card pre {
    max-width: 100%;
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    color: #f8fafc;
    background: #0f172a;
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre;
}

.csv-format-card code {
    color: inherit;
    font-family:
        Consolas,
        Monaco,
        "Courier New",
        monospace;
}

.staff-import-notice,
.staff-import-information {
    padding: 1rem;
    border-radius: 10px;
}

.staff-import-notice {
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.staff-import-information {
    margin-top: 0.75rem;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #d6deea;
}

.staff-import-information p {
    margin: 0.45rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.allowed-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.allowed-role-list span {
    padding: 0.35rem 0.55rem;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 7px;
    font-family:
        Consolas,
        Monaco,
        "Courier New",
        monospace;
    font-size: 0.75rem;
    font-weight: 700;
}

.staff-import-error-card {
    padding: 1rem;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
}

.staff-import-error-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.staff-import-error-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffffff;
    background: #dc2626;
    border-radius: 10px;
    font-weight: 850;
}

.staff-import-error-heading h2 {
    margin: 0;
    color: #991b1b;
    font-size: 1.1rem;
}

.staff-import-error-heading p {
    margin: 0.4rem 0 0;
    line-height: 1.5;
}

.staff-import-error-card ul {
    margin: 1rem 0 0;
    padding-left: 1.4rem;
}

.staff-import-error-card li + li {
    margin-top: 0.5rem;
}

.staff-import-form {
    margin: 0;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #d6deea;
    border-radius: 12px;
}

.staff-import-form .form-field {
    margin: 0;
}

.staff-import-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.staff-import-form input[type="file"] {
    width: 100%;
    min-height: 52px;
    padding: 0.65rem;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 0.9rem;
}

.staff-import-form input[type="file"]::file-selector-button {
    min-height: 36px;
    margin-right: 0.75rem;
    padding: 0.45rem 0.7rem;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    font-weight: 700;
    cursor: pointer;
}

.staff-import-file-help {
    margin: 0.65rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
}

.staff-import-button {
    width: 100%;
    min-height: 52px;
    margin-top: 1rem;
}


/* =========================================================
   Mobile Staff Import
   ========================================================= */

@media (max-width: 640px) {
    .staff-import-navigation {
        grid-template-columns: 1fr;
    }

    .staff-import-form {
        padding: 1rem;
    }

    .csv-format-card pre {
        font-size: 0.75rem;
    }

    .staff-import-button {
        line-height: 1.3;
    }
}
/* =========================================================
   Student CSV Import
   ========================================================= */

.student-import-header {
    margin-bottom: 1.5rem;
}

.student-import-header h1 {
    margin: 0;
}

.student-import-school {
    display: inline-block;
    margin: 0.75rem 0 0;
    padding: 0.4rem 0.7rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.student-import-description {
    margin: 0.9rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.student-import-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.student-import-navigation a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.student-import-navigation a:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.student-import-messages {
    margin-bottom: 1rem;
}

.student-import-message {
    margin: 0 0 0.75rem;
    padding: 0.85rem 1rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}

.student-import-section {
    padding: 1.5rem 0;
    border-top: 1px solid #d6deea;
}

.student-import-section-heading {
    margin-bottom: 1rem;
}

.student-import-section-heading h2 {
    margin: 0;
}

.student-import-section-heading > p:last-child {
    margin: 0.65rem 0 0;
    color: #64748b;
    line-height: 1.5;
}

.student-import-information,
.student-import-grade-card,
.student-import-active-notice {
    margin-top: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
}

.student-import-information {
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.student-import-grade-card {
    color: #334155;
    background: #f8fafc;
    border: 1px solid #d6deea;

}

.student-import-active-notice {
    color: #854d0e;
    background: #fefce8;
    border: 1px solid #fde68a;
}

.student-import-information p,
.student-import-grade-card p,
.student-import-active-notice p {
    margin: 0.5rem 0 0;
    line-height: 1.5;
}

.student-grade-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.student-grade-list span {
    min-width: 34px;
    padding: 0.35rem 0.5rem;
    color: #ffffff;
    background: #1d4ed8;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 800;
    text-align: center;
}

.student-import-error-card {
    padding: 1rem;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
}

.student-import-error-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.student-import-error-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffffff;
    background: #dc2626;
    border-radius: 10px;
    font-weight: 850;
}

.student-import-error-heading h2 {
    margin: 0;
    color: #991b1b;
    font-size: 1.1rem;
}

.student-import-error-heading p {
    margin: 0.4rem 0 0;
    line-height: 1.5;
}

.student-import-error-card ul {
    margin: 1rem 0 0;
    padding-left: 1.4rem;
}

.student-import-error-card li + li {
    margin-top: 0.5rem;
}

.student-import-form {
    margin: 0;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #d6deea;
    border-radius: 12px;
}

.student-import-form .form-field {
    margin: 0;
}

.student-import-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.student-import-form input[type="file"] {
    width: 100%;
    min-height: 52px;
    padding: 0.65rem;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 0.9rem;
}

.student-import-form input[type="file"]::file-selector-button {
    min-height: 36px;
    margin-right: 0.75rem;
    padding: 0.45rem 0.7rem;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    font-weight: 700;
    cursor: pointer;
}

.student-import-file-help {
    margin: 0.65rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
}

.student-import-button {
    width: 100%;
    min-height: 52px;
    margin-top: 1rem;
}


/* =========================================================
   Mobile Student Import
   ========================================================= */

@media (max-width: 640px) {
    .student-import-navigation {
        grid-template-columns: 1fr;
    }

    .student-import-form {
        padding: 1rem;
    }

    .student-grade-list {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .student-grade-list span {
        min-width: 0;
        width: 100%;
        padding: 0.35rem 0.2rem;
    }
}
/* =========================================================
   Camera Barcode Scanner
   ========================================================= */

.camera-scanner-section {
    margin-top: 1rem;
}

.camera-scanner-button {
    width: 100%;
    min-height: 52px;
    margin: 0;
    color: #ffffff;
    background: #0f766e;
    border: 1px solid #0f766e;
}

.camera-scanner-button:hover {
    background: #115e59;
    border-color: #115e59;
}

.camera-scanner-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.camera-scanner-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #99f6e4;
    border-radius: 12px;
}

.camera-scanner-panel[hidden] {
    display: none;
}

#camera-reader {
    width: 100%;
    overflow: hidden;
    border: 0 !important;
    border-radius: 10px;
}

#camera-reader video {
    width: 100% !important;
    border-radius: 10px;
}

#camera-reader button {
    min-height: 44px;
    margin: 0.5rem;
}

#camera-reader select {
    min-height: 44px;
    max-width: 100%;
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.camera-scanner-status {
    margin: 0.85rem 0;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.camera-close-button {
    width: 100%;
    min-height: 48px;
    margin: 0;
    color: #b91c1c;
    background: #ffffff;
    border: 1px solid #fecaca;
}

.camera-close-button:hover {
    color: #ffffff;
    background: #b91c1c;
    border-color: #b91c1c;
}