﻿.h1 {
    font-size: 32px;
    margin: 0 0 12px 0;
}

.tripTitle {
    font-size: 20px;
    margin: 20px 20px 20px 20px;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 25px;
    padding-right: 25px;
    border-radius: 13px;
    background-color: #7c3aed;
    color: #ffffff;
}

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

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

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

@media (max-width: 620px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

:root[data-theme="dark"] .card {
    background: #ffffff;
    border-color: var(--border-med);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .card {
        background: #ffffff;
        border-color: var(--border-med);
    }
}

.card.clickable {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, filter .12s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

    .card.clickable:hover {
        border-color: var(--border-strong);
        filter: brightness(1.01);
    }

    .card.clickable:active {
        transform: translateY(2px) translateX(1px);
        box-shadow: var(--shadow-pressed);
        filter: brightness(.99);
    }

.card-subtitle {
    margin: 6px 0 14px 0;
    color: var(--muted);
    font-size: 16px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--surface-2);
    font-size: 12px;
    color: var(--text);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.form-card {
    max-width: 560px;
    margin: 0 auto;
}

.field label {
    font-weight: 650;
    font-size: 13px;
}

.field input,
.field select,
.field textarea {
    border-radius: 14px;
    border: 1px solid var(--border-med);
    padding: 12px 12px;
    font-size: 14px;
    outline: none;
    background: var(--surface);
    color: var(--text);
}

    .field input:focus,
    .field select:focus,
    .field textarea:focus {
        border-color: var(--focus-border);
        box-shadow: var(--focus-ring);
        background-color: var(--focus-bg, #eef6ff);
    }

/*
    Global focus styling
    Some inputs (e.g., toolbar search boxes / GridView filters) are not wrapped in .field.
    This ensures focus background + ring is consistent site-wide.
*/
:root {
    /* Focus styling (pink, no glow/shadow) */
    --focus-bg: #f5abf7;
    --focus-border: #ec4899;
    --focus-ring: none;
    /* Legacy aliases (if referenced elsewhere) */
    --field-focus-bg: var(--focus-bg);
    --field-focus-border: var(--focus-border);
}

    :root[data-theme="dark"] {
        /* Keep the same pink focus in dark mode, slightly toned down */
        --focus-bg: rgba(236, 72, 153, 0.16);
        --focus-border: #ec4899;
        --focus-ring: none;
    }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --focus-bg: rgba(236, 72, 153, 0.16);
        --focus-border: #ec4899;
        --focus-ring: none;
    }
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
    border-color: var(--focus-border);
    box-shadow: none;
    background-color: var(--focus-bg);
    outline: none;
    box-shadow: none;
}

.notice {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: var(--surface-3);
    color: var(--text);
}

    /* Notices: status variants (use alongside .notice) */
    .notice.notice-info {
        border-color: rgba(14, 165, 233, .28) !important;
        background: rgba(14, 165, 233, .08) !important;
    }

    .notice.notice-success {
        border-color: rgba(16, 185, 129, .28) !important;
        background: rgba(16, 185, 129, .08) !important;
    }

    .notice.notice-warn {
        border-color: rgba(245, 158, 11, .30) !important;
        background: rgba(245, 158, 11, .10) !important;
    }

    /* Medications due: slightly stronger than warn, but still subtle */
    .notice.notice-due {
        border-color: rgba(244, 63, 94, .32) !important;
        background: rgba(244, 63, 94, .10) !important;
    }

        .notice.notice-due strong,
        .notice.notice-due b {
            color: #9f1239;
        }
/* =========================
   LOGIN PAGE (auth) STYLES
   ========================= */

.auth-wrap {
    min-height: calc(100vh - 240px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

:root[data-theme="dark"] .auth-card {
    box-shadow: 0 0 28px rgba(0,0,0,0.55);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .auth-card {
        box-shadow: 0 0 28px rgba(0,0,0,0.55);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 6px;
}

.auth-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(109,94,252,.10);
    border: 1px solid rgba(109,94,252,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 10px auto 12px auto;
}

:root[data-theme="dark"] .auth-icon {
    background: rgba(109,94,252,.12);
    border-color: rgba(167,139,250,.22);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .auth-icon {
        background: rgba(109,94,252,.12);
        border-color: rgba(167,139,250,.22);
    }
}

.auth-actions {
    justify-content: center;
}

.auth-login {
    width: min(320px, 100%);
}

.auth-foot {
    margin-top: 14px;
    font-size: 12px;
    text-align: center;
    color: var(--muted);
    opacity: .9;
}

.btn.primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
}

:root[data-theme="dark"] .btn.primary:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.55);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn.primary:hover {
        box-shadow: 0 12px 30px rgba(0,0,0,0.55);
    }
}

.btn.primary:active {
    filter: brightness(1.02);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}

:root[data-theme="dark"] .btn.primary:active {
    box-shadow: 0 10px 22px rgba(0,0,0,0.50);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn.primary:active {
        box-shadow: 0 10px 22px rgba(0,0,0,0.50);
    }
}
/* =========================
   DASHBOARD / GENERAL LAYOUT
   ========================= */

.page-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

.page-head-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

    /* Hide the lower 'user / role' chips that some pages render in the page header.
   We keep the master top-bar user chip; this only targets the per-page duplicates. */
    .page-head-right .chip {
        display: none;
    }

    .page-head-right:empty {
        display: none;
    }

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

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

.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--surface-2);
    color: var(--text);
    font-size: 13px;
    max-width: 52vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-soft {
    background: var(--surface-3);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 14px;
}

.stat-num {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.tile-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tile {
    display: block;
    text-decoration: none;
    padding: 16px;
    padding-left: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.92));
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-med);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, filter .12s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

:root[data-theme="dark"] .tile {
    background: #ffffff;
    border-color: var(--border-med);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tile {
        background: #ffffff;
        border-color: var(--border-med);
    }
}

.tile:hover {
    border-color: var(--border-strong);
    filter: brightness(1.01);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

:root[data-theme="dark"] .tile:hover {
    box-shadow: 0 18px 44px rgba(0,0,0,0.55);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tile:hover {
        box-shadow: 0 18px 44px rgba(0,0,0,0.55);
    }
}

.tile:active {
    transform: translateY(2px) translateX(1px);
    box-shadow: var(--shadow-pressed);
    filter: brightness(.99);
}

.tile-title {
    display: block;
    font-weight: 800;
    font-size: 16px;
    margin: 0;
    color: var(--text);
}

.tile-sub {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.empty-state {
    display: block; /* stops overlap on asp:Label (span) */
    margin: 12px 0; /* space above/below the message */
    padding: 14px;
    border-radius: 14px;
    background: var(--surface-3);
    border: 1px dashed var(--border-med);
}

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

.list-item {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: var(--surface-2);
}

.list-title {
    font-weight: 750;
    margin: 0 0 4px 0;
}

.btn-primary,
.btn.btn-primary {
    background: var(--grad);
    color: #fff;
    border-color: rgba(255,255,255,.30);
}
/* Keep existing .btn.primary working */
.btn.primary {
    background: var(--grad);
    color: #fff;
    border-color: rgba(255,255,255,.30);
}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 520px) {
    .tile-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
/* Overview date (icon-only picker) */
.overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.overview-datepick {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-hidden {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

:root[data-theme="dark"] .icon-btn {
    box-shadow: 0 12px 26px rgba(0,0,0,0.45);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-btn {
        box-shadow: 0 12px 26px rgba(0,0,0,0.45);
    }
}

.icon-btn:hover {
    filter: brightness(1.03);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

:root[data-theme="dark"] .icon-btn:hover {
    box-shadow: 0 16px 32px rgba(0,0,0,0.55);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-btn:hover {
        box-shadow: 0 16px 32px rgba(0,0,0,0.55);
    }
}

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

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.accent {
    position: relative;
    overflow: hidden;
}

    .accent::before {
        content: "";
        position: absolute;
        left: 0;
        top: 14px;
        bottom: 14px;
        width: 4px;
        border-radius: 999px;
        background: rgba(100,116,139,.55);
    }

.accent-blue::before {
    background: rgba(37, 99, 235, .65);
}

.accent-violet::before {
    background: rgba(124, 58, 237, .65);
}

.accent-green::before {
    background: rgba(22, 163, 74, .65);
}

.accent-amber::before {
    background: rgba(217, 119, 6, .70);
}

.accent-slate::before {
    background: rgba(71, 85, 105, .65);
}

.tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 10px;
    border: 1px solid var(--border-soft);
    background: var(--surface-3);
}
/* Per-accent tints (light) */
.tile.accent-blue .tile-icon {
    background: rgba(219,234,254,.85);
    border-color: rgba(37,99,235,.18);
}

.tile.accent-violet .tile-icon {
    background: rgba(237,233,254,.85);
    border-color: rgba(124,58,237,.18);
}

.tile.accent-green .tile-icon {
    background: rgba(220,252,231,.85);
    border-color: rgba(22,163,74,.18);
}

.tile.accent-amber .tile-icon {
    background: rgba(254,243,199,.88);
    border-color: rgba(217,119,6,.18);
}

.tile.accent-slate .tile-icon {
    background: rgba(226,232,240,.85);
    border-color: rgba(71,85,105,.18);
}
/* Dark-friendly tints */
:root[data-theme="dark"] .tile.accent-blue .tile-icon,
@media (prefers-color-scheme: dark) {
    border-color: rgba(96,165,250,.22);
}

:root[data-theme="dark"] .tile.accent-violet .tile-icon,
@media (prefers-color-scheme: dark) {
    border-color: rgba(167,139,250,.22);
}

:root[data-theme="dark"] .tile.accent-green .tile-icon,
@media (prefers-color-scheme: dark) {
    border-color: rgba(74,222,128,.20);
}

:root[data-theme="dark"] .tile.accent-amber .tile-icon,
@media (prefers-color-scheme: dark) {
    border-color: rgba(251,191,36,.20);
}

:root[data-theme="dark"] .tile.accent-slate .tile-icon,
@media (prefers-color-scheme: dark) {
    border-color: rgba(226,232,240,.18);
}

.stat {
    padding: 12px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-med);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

:root[data-theme="dark"] .stat {
    box-shadow: 0 12px 26px rgba(0,0,0,0.35);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .stat {
        box-shadow: 0 12px 26px rgba(0,0,0,0.35);
    }
}

.stat-ico {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    border: 1px solid var(--border-soft);
    background: var(--surface-3);
    margin-bottom: 8px;
}
/* === Standard textfields (canonical) === */
.field {
    flex-direction: column;
    margin-top: 12px;
    display: grid;
    gap: 6px;
}

.label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 650;
    letter-spacing: .2px;
}

/* Base: white background, dark grey border, rounded corners */
.input,
input[type="text"].input,
input[type="password"].input,
input[type="email"].input,
input[type="number"].input,
input[type="date"].input,
textarea.input,
select.input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #4b5563; /* dark grey border */
    background: #ffffff; /* always white */
    color: #111827; /* dark grey text */
    outline: none;
    box-shadow: none;
    transition: background .15s ease, border-color .15s ease;
}

    .input::placeholder,
    textarea.input::placeholder {
        color: rgba(17, 24, 39, 0.55);
    }

    /* Focus: darkish red border + light pink background */
    .input:focus,
    input[type="text"].input:focus,
    input[type="password"].input:focus,
    input[type="email"].input:focus,
    input[type="number"].input:focus,
    input[type="date"].input:focus,
    textarea.input:focus,
    select.input:focus {
        border-color: #7f1d1d; /* dark red */
        background: rgba(244, 114, 182, 0.18); /* light pink */
    }

    /* Disabled: keep it obvious but clean */
    .input:disabled,
    .input[disabled],
    textarea.input:disabled,
    select.input:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

/* Toggle switch (use for isAdmin / archive etc.) */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    vertical-align: middle;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.18);
    transition: .2s;
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.18);
}

    .slider:before {
        position: absolute;
        content: "";
        height: 20px;
        width: 20px;
        left: 3px;
        top: 2px;
        background: rgba(255,255,255,0.92);
        transition: .2s;
        border-radius: 50%;
        box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    }

.switch input:checked + .slider {
    background: rgba(0, 170, 170, 0.85);
    border-color: rgba(0, 170, 170, 0.35);
}

    .switch input:checked + .slider:before {
        transform: translateX(20px);
    }

.switch input:disabled + .slider {
    opacity: .5;
    cursor: not-allowed;
}
/* Rectangular "table rows" layout (TeacherAdministration / UserManagement) */
.rowtable {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rowtable-head,
.rowtable-row {
    display: grid;
    grid-template-columns: 1.6fr 0.6fr 0.6fr 1.6fr;
    gap: 12px;
    align-items: center;
}

.rowtable-head {
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.rowtable-row {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 10px 26px rgba(0,0,0,0.25);
}

    .rowtable-row:hover {
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.14);
    }

.rowtable .col {
    min-width: 0;
}

.rowtable .col-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.rowtable .col-admin {
    display: flex;
    justify-content: center;
}

@media (max-width: 820px) {
    .rowtable-head {
        display: none;
    }

    .rowtable-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .rowtable .col-admin {
        justify-content: flex-start;
    }

    .rowtable .col-actions {
        justify-content: flex-start;
    }
}
/* Common layouts: ensure consistent gaps in grids/rows */
.card-grid,
.grid,
.tiles,
.dashboard-grid {
    gap: var(--card-gap);
}
/* If you have stacked cards inside a panel/column */
.stack > .card:last-child {
    margin-bottom: 0;
}
/* If you have icon buttons / small buttons */
.btn-small,
.icon-btn {
    border-radius: 9px;
    padding: 8px 10px;
}

.card {
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.92));
    box-shadow: var(--shadow-soft);
    padding: 14px 14px;
    min-height: 92px;
    margin-bottom: var(--card-gap);
}

    button,
    input[type="button"],
    input[type="submit"],
    a.btn,
    .btn,
    .aspNetButton,
    .button,
    .card .btn {
        padding: var(--btn-pad-y) var(--btn-pad-x);
        border-radius: var(--btn-radius);
    }

.btn-finished {
    background: var(--status-finished);
    border-color: var(--status-finished);
    color: #fff;
}

.btn-progress {
    background: var(--status-progress);
    border-color: var(--status-progress);
    color: #fff;
}

.btn-upcoming {
    background: var(--status-upcoming);
    border-color: var(--status-upcoming);
    color: #fff;
}

.text-finished {
    color: var(--status-finished);
}

.text-progress {
    color: var(--status-progress);
}

.text-upcoming {
    color: var(--status-upcoming);
}

.card.status-finished {
    border-left: 6px solid var(--status-finished);
}

.card.status-progress {
    border-left: 6px solid var(--status-progress);
}

.card.status-upcoming {
    border-left: 6px solid var(--status-upcoming);
}
/* =====================================================
   Status chips + notices (DailyMedicationPlan / Trips)
   ===================================================== */
.chip.status-finished {
    border-color: rgba(231, 76, 60, .35);
    background: rgba(231, 76, 60, .14);
    color: var(--status-finished);
}

.chip.status-progress {
    border-color: rgba(46, 204, 113, .35);
    background: rgba(46, 204, 113, .14);
    color: var(--status-progress);
}

.chip.status-upcoming {
    border-color: rgba(255, 95, 162, .35);
    background: rgba(255, 95, 162, .14);
    color: var(--status-upcoming);
}

.empty-state.status-finished {
    border-color: rgba(231, 76, 60, .35);
}

.empty-state.status-progress {
    border-color: rgba(46, 204, 113, .35);
}

.empty-state.status-upcoming {
    border-color: rgba(255, 95, 162, .35);
}
/* =====================================================
   STUDENT LIST + USER MANAGEMENT TIDY (Phase 1)
   ===================================================== */

.small {
    font-size: 15px;
}

.h2 {
    font-size: 18px;
    margin: 0 0 8px 0;
}
/* Buttons: outline + ghost variants used on StudentList */
.btn-outline {
    background: transparent;
    border-color: var(--border-strong);
}

    .btn-outline:hover {
        filter: brightness(1.03);
    }

.btn-ghost {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.10);
}

:root[data-theme="dark"] .btn-ghost {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}
/* Smaller buttons */
.btn-sm {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}
/* StudentList toolbar */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0 14px;
    flex-wrap: wrap;
}

.search-wrap {
    flex: 1 1 360px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-med);
    background: var(--surface);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    min-height: 46px;
}

:root[data-theme="dark"] .search-wrap {
    box-shadow: 0 12px 26px rgba(0,0,0,0.35);
}

.search-wrap i {
    color: var(--muted);
}

.search-input {
    flex: 1 1 auto;
    min-width: 140px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
}

    .search-input::placeholder {
        color: var(--muted);
        opacity: .9;
    }

.view-toggle {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}
/* Student tiles */
.students-tiles .card-grid {
    margin-top: 6px;
}

.student-card {
    min-height: 110px;
    display: flex;
    flex-direction: column;
}


.student-card-top {
    display: flex;
    gap: 12px;
    align-items: center;
}

.student-avatar {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-soft);
    background: var(--surface-3);
}

.student-sub {
    margin-top: 2px;
    font-size: 13px;
}

.student-card-bottom {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
/* Table view */
.table-scroll {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.table-head th {
    text-align: left;
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 10px;
}

.table-row td {
    padding: 12px 10px;
    background: var(--surface-2);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

/* Cleaner tick-table (used on AddMedication schedule) */
.schedule-table {
    border-spacing: 0 8px; /* slightly tighter than default */
}

    .schedule-table .table-head th {
        text-align: center;
        padding: 0 8px;
    }

        .schedule-table .table-head th:first-child {
            text-align: left;
        }

    .schedule-table .table-row td {
        padding: 10px 8px;
    }

    .schedule-table .schedule-tick {
        text-align: center;
        width: 90px;
    }

        .schedule-table .schedule-tick input[type="checkbox"] {
            transform: scale(1.15);
            transform-origin: center;
        }

.table-row td:first-child {
    border-left: 1px solid var(--border-soft);
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.table-row td:last-child {
    border-right: 1px solid var(--border-soft);
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

@media (max-width: 520px) {
    .search-wrap {
        flex-basis: 100%;
    }

    .view-toggle {
        width: 100%;
    }

        .view-toggle .btn {
            flex: 1 1 0;
        }
}
/* Archived badge */
.badge-archived {
    border-color: rgba(148,163,184,.35);
    background: rgba(148,163,184,.14);
    color: var(--muted);
}
/* simple separator line */
.sep {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 14px 0;
}
/* Tablet and below: allow full width */
@media (max-width: 900px) {
    .add-teacher-grid .input {
        max-width: none;
    }
}
/* TeacherAdministration – Add Teacher sizing */
.add-teacher-grid .field {
    max-width: 28rem;
}
/* Inputs still fill their field */
.add-teacher-grid .input {
    max-width: 28rem;
    width: 100%;
}
/* Responsive: full width on smaller screens */
@media (max-width: 900px) {
    .add-teacher-grid .field {
        max-width: none;
    }
}
/* =====================================================
LIGHT THEME OVERRIDES: white panels, grey page, NO shadows
(Value-only visual changes as requested)
===================================================== */

/* Ensure muted text stays readable on light grey backgrounds */
:root {
    --btn-pad-y: 10px;
    --btn-pad-x: 14px;
    --card-gap: 16px;
    --card-pad: 14px;
    --btn-radius: 10px;
    --status-finished: #e74c3c;
    --status-progress: #2ecc71;
    --status-upcoming: #ff5fa2;
    --muted: #556070;
}
/* Make sure text inside panels is always visible */
.card, .tile, .stat, .list-item, .notice, .empty-state, .rowtable-row, .rowtable-head,
.search-wrap, .auth-card, .app-frame {
    color: var(--text);
}
/* Remove remaining light-grey fills (chips/badges/etc.) */
.chip,
.badge,
.tile-icon,
.stat-ico,
.student-avatar,
.rowtable-head {
    background: #ffffff !important;
}
/* =====================================================
SLATE + SKY (Light, subtle, high-contrast)
===================================================== */

/* Page background */
body {
    background-color: var(--bg0);
}
/* Panels: white, bordered, no shadows */
.card,
.tile,
.stat,
.list-item,
.notice,
.empty-state,
.rowtable-row,
.rowtable-head,
.search-wrap,
.icon-btn,
.auth-card,
.app-frame {
    background: #ffffff !important;
    border: 1px solid var(--border-strong) !important;
    box-shadow: none !important;
    color: var(--text);
}
/* Secondary surfaces keep a gentle tint */
.badge,
.chip {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-soft) !important;
    color: var(--text);
}
/* Icons / small surface blocks */
.tile-icon,
.stat-ico,
.student-avatar {
    background: var(--surface-3) !important;
    border: 1px solid var(--border-soft) !important;
}
/* Muted text: readable, not washed out */
.muted,
.card-subtitle,
.tile-sub,
.stat-label,
.auth-foot,
.table-head th,
.search-wrap i,
.search-input::placeholder {
    color: var(--muted) !important;
    opacity: 1;
}
/* Keep login card centred */
.auth-card {
    width: min(520px, 100%);
    box-shadow: 0 0 26px rgba(15, 23, 42, 0.20);
    margin-left: auto;
    margin-right: auto;
}
/* =========================
VIEW STUDENT (layout + key/value rows)
========================= */

.viewstudent-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}
/* Stack on tablets/phones */
@media (max-width: 900px) {
    .viewstudent-grid {
        grid-template-columns: 1fr;
    }
}

.kv-row:last-child {
    border-bottom: none;
}

.kv-val {
    color: var(--text);
    font-weight: 650;
    line-height: 1.25;
}
/* Small screens: stack key above value */
@media (max-width: 520px) {
    .kv-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px 2px;
    }
}

.kv-key {
    font-weight: 800;
    color: var(--muted);
    line-height: 1.2;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
}
/* On very small screens, allow slightly bigger tiles for touch comfort */
@media (max-width:520px) {
    .card-grid.card-grid-3.students-tiles {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
}
/* =========================
DailyMedicationPlan – Students grid (tiles)
Scoped to: <div class="card-grid card-grid-3 students-tiles">
Fixes:
- silhouette watermark centred (50%)
- tick top-right
- name sits above button (no overlap)
- Open button bottom-centre INSIDE tile (smaller)
- border cues for allergy / medication
========================= */

.card-grid.card-grid-3.students-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
    /* Border cues */
    .card-grid.card-grid-3.students-tiles .student-card.has-allergy {
        border: 3px solid rgba(249,115,22,.92) !important;
    }

    .card-grid.card-grid-3.students-tiles .student-card.has-meds {
        border: 2px solid rgba(236,72,153,.45) !important;
    }
    /* If both: keep allergy priority + add a gentle pink inner hint */
    .card-grid.card-grid-3.students-tiles .student-card.has-allergy.has-meds {
        border: 3px solid rgba(249,115,22,.92) !important;
        box-shadow: inset 0 0 0 3px rgba(236,72,153,.12);
    }
    /* (a) Silhouette watermark: truly centred + sized */
    .card-grid.card-grid-3.students-tiles .student-card .student-avatar-icon {
        width: 100%;
        height: 100%;
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        opacity: 0.16;
        z-index: 0;
    }

    .card-grid.card-grid-3.students-tiles .student-card .student-silhouette {
        width: 50%;
        height: 50%;
    }
    /* Ensure content sits above watermark */
    .card-grid.card-grid-3.students-tiles .student-card > *:not(.student-avatar-icon) {
        position: relative;
        z-index: 1;
    }
    /* (b) Tick: top-right */
    .card-grid.card-grid-3.students-tiles .student-card .student-flags {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 2;
        display: flex;
        gap: 6px;
    }

        .card-grid.card-grid-3.students-tiles .student-card .student-flags .sflag {
            width: 22px;
            height: 22px;
            border-radius: 10px;
            font-size: 13px;
        }
    /* (b) Name: centred and placed just above the button */
    .card-grid.card-grid-3.students-tiles .student-card .card-head {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        text-align: center;
        gap: 6px;
        margin: 0;
        padding: 0;
        padding-bottom: 8px;
    }

    .card-grid.card-grid-3.students-tiles .student-card .card-title {
        width: 100%;
        text-align: center;
        font-size: 13px;
        line-height: 1.15;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-shadow: 0 1px 0 rgba(255,255,255,.75), 0 0 10px rgba(59,130,246,.12);
    }

    .card-grid.card-grid-3.students-tiles .student-card .muted.small {
        font-size: 11px;
        line-height: 1.1;
        margin-top: 2px;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        opacity: 0.85;
        text-align: center;
    }
    /* (c) Open button: bottom-centre INSIDE tile (smaller) */
    .card-grid.card-grid-3.students-tiles .student-card .button-box {
        margin-top: auto; /* push to bottom naturally */
        position: static; /* keep in normal flow */
        transform: none;
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .card-grid.card-grid-3.students-tiles .student-card .btn {
        padding: 5px 9px;
        border-radius: 8px;
        font-size: 11px;
        width: 100%;
        max-width: 108px;
    }
/* Touch comfort on very small screens */
@media (max-width: 520px) {
    .card-grid.card-grid-3.students-tiles {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}

.card-grid.card-grid-3.students-tiles .student-card {
    position: relative;
    overflow: hidden;
    /* Removed square sizing to prevent overlap after orientation changes */
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Stable, predictable height */
    min-height: 150px;
}
/* -------------------------------------------------
   DailyMedicationPlan - Students panel refinements
   (Friday Tasks)
-------------------------------------------------- */

.students-titlebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 12px 0 12px;
}

.students-title {
    width: 100%;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(148,163,184,.18);
    border: 1px solid rgba(148,163,184,.35);
    color: var(--text);
}

.students-subtitle {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    padding: 8px 12px;
    color: var(--muted);
}

.students-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.students-view-toggle {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,.28);
    background: rgba(15,23,42,.04);
}

    .students-view-toggle input {
        margin-right: 6px;
    }

.students-toolbar .select {
    min-width: 160px;
}

.btn-students-toggle {
    margin-left: auto;
}

.students-toolbar-divider {
    height: 1px;
    width: 100%;
    background: rgba(148,163,184,.28);
    margin-top: 6px;
}

#studentsBody.is-collapsed {
    display: none;
}

.students-table th:first-child {
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.students-table th:last-child {
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

.students-table tr:nth-child(even) td {
    background: rgba(20,184,166,.08);
}

.students-table td:first-child {
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.students-table td:last-child {
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

.student-table-link {
    text-decoration: none;
    font-weight: 800;
    padding: 8px 12px;
    border-radius: 12px;
    display: inline-block;
    border: 1px solid rgba(148,163,184,.30);
    background: rgba(15,23,42,.03);
}

    .student-table-link:hover {
        background: rgba(14,165,233,.14);
        border-color: rgba(14,165,233,.35);
    }
/* Yes/No pills in table */
.yn-pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
    letter-spacing: .2px;
    color: #0f172a;
    background: rgba(148,163,184,.25);
}

    .yn-pill.no {
        background: rgba(148,163,184,.18);
    }

    .yn-pill.yes {
        background: rgba(244,63,94,.18);
    }

    .yn-pill.yes-warn {
        background: rgba(249,115,22,.20);
    }
/* Cards - chips + corner triangle */
.students-tiles .student-card {
    position: relative;
    overflow: hidden;
}

    .students-tiles .student-card:before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 0;
        height: 0;
        border-top: 34px solid rgba(148,163,184,.55);
        border-right: 34px solid transparent;
    }

    .students-tiles .student-card.has-meds:before {
        border-top-color: rgba(244,63,94,.55);
    }

    .students-tiles .student-card.has-allergy:before {
        border-top-color: rgba(249,115,22,.60);
    }

    .students-tiles .student-card.has-allergy.has-meds:before {
        border-top-color: rgba(139,92,246,.60);
    }

.student-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.student-meta {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 700;
    font-size: 12.5px;
}

.student-chips {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid rgba(148,163,184,.28);
    background: rgba(15,23,42,.03);
    color: var(--text);
}

.chip-mini-meds {
    border-color: rgba(244,63,94,.35);
    background: rgba(244,63,94,.10);
}

.chip-mini-allergy {
    border-color: rgba(249,115,22,.40);
    background: rgba(249,115,22,.12);
}

.chip-mini-ok {
    border-color: rgba(20,184,166,.35);
    background: rgba(20,184,166,.10);
}

.add-students-box {
    display: flex;
    justify-content: center;
    padding: 16px 12px 18px 12px;
}

    .add-students-box .btn {
        min-width: 220px;
    }
/* -------------------------------------------------
   DailyMedicationPlan - Medication tables styling
-------------------------------------------------- */

.med-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.med-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

    .med-table th {
        text-align: left;
        font-size: 13px;
        font-weight: 900;
        padding: 12px 14px;
        background: rgba(99,102,241,.12);
        color: var(--text);
    }

    .med-table td {
        padding: 12px 14px;
        background: rgba(15,23,42,.03);
    }

    .med-table tr:nth-child(even) td {
        background: rgba(15,23,42,.02);
    }

    .med-table td:first-child,
    .med-table th:first-child {
        border-top-left-radius: 14px;
        border-bottom-left-radius: 14px;
    }

    .med-table td:last-child,
    .med-table th:last-child {
        border-top-right-radius: 14px;
        border-bottom-right-radius: 14px;
    }

.med-student-link {
    text-decoration: none;
    font-weight: 900;
    color: var(--text);
    padding: 6px 10px;
    border-radius: 12px;
    display: inline-block;
}

    .med-student-link:hover {
        background: rgba(14,165,233,.12);
    }
/* Status pills + buttons (if not already present) */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
}

.pill-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.pill-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.pill-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.pill-amber {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.pill-purple {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.btn-administer {
    font-weight: 900;
    border-radius: 14px;
    padding: 10px 14px;
}

.administer-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: 1px solid rgba(37,99,235,.35);
    color: #fff;
}

.administer-late {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border: 1px solid rgba(249,115,22,.40);
    color: #fff;
}

.allergy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: rgba(249,115,22,.12);
    border: 1px solid rgba(249,115,22,.25);
    font-size: 14px;
    line-height: 1;
}
/* --- DailyMedicationPlan status enhancements --- */
.status-pill.pill-small {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 900;
}

.pill-late-text {
    color: #b91c1c !important;
}

.btn.late {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border-color: rgba(255,255,255,.30);
}
/* ================================
   AddExistingStudents.aspx (scoped)
   ================================ */

.aes-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 14px;
}

.aes-controls {
    width: 100%;
}

.aes-data {
    width: 100%;
}

.students-table-wrap {
    padding: 16px 18px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
/* ================================
   AdministrationSummary.aspx
   ================================ */

/* Keep the table inside the card, but allow both horizontal + vertical scrolling */
.admin-summary-page .admin-summary-table-wrap {
    width: 100%;
}

.admin-summary-page .table-scroll {
    width: 100%;
    overflow: auto;
    max-height: 68vh;
    border-radius: 18px;
    padding-bottom: 6px;
}
/* Make the table "wider" than the card so horizontal scrolling appears when needed */
.admin-summary-page .admin-summary-table {
    width: max-content;
    min-width: 1300px;
    font-size: 10.5px;
    border-collapse: separate;
    border-spacing: 0 8px;
}
    /* Sticky header so it stays visible when you scroll down */
    .admin-summary-page .admin-summary-table thead th {
        position: sticky;
        z-index: 30;
        /* Use the existing table header tint (opaque enough to avoid "see-through" on scroll) */
        background: rgba(99,102,241,.12);
        box-shadow: 0 2px 10px rgba(0,0,0,0.25);
        backdrop-filter: blur(6px);
    }

    /* Two header rows (titles + filters) need different sticky offsets */
    .admin-summary-page .admin-summary-table thead tr:first-child th {
        top: 0;
    }

    .admin-summary-page .admin-summary-table thead tr.col-filters th {
        top: 44px;
    }

    /* Centre: Date Given, Time Given, Given Period, Notes */
    .admin-summary-page .admin-summary-table th:nth-child(1),
    .admin-summary-page .admin-summary-table td:nth-child(1),
    .admin-summary-page .admin-summary-table th:nth-child(2),
    .admin-summary-page .admin-summary-table td:nth-child(2),
    .admin-summary-page .admin-summary-table th:nth-child(3),
    .admin-summary-page .admin-summary-table td:nth-child(3),
    .admin-summary-page .admin-summary-table th:nth-child(9),
    .admin-summary-page .admin-summary-table td:nth-child(9) {
        text-align: center;
        white-space: nowrap;
    }

    /* Missed rows: pinky-red background across the whole row */
    .admin-summary-page .admin-summary-table tbody tr.row-missed td {
        background: rgba(239, 68, 68, 0.14) !important;
    }

/* Status pills (Administration Summary) — consistent width + smaller height/text */
.admin-summary-page .status-pill {
    min-width: 110px;
    padding: 5px 10px;
    font-size: 11px;
    line-height: 1;
}
/* Status colour rules for this summary */
.status-pill.status-bad {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.status-pill.status-warn {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.status-pill.status-ok {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.status-pill.status-opt {
    background: linear-gradient(135deg, #ec4899, #f472b6);
}
/* Toolbar */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.65);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.segmented {
    display: inline-flex;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.seg-btn {
    border: 0;
    background: transparent;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
}

    .seg-btn.active {
        font-weight: 700;
        background: rgba(79,70,229,0.10);
    }

.student-filter-select {
    padding: 7px 12px;
    font-size: 15px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #fff;
}

    .student-filter-select:focus {
        outline: none;
        border-color: rgba(14,165,233,0.9);
        box-shadow: 0 0 0 2px rgba(14,165,233,0.15);
    }

.table-search {
    padding: 7px 12px;
    font-size: 15px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #fff;
    min-width: 240px;
}

    .table-search:focus {
        outline: none;
        border-color: rgba(14,165,233,0.9);
        box-shadow: 0 0 0 2px rgba(14,165,233,0.15);
    }

@media (max-width: 520px) {
    .table-search {
        min-width: 180px;
        width: 100%;
    }
}

.students-table tbody tr:hover {
    filter: brightness(1.03);
}

.select-cell {
    text-align: center;
}

.funky-checkbox:hover span {
    border-color: rgba(14,165,233,0.6);
}

.funky-checkbox input:checked + span::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    top: 7px;
    left: 5px;
}
/* Cards view */
.student-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 980px) {
    .student-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .student-cards-grid {
        grid-template-columns: 1fr;
    }
}

.student-mini-card {
    background: rgba(255,255,255,0.90);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 16px;
    padding: 14px;
}

.student-mini-name {
    font-weight: 800;
    margin-bottom: 6px;
}

.student-mini-meta {
    color: rgba(71,85,105,1);
    font-size: 13px;
    margin-top: 2px;
}
/* ================================
   AddExistingStudents table polish
   ================================ */

/* Centre the Available Students heading + count */
.aes-card-head {
    justify-content: center;
    text-align: center;
}

.aes-available-head {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.aes-subline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 2px;
    margin-bottom: 10px;
}

    .aes-subline .card-subtitle {
        margin: 0;
    }

.aes-count-chip {
    margin-top: 0;
}
/* Ensure only the custom checkbox is visible (remove native checkbox footprint) */
/* Styled checkboxes (single checkbox only) */
.aes-checkbox,
.aes-rowcb input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.22);
    background: #fff;
    cursor: pointer;
    display: inline-block;
    position: relative;
    vertical-align: middle;
}

    .aes-checkbox:checked,
    .aes-rowcb input[type="checkbox"]:checked {
        background: linear-gradient(135deg,#4f46e5,#0ea5e9);
        border-color: rgba(79,70,229,0.9);
    }

        .aes-checkbox:checked::after,
        .aes-rowcb input[type="checkbox"]:checked::after {
            content: "";
            position: absolute;
            left: 5px;
            top: 2px;
            width: 5px;
            height: 9px;
            border: solid #fff;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

    .aes-checkbox:focus,
    .aes-rowcb input[type="checkbox"]:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(14,165,233,0.18);
    }

.funky-checkbox {
    user-select: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .funky-checkbox input {
        position: absolute;
        opacity: 0;
        width: 1px;
        height: 1px;
        left: -9999px;
    }

    .funky-checkbox span {
        width: 18px;
        height: 18px;
        border-radius: 8px;
        border: 1px solid rgba(0,0,0,0.18);
        background: #fff;
        display: inline-block;
        transition: all .15s ease;
        box-shadow: 0 1px 0 rgba(0,0,0,0.05);
    }

    .funky-checkbox input:checked + span {
        border-color: rgba(79,70,229,0.95);
        background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    }
/* White gap between header and rows, and between each row */
.students-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    background: transparent;
}

    .students-table thead tr {
        background: #fff;
    }

    .students-table thead th {
        text-align: left;
        font-weight: 700;
        padding: 12px 14px;
        white-space: nowrap;
    }

    .students-table tbody td {
        padding: 12px 14px;
        vertical-align: middle;
    }

    .students-table tbody tr {
        background: rgba(255,255,255,0.92);
    }

        .students-table tbody tr:nth-child(even) {
            background: rgba(255,255,255,0.82);
        }

    .students-table tbody td:first-child {
        border-top-left-radius: 12px;
        border-bottom-left-radius: 12px;
    }

    .students-table tbody td:last-child {
        border-top-right-radius: 12px;
        border-bottom-right-radius: 12px;
    }
    /* Centre DOB and Year columns (4th and 5th columns) */
    .students-table th:nth-child(4),
    .students-table td:nth-child(4),
    .students-table th:nth-child(5),
    .students-table td:nth-child(5) {
        text-align: center;
    }
/* Footer link */
.table-footer {
    margin-top: 8px;
    text-align: right;
}

.back-to-top {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.85;
}

    .back-to-top:hover {
        opacity: 1;
        text-decoration: underline;
    }
/* --- AdministerMedication page --- */
.page-head {
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0 14px 0;
}

.card-title {
    font-weight: 800;
    font-size: 16px;
    margin: 0 0 10px 0;
    color: var(--text, #0f172a);
}

.table-lite {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

    .table-lite th {
        text-align: left;
        font-size: 12px;
        letter-spacing: .02em;
        color: var(--muted, #475569);
        padding: 0 10px;
    }

    .table-lite td {
        background: #fff;
        border: 1px solid var(--border-soft);
        padding: 10px 10px;
    }

    .table-lite tr td:first-child {
        border-top-left-radius: 12px;
        border-bottom-left-radius: 12px;
    }

    .table-lite tr td:last-child {
        border-top-right-radius: 12px;
        border-bottom-right-radius: 12px;
    }

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

@media (max-width: 720px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-field .label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--text, #0f172a);
}

.status-banner {
    border-radius: 16px;
    padding: 12px 14px;
    margin: 0 0 12px 0;
    border: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

    .status-banner.success {
        background: rgba(16, 185, 129, .12);
        border-color: rgba(16, 185, 129, .35);
    }

    .status-banner.error {
        background: rgba(239, 68, 68, .10);
        border-color: rgba(239, 68, 68, .35);
    }

.kv-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--border-soft);
    align-items: start;
    margin-top: 10px;
}

.kv-label {
    font-size: 12px;
    color: var(--muted, #475569);
    font-weight: 700;
}

.kv-value {
    font-size: 14px;
    font-weight: 800;
}
/* =====================================================
   AdministerMedication.aspx (page-specific)
   Adds styles for existing markup classes used on this page
   ===================================================== */

.page-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px;
}

.panel {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 16px;
}

.student-name {
    display: inline-block;
    margin-left: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background-color: #7c3aed;
    color: var(--text);
    font-weight: 800;
    font-size: inherit;
}

.student-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: rgba(148,163,184,.12);
    line-height: 1.1;
}

.alert-error {
    border-color: rgba(239,68,68,.35);
    background: rgba(239,68,68,.08);
}

.administered-banner {
    border: 1px solid rgba(34,197,94,.35);
    background: rgba(34,197,94,.10);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 14px 0;
    font-weight: 650;
}
/* Details grid */
.administer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 900px) {
    .administer-grid {
        grid-template-columns: 1fr;
    }
}

.detail-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    background: #fff;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-wide {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* Notes textbox inside detail cards (keeps modern styling) */
.detail-card textarea.admin-notes {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    resize: vertical;
    min-height: 90px;
    margin-top: 8px;
}

    .detail-card textarea.admin-notes:focus {
        outline: none;
        border-color: rgba(99,102,241,.55);
        box-shadow: 0 0 0 3px rgba(99,102,241,.18);
    }

    .detail-card textarea.admin-notes::placeholder {
        color: rgba(100,116,139,.9);
    }

.muted-small {
    color: var(--muted);
    font-weight: 500;
    font-size: 13px;
}


.panel-sub {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 12px;
    background: rgba(148,163,184,.10);
}
/* Form rows */
.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

@media (max-width: 700px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.field-label {
    min-width: 220px;
    font-weight: 650;
    color: var(--text);
}

.field-input,
.form-row select,
.form-row input[type="text"],
.form-row input[type="password"],
.form-row textarea {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
    outline: none;
}

.form-row textarea {
    min-height: 92px;
    resize: vertical;
}


@media (max-width: 700px) {
    .confirm-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.button-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--surface);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    font-weight: 650;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease, opacity .12s ease;
}

.btn-primary {
    background: linear-gradient(90deg, rgba(79,70,229,.92), rgba(14,165,233,.92), rgba(20,184,166,.92));
    color: #fff;
    border-color: rgba(2,6,23,.10);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
}

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

.btn:active {
    transform: translateY(0);
}
/* Bigger confirmation checkbox */
input.confirm-checkbox {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: rgba(14,165,233,.95);
}
/* Disabled buttons */
input.btn:disabled,
button.btn:disabled,
.btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(.15);
}
/* --- AdministerMedication tweaks (pill name + teacher heading + confirm gating) --- */
.administer-title {
    justify-content: flex-start;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

    .administer-title .student-name {
        display: inline-flex;
        align-items: center;
        padding: 4px 10px;
        border-radius: 999px;
        border: 1px solid var(--border-soft);
        background: rgba(255,255,255,0.06);
        box-shadow: var(--shadow-soft);
        font-weight: 800;
    }

.teachers-heading {
    margin-top: 18px;
    margin-bottom: 10px;
    font-weight: 800;
    color: var(--text);
}

.confirm-row {
    margin-top: 12px;
    margin: 10px 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.confirm-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    transform: translateY(1px);
}

.confirm-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    margin: 0;
    cursor: pointer;
}

.centre-col {
    text-align: center;
}
/* AdministerMedication - narrow inputs (teacher fields etc.) */
.input-narrow {
    width: 100%;
    max-width: 320px;
}
/* Optional: keep them full width on small screens */
@media (max-width: 720px) {
    .input-narrow {
        max-width: none;
    }
}
/* =====================================================
   StudentDetails – bring in line with Slate + Sky cards
   ===================================================== */
.student-header {
    padding: 14px;
}

.student-header-head {
    align-items: flex-start;
}

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

.student-header-main .muted {
    margin-top: 4px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.student-header-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}
/* Stack spacing on tablet pages */
.card-stack {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}
/* Key/value grid used on StudentDetails */
.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin-top: 8px;
}

@media (max-width: 820px) {
    .kv-grid {
        grid-template-columns: 1fr;
    }
}

.kv {
    flex-direction: column;
    margin-top: 6px;
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface-2);
}

.kv-k {
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.kv-v {
    color: var(--text);
}
/* Use the newer 'students-table' look even when GridView emits plain th/td */
.students-table th {
    font-weight: 800;
    background: rgba(14,165,233,.16);
    border-bottom: 12px solid #ffffff;
    text-align: left;
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 10px;
}

.students-table td {
    padding: 12px 10px;
    background: rgba(99,102,241,.08);
    border-bottom: 12px solid #ffffff;
}

.students-table tr th {
    white-space: nowrap;
}
/* Student allergies box */
.studentAllergiesBox {
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface-2);
}

.studentAllergiesText {
    margin: 0;
}
/* Notices */
.notice-error {
    border: 1px solid rgba(220, 38, 38, .25);
    background: rgba(220, 38, 38, .08);
    color: #991b1b;
}
/* =====================================================
   AdministerMedication – slightly narrower inputs
   ===================================================== */
.panel-sub .field-input {
    max-width: 420px;
}

@media (max-width: 900px) {
    .panel-sub .field-input {
        max-width: none;
    }
}
/* --- Optional medication pages (AddOptional / AdministerOptional) --- */
.subhead {
    margin-top: .35rem;
    margin-bottom: 1.25rem;
    color: var(--muted, #475569);
    font-size: 0.98rem;
}

.opt-rules {
    margin: 0 0 1rem 0;
    padding: .85rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: rgba(79, 70, 229, 0.04);
}

.opt-rule {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    line-height: 1.35;
}

    .opt-rule + .opt-rule {
        margin-top: .5rem;
    }

.opt-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: .35rem;
    background: rgba(14, 165, 233, .9);
    flex: 0 0 auto;
}

.opt-list {
    margin-top: 0.75rem;
}

.opt-item .opt-check {
    flex: 1 1 auto;
}

    .opt-item .opt-check input[type="checkbox"] {
        transform: scale(1.15);
        margin-right: .65rem;
    }

.opt-badge {
    flex: 0 0 auto;
    font-size: .78rem;
    padding: .28rem .55rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(148, 163, 184, 0.20);
    color: rgba(15, 23, 42, 0.85);
}

.opt-item.is-locked {
    border-color: rgba(234, 179, 8, 0.40);
    background: rgba(234, 179, 8, 0.06);
}

.opt-item.is-disabled {
    opacity: .65;
}
/* --- AddOptional tweaks (Feb 2026) --- */
.opt-page .student-name {
    color: #fff;
}
/* --- AddOptional tweaks (Feb 2026) --- */
.opt-page .h1 .student-name {
    color: #fff !important;
}

.opt-page .button-box {
    justify-content: center;
}
/* Prevent banner/rules/list overlap (some pages use positioned banners) */
.opt-page .administered-banner {
    position: relative !important;
    margin: 12px 0 14px 0 !important;
}

.opt-page .opt-rules {
    margin-top: 12px;
}

.opt-page .opt-list {
    margin-top: 14px;
}
/* Make the whole medication tile clickable */
.opt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem;
    margin: .55rem 0;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    cursor: pointer;
}

    .opt-item.is-disabled,
    .opt-item.is-locked {
        cursor: not-allowed;
    }

    .opt-item.is-selected {
        border-color: rgba(34,197,94,.35);
        background: rgba(34,197,94,.12);
    }

.admin-summary-page .admin-summary-table th,
.admin-summary-page .admin-summary-table td {
    font-size: 10.5px;
    padding: 10px 12px;
}

/* RBAC matrix */
.rbac-scroll {
    overflow: auto;
    max-width: 100%;
}

.rbac-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px; /* “floating row” feel */
}

    .rbac-table thead th {
        text-align: left;
        padding: 10px 12px;
        font-weight: 700;
        border-bottom: 1px solid rgba(15, 23, 42, 0.12);
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
    }

    .rbac-table tbody tr {
        background: #fff;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
        border-radius: 14px;
    }

    .rbac-table tbody td {
        padding: 12px;
    }

.rbac-task-col {
    width: 40%;
}

.rbac-role-col {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.rbac-task-cell {
    font-weight: 600;
    color: #0f172a;
}

.rbac-toggle-cell {
    text-align: center;
}

/* Toggle */
.rbac-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

    .rbac-toggle input {
        opacity: 0;
        width: 0;
        height: 0;
    }

/* slider */
.rbac-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    border-radius: 999px;
    background: #dc2626; /* red off */
    transition: 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

    .rbac-slider:before {
        content: "";
        position: absolute;
        height: 20px;
        width: 20px;
        left: 3px;
        top: 3px;
        border-radius: 999px;
        background: #fff;
        transition: 0.2s ease;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
    }

/* ON = green */
.rbac-toggle input:checked + .rbac-slider {
    background: #16a34a;
}

    /* knob right when ON */
    .rbac-toggle input:checked + .rbac-slider:before {
        transform: translateX(20px);
    }

/* disabled column (Admin) */
.rbac-toggle input:disabled + .rbac-slider {
    background: #94a3b8;
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.14);
}

    /* Optional: dim the knob a touch too */
    .rbac-toggle input:disabled + .rbac-slider:before {
        opacity: 0.9;
    }

.alert {
    display: block;
    border: 1px solid var(--border-soft);
    color: var(--text);
    background: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    margin: 12px 0;
    font-weight: 600;
}

.alert-success {
    background: rgba(22, 163, 74, 0.12);
    border: 1px solid rgba(22, 163, 74, 0.35);
    color: #065f46;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.10);
    border: 1px solid rgba(220, 38, 38, 0.30);
    color: #7f1d1d;
}
/* ViewStudent – scroll-panel tables only: floating rows + white gaps */
.scroll-panel {
    background: #ffffff; /* ensures row gaps are white */
}

    /* Keep table itself transparent so the gap shows the panel white */
    .scroll-panel table {
        font-size: 0.9rem;
        background: transparent;
        border-collapse: separate;
        border-spacing: 0 10px; /* clear white gap between rows */
    }

        /* No borders anywhere */
        .scroll-panel table th,
        .scroll-panel table td {
            border: none;
        }

        /* Header */
        .scroll-panel table thead th {
            background-color: #e2e8f0;
            font-weight: 600;
            padding: 8px 10px;
        }

        /* Body cells get the “row card” background */
        .scroll-panel table tbody td {
            background-color: #f8fafc;
            padding: 8px 10px;
        }

        /* Alternate row */
        .scroll-panel table tbody tr:nth-child(even) td {
            background-color: #eef2f7;
        }

        /* Hover */
        .scroll-panel table tbody tr:hover td {
            background-color: #e0f2fe;
            transition: background-color 0.15s ease;
        }

        /* Optional: rounded row cards */
        .scroll-panel table tbody tr td:first-child {
            border-top-left-radius: 10px;
            border-bottom-left-radius: 10px;
        }

        .scroll-panel table tbody tr td:last-child {
            border-top-right-radius: 10px;
            border-bottom-right-radius: 10px;
        }

.status-pill.status-anytime {
    background: #bd4295;
    color: #fff;
}

.student-banner {
    display: block;
    box-sizing: border-box;
    margin-top: 10px;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 10px;
    background: #7c3aed;
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    padding: 6px 6px;
    letter-spacing: 0.3px;
    text-align: center;
}

.card-head > div {
    flex: 1;
    min-width: 0;
}

/* spacing for this section (replaces the old inline margin-top) */
.optional-med-list {
    margin-top: 14px;
}

/* checkbox + text on one line */
.optional-inline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

/* style the WebForms checkbox input */
.styled-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 8px; /* rounded square */
    border: 2px solid #9ca3af;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

    /* hover */
    .styled-checkbox input[type="checkbox"]:hover {
        border-color: #7c3aed;
    }

    /* checked = green */
    .styled-checkbox input[type="checkbox"]:checked {
        background: #22c55e;
        border-color: #22c55e;
    }

        /* tick mark */
        .styled-checkbox input[type="checkbox"]:checked::after {
            content: "✔";
            color: #ffffff;
            font-size: 16px;
            font-weight: 800;
            position: absolute;
            top: 1px;
            left: 6px;
        }

.schedule-tick {
    text-align: center;
}

    .schedule-tick .styled-checkbox {
        display: inline-block;
    }

/* Page-scoped layout: line up labels + inputs consistently */
.admin-opt .form-stack {
    max-width: 820px;
}

.admin-opt .form-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
}

.admin-opt .form-label {
    margin: 0;
}

.admin-opt .input {
    width: 100%;
}

    .admin-opt .input.input-narrow {
        max-width: 260px;
    }

.admin-opt .confirm-row {
    margin-top: 18px;
}

/* ================================
   AdministerOptional – sticky header (mobile)
   ================================ */

@media (max-width: 720px) {

    .admin-opt .administer-title {
        position: sticky;
        top: 0;
        z-index: 25;
        background: var(--frame);
        padding: 10px 0 8px 0;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--border-soft);
    }

    .admin-opt .subhead {
        position: sticky;
        top: 52px;
        z-index: 24;
        background: var(--frame);
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--border-soft);
    }
}

/* =========================
   DailyMedicationPlan - Students panel (mobile fixes)
   Fixes toggle overflow + keeps controls inside the card
   ========================= */
@media (max-width: 520px) {

    /* Stack toolbar items and make everything full-width */
    .students-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    /* The view toggle must not overflow the card */
    .students-view-toggle {
        width: 100%;
        max-width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 8px;
        box-sizing: border-box;
    }

        /* Whatever the toggle uses (buttons/labels/links), force them to fit */
        .students-view-toggle .btn,
        .students-view-toggle button,
        .students-view-toggle a,
        .students-view-toggle label {
            width: 100%;
            max-width: 100%;
            justify-content: center;
            text-align: center;
            white-space: nowrap;
            box-sizing: border-box;
        }

    /* If your "Hide" button is in the header row, prevent awkward wrapping */
    .students-titlebar {
        gap: 12px;
    }

    /* Ensure select + search also stay inside the card */
    .students-toolbar .select,
    .students-toolbar select,
    .students-toolbar input[type="text"],
    .students-toolbar .search-input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Remove the "push-right" behaviour on mobile */
    .btn-students-toggle {
        margin-left: 0;
        width: 100%;
    }
}

/* =========================
   MOBILE BRAND LAYOUT
   ========================= */

@media (max-width: 520px) {

    .brand {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
    }

    .brand-logo {
        height: 48px;
    }

    .site-name {
        font-size: 20px;
        white-space: normal;
    }

    .site-subtitle {
        font-size: 13px;
        white-space: normal;
    }
}

@media (max-width: 520px) {
    .topbar {
        padding: 16px 14px;
    }
}

/* AddOptional: return-to-student button alignment */
.return-student-box {
    margin-top: 18px;
    justify-content: flex-start;
}

/* ============================================================
   Medication Status Pills – System Standard
   ============================================================ */

.pill {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* 🟣 Scheduled */
.pill-scheduled {
    background-color: #7c3aed;
    color: #ffffff;
}

/* 🟠 Late */
.pill-late {
    background-color: #f59e0b;
    color: #ffffff;
}

/* 🔴 Missed */
.pill-missed {
    background-color: #dc2626;
    color: #ffffff;
}

/* 🟢 Administered */
.pill-administered {
    background-color: #16a34a;
    color: #ffffff;
}


/* ============================================================
   Floating Row Styling – ViewStudent tables
   ============================================================ */

.medication-table {
    border-collapse: separate !important;
    border-spacing: 0 14px;
}

    .medication-table tbody tr {
        background: #ffffff;
        border-radius: 12px;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

        /* Optional subtle hover lift (matches rest of app feel) */
        .medication-table tbody tr:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 18px rgba(0,0,0,0.08);
        }

    .medication-table td {
        padding: 14px 18px;
        vertical-align: middle;
    }

        .medication-table td:first-child {
            border-top-left-radius: 12px;
            border-bottom-left-radius: 12px;
        }

        .medication-table td:last-child {
            border-top-right-radius: 12px;
            border-bottom-right-radius: 12px;
        }


/* SweetAlert2 theme: TripMedicationTabletApp */
.swal2-popup {
    border-radius: 18px !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important; /* slate border */
    background: rgba(15, 23, 42, 0.92) !important; /* slate-900-ish */
    color: #e2e8f0 !important; /* slate-200 */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(8px);
}

.swal2-title {
    color: #f8fafc !important; /* slate-50 */
    font-weight: 800 !important;
    letter-spacing: -0.02em;
}

.swal2-html-container {
    color: #cbd5e1 !important; /* slate-300 */
    line-height: 1.45;
}

.swal2-icon.swal2-warning {
    border-color: rgba(236, 72, 153, 0.45) !important; /* pink */
    color: #ec4899 !important;
}

/* Buttons */
.swal2-actions {
    gap: 10px;
}

.swal2-styled {
    border-radius: 12px !important;
    padding: 10px 14px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

.swal2-confirm {
    background: linear-gradient(90deg, #ec4899, #f472b6) !important; /* pink gradient */
    color: #0b1220 !important;
}

    .swal2-confirm:hover {
        filter: brightness(1.02);
    }

.swal2-cancel {
    background: rgba(148, 163, 184, 0.14) !important; /* slate tint */
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

    .swal2-cancel:hover {
        background: rgba(148, 163, 184, 0.18) !important;
    }

/* Overlay */
.swal2-backdrop-show {
    background: rgba(2, 6, 23, 0.55) !important; /* slate-950 */
}

/* Optional: make it feel more "Fluent" */
.swal2-popup {
    transform: translateY(0);
}

.swal2-icon.swal2-warning .swal2-icon-content {
    font-weight: 900;
}

/* =========================
   MOBILE HEADER LAYOUT
   ========================= */

@media (max-width: 720px) {

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 14px;
    }

    .brand {
        width: 100%;
    }

    .user-area {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

        /* full width logout button for tablet use */
        .user-area .btn {
            width: 100%;
        }

    /* prevent chip truncation */
    .user-chip {
        max-width: 100%;
    }
}

@media (max-width: 520px) {
    .brand-logo {
        height: 46px;
    }
}

/* =========================
   VIEWSTUDENT MOBILE LAYOUT
   ========================= */

@media (max-width: 720px) {

    .viewstudent-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
}

/* =========================
   STUDENT DETAILS MOBILE
   ========================= */

@media (max-width: 720px) {

    .kv-row {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .kv-key {
        font-weight: 600;
        opacity: 0.8;
    }
}

/* =========================
   MOBILE TOUCH TARGETS
   ========================= */

@media (max-width: 720px) {

    .btn,
    button,
    input[type="submit"] {
        min-height: 44px;
        padding: 10px 16px;
    }
}

/* =========================
   STICKY PAGE HEADER
   ========================= */

@media (max-width: 720px) {

    .page-head {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--frame);
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

/* =========================
   ADMINISTER PAGE MOBILE FIX
   ========================= */

@media (max-width: 720px) {

    .form-row {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .form-label {
        font-weight: 600;
    }

    .input {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 720px) {

    .input {
        min-height: 44px;
    }
}

/* =========================
   DASHBOARD: compact stat tiles on mobile
   Icon left, number+text right
   ========================= */
@media (max-width: 520px) {

    /* Each stat tile becomes a 2-col layout */
    .stats .stat {
        display: grid;
        grid-template-columns: 44px 1fr;
        column-gap: 12px;
        align-items: center;
        /* makes it shorter */
        padding: 12px 14px;
    }

    /* Icon sits on the left and spans both lines */
    .stats .stat-ico {
        margin-bottom: 0; /* remove the vertical spacing */
        width: 40px;
        height: 40px;
        border-radius: 14px;
        font-size: 18px;
        grid-row: 1 / span 2; /* spans number + label */
        grid-column: 1;
    }

    /* Number + label sit on the right */
    .stats .stat-num {
        grid-column: 2;
        text-align: left;
        font-size: 26px; /* slightly smaller so it fits nicely */
    }

    .stats .stat-label {
        grid-column: 2;
        text-align: left;
        margin-top: 4px;
    }
}

/* =========================
   DASHBOARD ACTION TILES
   Compact mobile layout
   ========================= */

@media (max-width: 520px) {

    .tile {
        display: grid;
        grid-template-columns: 56px 1fr;
        column-gap: 14px;
        align-items: center;
        padding: 14px 16px;
    }

    .tile-icon {
        grid-row: 1 / span 2;
        grid-column: 1;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tile-title {
        grid-column: 2;
        margin: 0;
        font-size: 18px;
    }

    .tile-sub {
        grid-column: 2;
        margin-top: 2px;
        font-size: 14px;
    }
}

@media (max-width: 520px) {

    .actions-grid {
        gap: 12px;
    }
}

/* =====================================================
   DailyMedicationPlan – Students tiles: landscape stability
   ===================================================== */
@media (max-height: 430px) and (orientation: landscape) {
    .card-grid.card-grid-3.students-tiles {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }

        .card-grid.card-grid-3.students-tiles .student-card {
            min-height: 130px;
        }
}
