:root {
    --primary: #8bc64b;
    --primary-soft: rgba(139, 198, 75, 0.12);
    --accent: #f69918;
    --accent-soft: rgba(246, 153, 24, 0.12);
    --card-header-bg: linear-gradient(135deg, rgba(139, 198, 75, 0.08), rgba(246, 153, 24, 0.03));
    --card-header-accent: rgba(139, 198, 75, 0.18);
    --bg: #f5f7fb;
    --bg-elevated: rgba(255, 255, 255, 0.88);
    --surface: #ffffff;
    --surface-2: #f9fafc;
    --text: #111827;
    --muted: #6b7280;
    --select-arrow-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --border: rgba(17, 24, 39, 0.08);
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --radius: 22px;
}

html {
    font-size: 70%;
}

html[data-theme="dark"] {
    --bg: #0b1020;
    --bg-elevated: rgba(16, 23, 42, 0.82);
    --surface: #111827;
    --surface-2: #0f172a;
    --text: #f8fafc;
    --muted: #94a3b8;
    --card-header-bg: linear-gradient(135deg, rgba(139, 198, 75, 0.10), rgba(246, 153, 24, 0.06));
    --card-header-accent: rgba(246, 153, 24, 0.22);
    --select-arrow-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --border: rgba(148, 163, 184, 0.16);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body,
button,
input,
select,
textarea {
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: inherit;
}

input[type="file"]::file-selector-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    margin-right: 12px;
    border-radius: 999px;
    border: 1px solid var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, #6fa83d 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(139, 198, 75, 0.3);
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

input[type="file"]::file-selector-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary) 0%, #5a9432 100%);
    box-shadow: 0 6px 20px rgba(139, 198, 75, 0.4);
}

input[type="file"]::-webkit-file-upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    margin-right: 12px;
    border-radius: 999px;
    border: 1px solid var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, #6fa83d 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(139, 198, 75, 0.3);
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary) 0%, #5a9432 100%);
    box-shadow: 0 6px 20px rgba(139, 198, 75, 0.4);
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(139, 198, 75, 0.08), transparent 30%),
        radial-gradient(circle at top right, rgba(246, 153, 24, 0.06), transparent 25%),
        var(--bg);
    color: var(--text);
    transition: background-color 180ms ease, color 180ms ease;
}

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

button,
[type="button"],
[type="submit"],
[type="reset"],
a[href],
label[for],
select,
summary,
[role="button"],
[role="tab"],
.btn-edit,
.btn-pill,
.pill-tab,
.nav-link,
.school-profile-logo-dropzone,
.school-profile-logo-dropzone-trigger,
[data-image-browse],
[data-image-webcam],
[data-sibling-remove] {
    cursor: pointer;
}

.login-logo-img {
    height: 90px;
}

.material-icons {
    font-family: "Material Icons";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

.sidebar-overlay {
    display: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(139, 198, 75, 0.14), rgba(246, 153, 24, 0.04));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.sidebar .brand {
    justify-content: center;
}

.brand-mark {
    width: clamp(72px, 14vw, 112px);
    height: clamp(40px, 7vw, 58px);
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.brand h1 {
    font-size: 1.02rem;
    line-height: 1.15;
    margin: 0;
}

.brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.nav-group {
    margin-top: 24px;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin: 0 0 10px 8px;
}

.nav-list {
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    color: var(--text);
    border: 1px solid transparent;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.nav-link:not(.active):hover {
    transform: translateX(3px);
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(139, 198, 75, 0.2) 0%, rgba(111, 168, 61, 0.1) 100%);
    border-color: rgba(139, 198, 75, 0.3);
}

.nav-link .material-icons {
    font-size: 20px;
    color: var(--primary);
}

.main {
    padding: 22px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-middle,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-middle {
    margin-left: auto;
    justify-content: center;
}

.chip,
.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.btn-pill {
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6fa83d 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(139, 198, 75, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary) 0%, #5a9432 100%);
    box-shadow: 0 6px 20px rgba(139, 198, 75, 0.4);
}

.btn-primary:active {
    background: linear-gradient(135deg, #5a9432 0%, var(--primary) 100%);
}

.btn-secondary {
    background: var(--surface);
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.btn-edit .material-icons {
    font-size: 20px;
}

.btn-edit:hover {
    color: var(--primary);
}

.btn-edit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22);
}

.row-action-menu {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
}

.row-action-menu summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.row-action-menu summary::-webkit-details-marker {
    display: none;
}

.table-action-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    vertical-align: middle;
}

.row-action-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    padding: 6px;
    z-index: 30;
}

.row-action-dropdown a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

.row-action-dropdown a:hover {
    background: rgba(139, 198, 75, 0.12);
    color: var(--primary);
}

.student-contact-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
}

.student-contact-name {
    flex: 1 1 auto;
    min-width: 0;
    max-width: clamp(100px, 14vw, 210px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.student-contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #0f766e;
    transition: transform 160ms ease, color 160ms ease, opacity 160ms ease;
    line-height: 1;
    flex-shrink: 0;
    vertical-align: middle;
}

.student-contact-link:hover {
    transform: translateY(-1px);
    opacity: 0.8;
}

.student-contact-link-whatsapp {
    color: #15803d;
}

.student-contact-link .material-icons,
.student-contact-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-submit,
.form-actions .btn-pill {
    width: 25%;
    min-width: 25%;
    margin-left: auto;
    display: inline-flex;
    justify-content: center;
    text-align: center;
}

.nav-toggle {
    display: none;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
}

.btn-back .material-icons,
.btn-export .material-icons,
.btn-icon .material-icons {
    font-size: 20px;
}

.btn-export {
    min-width: 44px;
    padding: 0 10px;
    justify-content: center;
}

.theme-switch .material-icons {
    transition: transform 220ms ease, opacity 220ms ease;
}

.theme-switch.is-switching .material-icons {
    transform: rotate(180deg) scale(0.82);
    opacity: 0.55;
}

.form-actions {
    display: flex;
    width: 100%;
    justify-content: flex-end;
}

.content-grid {
    display: grid;
    gap: 18px;
    margin-top: 22px;
    flex: 1 1 auto;
}

.app-footer {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--muted);
    text-align: center;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
}

.app-footer strong {
    color: var(--text);
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.card-header,
.card-body {
    padding: 20px;
}

.card-header {
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--card-header-bg);
}

.card-header {
    flex-wrap: nowrap;
}

.card-header>*:not(strong):not(.topbar-right) {
    margin-left: auto;
    flex-shrink: 0;
}

.card-header>.topbar-right {
    margin-left: auto;
    flex-shrink: 0;
}

.card-header strong {
    font-size: small;
    text-transform: uppercase;
    flex: 0 1 auto;
    min-width: 0;
}

.card-header .btn-pill,
.card-header .btn-icon,
.card-header a,
.card-header .topbar-right,
.card-header .topbar-right {
    flex-shrink: 0;
}

.card-header .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.card-header .btn-icon,
.card-header .student-filter-export,
.card-header .btn-export {
    flex-shrink: 0;
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
}

.card-body {
    min-width: 0;
}

.card-body>form:not(.student-filters):not(.no-form-grid) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    align-content: start;
}

.card-body>form:not(.student-filters):not(.no-form-grid)>.form-actions,
.card-body>form:not(.student-filters):not(.no-form-grid)>.card,
.card-body>form:not(.student-filters):not(.no-form-grid)>.content-grid,
.card-body>form:not(.student-filters):not(.no-form-grid)>.table-wrap,
.card-body>form:not(.student-filters):not(.no-form-grid)>.dt-table-wrap,
.card-body>form:not(.student-filters):not(.no-form-grid)>.page-grid,
.card-body>form:not(.student-filters):not(.no-form-grid)>.pill-tabs {
    grid-column: 1 / -1;
}

.card-body>form:not(.student-filters):not(.no-form-grid)>input[type="hidden"] {
    display: none;
}

.card-body>form:not(.student-filters):not(.no-form-grid) .field {
    min-width: 0;
    margin-bottom: 0;
}

.card-body>form:not(.student-filters):not(.no-form-grid) .fee-remarks-field {
    grid-column: 2 / -1;
}

.student-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.student-field-grid .field {
    margin-bottom: 0;
    min-width: 0;
}

.student-field-grid .field-full {
    grid-column: 1 / -1;
}

.student-field-grid .field:has(textarea),
.student-field-grid .field:has(select[multiple]) {
    grid-column: 1 / -1;
}

.sibling-picker {
    display: grid;
    gap: 14px;
}

.sibling-picker-search {
    position: relative;
}

.sibling-picker-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 35;
    max-height: 280px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg-elevated);
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(18px);
}

.sibling-picker-result,
.sibling-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.sibling-picker-result + .sibling-picker-result,
.sibling-pill + .sibling-pill {
    margin-top: 10px;
}

.sibling-picker-copy,
.sibling-pill-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.sibling-picker-copy strong,
.sibling-pill-copy strong {
    font-size: 0.96rem;
}

.sibling-picker-copy span,
.sibling-pill-copy span {
    color: var(--muted);
    font-size: 0.88rem;
    word-break: break-word;
}

.sibling-picker-selection {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    border: 1px dashed rgba(139, 198, 75, 0.35);
    background: rgba(139, 198, 75, 0.05);
}

.sibling-picker-empty,
.sibling-picker-message {
    margin: 0;
    color: var(--muted);
}

.sibling-pill-remove,
.sibling-picker-add {
    min-width: 90px;
    justify-content: center;
}

.inventory-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: start;
}

.inventory-form {
    display: grid;
    gap: 12px;
    align-items: start;
}

.inventory-form-grid .field {
    margin-bottom: 0;
    min-width: 0;
}

.inventory-form>.form-actions {
    margin-top: 2px;
}

.inventory-form-grid .inventory-remarks,
.inventory-item-grid .field[style*="grid-column: 1 / -1"] {
    grid-column: 1 / -1;
}

.inventory-item-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.inventory-item-grid .field {
    margin-bottom: 0;
    min-width: 0;
}

.fee-mode-row-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(180px, 0.7fr) auto;
    gap: 16px;
    align-items: end;
}

.fee-mode-row-grid .field {
    margin-bottom: 0;
    min-width: 0;
}

.fee-mode-row-action {
    display: flex;
    justify-content: flex-end;
}

.school-profile-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.school-profile-form .school-profile-address {
    grid-column: span 2;
}

.school-profile-form .school-profile-address textarea {
    min-height: 112px;
}

.school-profile-logo-field {
    grid-column: span 2;
}

.school-profile-logo-field-full {
    grid-column: 1 / -1;
}

.school-profile-logo-uploader {
    display: grid;
    gap: 16px;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at top right, rgba(246, 153, 24, 0.08), transparent 28%),
        linear-gradient(135deg, rgba(139, 198, 75, 0.10), rgba(255, 255, 255, 0.02)),
        var(--surface);
}

.school-profile-logo-stage {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.school-profile-logo-preview {
    width: 120px;
    height: 120px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.school-profile-logo-preview-large {
    width: min(100%, 420px);
    max-width: 100%;
    height: 180px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(139, 198, 75, 0.08), rgba(246, 153, 24, 0.08)),
        var(--surface-2);
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
}

.school-profile-logo-preview img,
.school-profile-logo-preview-large img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 145px;
    display: block;
    object-fit: contain;
    object-position: center;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .school-profile-logo-preview-large {
        width: 100%;
        height: 160px;
        padding: 16px;
    }

    .school-profile-logo-preview {
        width: 140px;
        height: 175px;
    }
}

@media (max-width: 640px) {
    .school-profile-logo-preview-large {
        height: 140px;
        padding: 14px;
    }

    .school-profile-logo-preview {
        width: 140px;
        height: 96px;
    }
}

.school-profile-logo-copy strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.school-profile-logo-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.school-profile-logo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.school-profile-logo-dropzone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px dashed rgba(139, 198, 75, 0.45);
    background: rgba(139, 198, 75, 0.07);
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.school-profile-logo-dropzone:hover {
    border-color: rgba(139, 198, 75, 0.7);
    background: rgba(139, 198, 75, 0.11);
    transform: translateY(-1px);
}

.school-profile-logo-dropzone-trigger {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
    cursor: pointer;
}

.school-profile-logo-dropzone-trigger > .material-icons {
    color: var(--primary);
    font-size: 24px;
    flex-shrink: 0;
}

.school-profile-logo-dropzone-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
    flex: 1 1 auto;
}

.school-profile-logo-dropzone-copy strong {
    font-size: 0.95rem;
}

.school-profile-logo-dropzone-copy small {
    color: var(--muted);
    white-space: normal;
    word-break: break-word;
}

.school-profile-logo-dropzone-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.school-profile-logo-dropzone-actions .btn-pill {
    min-width: 110px;
    justify-content: center;
}

.camera-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
}

.camera-modal.is-open {
    display: flex;
}

.camera-modal-card {
    width: min(100%, 520px);
    display: grid;
    gap: 18px;
    padding: 20px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.32);
}

.camera-modal-stage {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(139, 198, 75, 0.12), rgba(246, 153, 24, 0.16)),
        var(--surface-2);
    aspect-ratio: 4 / 3;
}

.camera-modal-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.camera-modal-copy {
    display: grid;
    gap: 6px;
}

.camera-modal-copy strong {
    font-size: 1.05rem;
}

.camera-modal-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.camera-modal-status {
    min-height: 20px;
    margin: 0;
    color: var(--danger, #dc2626);
    font-size: 0.9rem;
}

.camera-modal-status:empty {
    display: none;
}

.camera-modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.install-app-modal {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
}

.install-app-modal.is-open {
    display: flex;
}

.install-app-card {
    width: min(100%, 460px);
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.32);
}

.install-app-copy {
    display: grid;
    gap: 8px;
}

.install-app-copy strong {
    font-size: 1.2rem;
}

.install-app-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.install-app-badge {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 198, 75, 0.18), rgba(246, 153, 24, 0.14));
    color: var(--primary);
}

.install-app-badge .material-icons {
    font-size: 32px;
}

.install-app-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.school-profile-logo-uploader input[type="file"][data-school-logo-input],
.school-profile-logo-uploader input[type="file"][data-image-input] {
    display: none;
}

.fee-search-card {
    position: relative;
    z-index: 10;
}

.fee-search-card,
.fee-search-card .card-body {
    overflow: visible;
}

.card-body>*:first-child {
    margin-top: 0;
}

.card-body>*:last-child {
    margin-bottom: 0;
}

.card>.table-wrap {
    padding: 0 20px 20px;
}

.stat-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-grid>.card,
.fees-overview-grid>.card {
    height: 100%;
}

.stat-grid .label,
.fees-overview-grid .label {
    color: var(--muted);
    font-size: 0.86rem;
}

.stat-grid .value,
.fees-overview-grid .value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 10px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.page-grid.student-dashboard-stack {
    grid-template-columns: 1fr;
}

.student-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.student-profile-photo {
    width: 112px;
    height: 112px;
    border-radius: 28px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.student-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-profile-copy h2 {
    margin: 0 0 8px;
    font-size: 1.75rem;
}

.student-profile-copy p {
    margin: 0;
    color: var(--muted);
}

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

.student-detail-item {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.student-detail-item span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    color: var(--muted);
}

.student-detail-item strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.student-address-block,
.student-inline-section {
    margin-top: 24px;
}

.student-address-block strong,
.student-inline-section strong {
    display: inline-block;
    margin-bottom: 10px;
}

.student-address-block p,
.student-inline-section p {
    margin: 0 0 6px;
}

.card-body>.pill-tabs {
    margin-bottom: 16px;
}

.pill-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill-tab {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 150ms ease;
}

.pill-tab:hover {
    border-color: rgba(139, 198, 75, 0.55);
    background: linear-gradient(135deg, rgba(139, 198, 75, 0.1) 0%, rgba(139, 198, 75, 0.05) 100%);
    box-shadow: 0 0 0 4px rgba(139, 198, 75, 0.08);
}

.pill-tab.is-active {
    border-color: rgba(139, 198, 75, 0.65);
    background: linear-gradient(135deg, rgba(139, 198, 75, 0.18) 0%, rgba(139, 198, 75, 0.08) 100%);
    color: var(--heading);
    box-shadow: 0 0 0 4px rgba(139, 198, 75, 0.08);
}

.unified-login-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
    width: 100%;
}

.unified-login-tabs .pill-tab {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.pill-tab.is-active {
    background: linear-gradient(135deg, var(--primary) 0%, #6fa83d 100%);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 198, 75, 0.3);
}

.tab-panel[hidden] {
    display: none !important;
}

.fee-search-field {
    position: relative;
}

.student-search-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 1000;
    display: none;
    max-height: 320px;
    overflow: auto;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.fee-payment-item-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 16px;
    align-items: end;
}

.student-search-dropdown.is-open {
    display: grid;
    gap: 8px;
}

.student-search-option {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
}

.student-search-option:hover {
    border-color: rgba(139, 198, 75, 0.55);
    background: rgba(139, 198, 75, 0.08);
}

.student-search-option strong {
    display: block;
    margin-bottom: 4px;
}

.student-search-empty {
    padding: 12px 14px;
    color: var(--muted);
}

.table-wrap {
    overflow: auto;
}

.dt-table-wrap {
    overflow: visible;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table.js-datatable {
    width: 100% !important;
}

table.js-datatable th,
table.js-datatable td {
    white-space: normal;
}


th {
    color: var(--text) !important;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    font-size: 0.92rem;
}

table.dataTable th,
table.dataTable td,
table.dataTable th.dt-center,
table.dataTable td.dt-center,
table.dataTable th.dt-body-center,
table.dataTable td.dt-body-center {
    text-align: left !important;
}

table.dataTable>thead>tr>th,
table.dataTable>thead>tr>td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

table.dataTable thead>tr>th.dt-orderable-asc:hover,
table.dataTable thead>tr>th.dt-orderable-desc:hover,
table.dataTable thead>tr>td.dt-orderable-asc:hover,
table.dataTable thead>tr>td.dt-orderable-desc:hover {
    outline: none;
    outline-offset: -2px;
}

div.dt-container .dt-paging .dt-paging-button {
    color: var(--text) !important;
}

div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover {
    color: #fff !important;
}

div.dt-container .dt-paging .dt-paging-button.disabled,
div.dt-container .dt-paging .dt-paging-button.disabled:hover,
div.dt-container .dt-paging .dt-paging-button.disabled:active {
    color: var(--muted) !important;
}

div.dt-container.dt-empty-footer tbody>tr:last-child>* {
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

.dt-container {
    margin-top: 8px;
}

.dt-container .dt-search,
.dt-container .dt-length,
.dt-container .dt-info {
    color: var(--muted);
}

.dt-container .dt-search {
    margin-bottom: 12px;
}

.dt-container .dt-search,
.dt-container .dt-info {
    display: none !important;
}

.dt-container .dt-length {
    display: none !important;
}

.dt-container .dt-search label,
.dt-container .dt-length label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
    outline: none;
    box-shadow: none;
}

.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus {
    border-color: rgba(139, 198, 75, 0.55);
    box-shadow: 0 0 0 4px rgba(139, 198, 75, 0.10);
}

.dt-container .dt-paging {
    margin-top: 14px;
}

.dt-container .dt-paging .dt-paging-button {
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    border-radius: 12px !important;
    margin: 0 3px;
    min-width: 38px;
    height: 38px;
    padding: 0 12px !important;
    transition: all 150ms ease;
}

.dt-container .dt-paging .dt-paging-button:focus-visible,
.pagination-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(139, 198, 75, 0.18);
}

.dt-container .dt-paging .dt-paging-button:hover,
.pagination-link:hover {
    border-color: rgba(139, 198, 75, 0.45);
}

html[data-theme="light"] .dt-container .dt-paging .dt-paging-button:hover,
html[data-theme="light"] .pagination-link:hover {
    background: rgba(139, 198, 75, 0.10) !important;
    color: var(--text) !important;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .dt-container .dt-paging .dt-paging-button:hover,
html[data-theme="dark"] .pagination-link:hover {
    background: rgba(139, 198, 75, 0.18) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.dt-container .dt-paging .dt-paging-button:hover {
    transform: translateY(-1px);
}

.dt-container .dt-paging .dt-paging-button.current {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

.dt-container .dt-paging .dt-paging-button.current:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    transform: none;
}

.dt-container .dt-paging .dt-paging-button.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.dt-container .dt-layout-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.dt-container .dt-layout-start,
.dt-container .dt-layout-end {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.dt-container .dt-layout-start:empty,
.dt-container .dt-layout-end:empty {
    display: none;
}

.student-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
    align-items: end;
}

.student-filters .student-filter-field {
    min-width: 0;
    margin-bottom: 0;
}

.student-filters .student-filter-field select,
.student-filters .student-filter-field input {
    min-height: 48px;
}

.student-filters .student-filter-export {
    align-self: end;
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    margin-bottom: 0;
    justify-content: center;
}

.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
    gap: 18px;
    margin-top: 22px;
    align-items: start;
}

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

.fees-layout {
    grid-template-columns: 1fr !important;
    align-items: stretch;
}

.fees-layout>.card {
    height: 100%;
}

.page-grid>* {
    min-width: 0;
}

.canvas-box {
    min-height: 340px;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.card-empty-state {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px dashed var(--border);
    background: var(--surface-2);
    color: var(--muted);
    text-align: center;
}

.fees-overview-body {
    padding-top: 20px;
    padding-bottom: 20px;
}

.fees-overview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.fees-summary-chips {
    margin-top: 18px;
}

.fees-overview-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    align-items: stretch;
}

.fees-overview-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
    align-items: end;
}

.fees-overview-filter .field {
    min-width: 0;
    margin-bottom: 0;
}

.fee-bar-chart {
    position: relative;
    margin-top: 18px;
    padding: 24px 20px 20px 52px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(139, 198, 75, 0.08), rgba(139, 198, 75, 0)),
        var(--surface);
    overflow: hidden;
}

.fee-bar-chart-grid {
    position: absolute;
    inset: 20px;
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    pointer-events: none;
}

.fee-bar-chart-grid span {
    position: relative;
    display: block;
    margin-left: -42px;
    color: var(--muted);
    font-size: 0.78rem;
}

.fee-bar-chart-grid span::after {
    content: "";
    position: absolute;
    left: 42px;
    right: 0;
    top: 50%;
    border-top: 1px dashed rgba(107, 114, 128, 0.22);
}

.fee-bar-chart-bars {
    position: relative;
    min-height: 320px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.fee-bar-card {
    position: relative;
    display: grid;
    gap: 12px;
    align-items: end;
    justify-items: center;
    min-width: 0;
    z-index: 1;
}

.fee-bar-value {
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    word-break: break-word;
}

.fee-bar-track {
    width: min(92px, 100%);
    height: 220px;
    display: flex;
    align-items: end;
    justify-content: center;
    padding: 10px;
    border-radius: 18px 18px 14px 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.03), rgba(15, 23, 42, 0.10));
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.fee-bar {
    width: 100%;
    min-height: 0;
    border-radius: 14px 14px 10px 10px;
    transition: height 220ms ease;
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.16);
}

.fee-bar-total {
    background: linear-gradient(180deg, #8bc64b, #5a9a21);
}

.fee-bar-paid {
    background: linear-gradient(180deg, #16a34a, #166534);
}

.fee-bar-pending {
    background: linear-gradient(180deg, #f69918, #d97706);
}

.fee-bar-previous {
    background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.fee-bar-label {
    font-weight: 600;
    text-align: center;
}

.fee-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 18px;
}

.fee-chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.fee-chart-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.fee-mode-overview-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.fee-mode-overview-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 24px;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98)),
        linear-gradient(135deg, rgba(139, 198, 75, 0.08), rgba(96, 165, 250, 0.08));
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 16px;
}

.fee-mode-overview-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.fee-mode-overview-eyebrow {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.fee-mode-overview-total {
    min-width: 112px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-align: right;
}

.fee-mode-overview-total span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.fee-mode-overview-total strong {
    font-size: 1rem;
}

.fee-mode-overview-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.fee-mode-overview-stat {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.fee-mode-overview-stat-label {
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.fee-mode-bar-card {
    gap: 10px;
}

.fee-mode-bar-track {
    width: 100%;
}

.fee-mode-mini-chart {
    border-radius: 22px;
    padding: 18px 14px 14px;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(241, 245, 249, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.fee-mode-mini-chart-bars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
    min-height: 180px;
    justify-items: center;
}

.fee-mode-mini-track {
    height: 132px;
    width: 34px;
    max-width: 100%;
    padding: 5px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(226, 232, 240, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.fee-mode-chart-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.35;
    color: var(--text);
}

.fee-mode-mini-chart .fee-bar-value {
    font-size: 0.78rem;
}

.fee-mode-mini-chart .fee-bar-label {
    font-size: 0.72rem;
    line-height: 1.25;
}

.gallery-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.gallery-toolbar-chips {
    gap: 10px;
}

.gallery-setup-alert {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(251, 191, 36, 0.05));
}

.gallery-setup-alert .material-icons {
    color: #d97706;
    font-size: 22px;
    flex-shrink: 0;
}

.gallery-setup-alert strong,
.gallery-setup-alert p {
    margin: 0;
}

.gallery-setup-alert p {
    margin-top: 4px;
    color: var(--muted);
}

.gallery-upload-form,
.gallery-filter-form {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at top right, rgba(139, 198, 75, 0.08), transparent 26%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(248, 250, 252, 0.92));
}

.gallery-upload-form {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    align-items: end;
}

.gallery-upload-form .field,
.gallery-filter-form .field {
    margin-bottom: 0;
}

.gallery-upload-copy {
    align-self: center;
}

.gallery-upload-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.gallery-upload-actions {
    width: auto;
    justify-content: flex-end;
}

.gallery-upload-actions .btn-pill {
    width: auto;
    min-width: 140px;
}

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

.gallery-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.gallery-card-actions {
    gap: 10px;
}

.gallery-table td,
.gallery-table th {
    vertical-align: middle;
}

.gallery-preview-link,
.gallery-video-thumb-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 62px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(135deg, rgba(139, 198, 75, 0.08), rgba(246, 153, 24, 0.07));
}

.gallery-preview-thumb,
.gallery-video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-preview-badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
}

.gallery-preview-badge .material-icons {
    font-size: 14px;
}

.gallery-video-thumb-icon {
    font-size: 30px;
    color: #fff;
}

.gallery-file-meta {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.gallery-file-meta strong,
.gallery-file-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-file-meta span {
    color: var(--muted);
    font-size: 0.82rem;
}

.gallery-select-all,
.gallery-row-check,
.gallery-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gallery-select-all span {
    font-size: 0.82rem;
    color: var(--muted);
}

.gallery-hidden-download-form {
    display: none;
}

.gallery-bulk-download:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.gallery-delete-button {
    color: #dc2626;
}

.gallery-delete-button:hover {
    color: #b91c1c;
    background: rgba(220, 38, 38, 0.08);
}

html[data-theme="dark"] .gallery-upload-form,
html[data-theme="dark"] .gallery-filter-form {
    background:
        radial-gradient(circle at top right, rgba(139, 198, 75, 0.08), transparent 26%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.96));
}

html[data-theme="dark"] .gallery-preview-link,
html[data-theme="dark"] .gallery-video-thumb-wrap {
    border-color: rgba(148, 163, 184, 0.18);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
}

@media (max-width: 1180px) {
    .gallery-toolbar {
        grid-template-columns: 1fr;
    }

    .gallery-upload-form {
        grid-template-columns: 1fr;
    }
}

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

    .gallery-preview-link,
    .gallery-video-thumb-wrap {
        width: 72px;
        height: 52px;
    }
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.login-page {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(135deg, #f5f7fb 0%, #e8ecf1 50%, #f0f4f8 100%);
}

[data-theme="dark"] .login-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

[data-theme="light"] .login-bg::before {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139, 198, 75, 0.14) 0%, transparent 52%),
        radial-gradient(ellipse at 80% 80%, rgba(246, 153, 24, 0.12) 0%, transparent 52%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 198, 75, 0.08) 0%, transparent 62%);
}

[data-theme="light"] .login-bg-grid {
    background-image:
        linear-gradient(rgba(139, 198, 75, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 198, 75, 0.08) 1px, transparent 1px);
}

[data-theme="light"] .login-bg-large {
    opacity: 0.5;
}

[data-theme="light"] .login-bg-shape {
    opacity: 0.68;
}

[data-theme="light"] .login-bg-ring {
    border-color: rgba(139, 198, 75, 0.22);
}

[data-theme="light"] .login-bg-ring-2 {
    border-color: rgba(246, 153, 24, 0.18);
}

[data-theme="light"] .login-bg-ring-3 {
    border-color: rgba(139, 198, 75, 0.14);
}

[data-theme="light"] .login-bg-dot {
    background: rgba(139, 198, 75, 0.7);
}

[data-theme="light"] .login-bg-dot-2,
[data-theme="light"] .login-bg-dot-4 {
    background: rgba(246, 153, 24, 0.65);
}

[data-theme="light"] .login-bg-line {
    background: linear-gradient(90deg, transparent, rgba(139, 198, 75, 0.28), transparent);
}

[data-theme="light"] .login-bg-line-2 {
    background: linear-gradient(90deg, transparent, rgba(246, 153, 24, 0.24), transparent);
}

.login-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139, 198, 75, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(246, 153, 24, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 198, 75, 0.04) 0%, transparent 60%);
}

.login-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 198, 75, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 198, 75, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.login-bg-large {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: large-float 25s ease-in-out infinite;
}

.login-bg-large-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -150px;
    background: radial-gradient(circle, rgba(139, 198, 75, 0.4) 0%, transparent 70%);
}

.login-bg-large-2 {
    width: 500px;
    height: 500px;
    bottom: -150px;
    left: -150px;
    background: radial-gradient(circle, rgba(246, 153, 24, 0.35) 0%, transparent 70%);
    animation-delay: -10s;
}

.login-bg-large-3 {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(139, 198, 75, 0.2) 0%, transparent 70%);
    animation-delay: -15s;
}

@keyframes large-float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

.login-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.login-bg-shape-1 {
    width: 400px;
    height: 400px;
    top: -150px;
    right: -100px;
    background: radial-gradient(circle, rgba(139, 198, 75, 0.25) 0%, transparent 70%);
    animation-delay: 0s;
}

.login-bg-shape-2 {
    width: 300px;
    height: 300px;
    bottom: -80px;
    left: -80px;
    background: radial-gradient(circle, rgba(246, 153, 24, 0.2) 0%, transparent 70%);
    animation-delay: -5s;
}

.login-bg-shape-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    background: radial-gradient(circle, rgba(139, 198, 75, 0.15) 0%, transparent 70%);
    animation-delay: -10s;
}

.login-bg-shape-4 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    right: 10%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    animation-delay: -15s;
}

.login-bg-shape-5 {
    width: 180px;
    height: 180px;
    top: 10%;
    left: 15%;
    background: radial-gradient(circle, rgba(246, 153, 24, 0.15) 0%, transparent 70%);
    animation-delay: -7s;
}

.login-bg-shape-6 {
    width: 100px;
    height: 100px;
    bottom: 35%;
    left: 25%;
    background: radial-gradient(circle, rgba(139, 198, 75, 0.2) 0%, transparent 70%);
    animation-delay: -12s;
}

.login-bg-shape-7 {
    width: 80px;
    height: 80px;
    top: 30%;
    right: 20%;
    background: radial-gradient(circle, rgba(246, 153, 24, 0.2) 0%, transparent 70%);
    animation-delay: -8s;
}

.login-bg-ring {
    position: absolute;
    border: 1px solid rgba(139, 198, 75, 0.12);
    border-radius: 50%;
    animation: ring-rotate 30s linear infinite;
}

.login-bg-ring-1 {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 40s;
}

.login-bg-ring-2 {
    width: 280px;
    height: 280px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-color: rgba(246, 153, 24, 0.1);
    animation-duration: 25s;
    animation-direction: reverse;
}

.login-bg-ring-3 {
    width: 520px;
    height: 520px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-color: rgba(139, 198, 75, 0.06);
    animation-duration: 50s;
}

@keyframes ring-rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.login-bg-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(139, 198, 75, 0.4);
    border-radius: 50%;
    animation: dot-pulse 4s ease-in-out infinite;
}

.login-bg-dot-1 {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.login-bg-dot-2 {
    top: 70%;
    right: 20%;
    animation-delay: -1s;
    background: rgba(246, 153, 24, 0.4);
}

.login-bg-dot-3 {
    bottom: 25%;
    left: 10%;
    animation-delay: -2s;
}

.login-bg-dot-4 {
    top: 40%;
    right: 8%;
    animation-delay: -3s;
    background: rgba(246, 153, 24, 0.3);
}

.login-bg-dot-5 {
    top: 15%;
    right: 30%;
    animation-delay: -1.5s;
}

.login-bg-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 198, 75, 0.15), transparent);
    animation: line-fade 8s ease-in-out infinite;
}

.login-bg-line-1 {
    width: 200px;
    top: 30%;
    left: 10%;
    transform: rotate(-15deg);
    animation-delay: -2s;
}

.login-bg-line-2 {
    width: 150px;
    bottom: 20%;
    right: 15%;
    transform: rotate(20deg);
    background: linear-gradient(90deg, transparent, rgba(246, 153, 24, 0.12), transparent);
    animation-delay: -4s;
}

@keyframes line-fade {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes dot-pulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.3);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(15px, -20px) rotate(5deg);
    }

    50% {
        transform: translate(-10px, 15px) rotate(-3deg);
    }

    75% {
        transform: translate(-15px, -10px) rotate(2deg);
    }
}

.login-card {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}

.login-card-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-card-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
}

.login-card-shape-1 {
    width: 180px;
    height: 180px;
    top: -60px;
    right: -40px;
    background: radial-gradient(circle, rgba(139, 198, 75, 0.35) 0%, transparent 70%);
}

.login-card-shape-2 {
    width: 120px;
    height: 120px;
    bottom: -30px;
    left: -30px;
    background: radial-gradient(circle, rgba(246, 153, 24, 0.3) 0%, transparent 70%);
}

.login-card-shape-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    right: -20px;
    background: radial-gradient(circle, rgba(139, 198, 75, 0.25) 0%, transparent 70%);
}

.login-logo {
    position: relative;
    z-index: 1;
    width: 192px;
    height: 192px;
    margin: 0 auto 32px;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(139, 198, 75, 0.15) 0%, rgba(139, 198, 75, 0.08) 100%);
    border: 1px solid rgba(139, 198, 75, 0.25);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.login-header p {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0;
}

.login-card form {
    display: grid;
    gap: 20px;
}

.field-group {
    position: relative;
}

.field-group input {
    width: 100%;
    padding: 18px 20px;
    padding-left: 52px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: all 200ms ease;
}

.field-group input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(139, 198, 75, 0.12);
}

.field-group input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.field-group .field-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-family: "Material Icons";
    font-size: 20px;
    color: var(--muted);
    z-index: 1;
    transition: color 200ms ease;
    pointer-events: none;
}

.field-group input:focus+.field-icon {
    color: var(--primary);
}

.field-group .field-error {
    display: block;
    font-size: 0.82rem;
    color: #ef4444;
    margin-top: 6px;
    padding-left: 4px;
}

.field-checkbox {
    display: flex;
    align-items: center;
}

.field-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--muted);
}

.field-checkbox input {
    display: none;
}

.field-radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.field-radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--muted);
}

.field-radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.term-selection-field {
    padding: 12px;
    background: var(--surface-2);
    border-radius: var(--radius);
    max-height: 180px;
    overflow-y: auto;
}

.checkbox-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    position: relative;
    transition: all 200ms ease;
}

.field-checkbox input:checked+.checkbox-mark {
    background: var(--primary);
    border-color: var(--primary);
}

.field-checkbox input:checked+.checkbox-mark::after {
    content: "check";
    font-family: "Material Icons";
    font-size: 14px;
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #6fa83d 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 4px 16px rgba(139, 198, 75, 0.3);
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 198, 75, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login .material-icons {
    font-size: 20px;
    transition: transform 200ms ease;
}

.btn-login:hover .material-icons {
    transform: translateX(4px);
}

@media (max-width: 520px) {
    .login-card {
        padding: 32px 24px;
    }

    .login-logo {
        width: 140px;
        height: 140px;
        margin-bottom: 24px;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }

    .login-header p {
        font-size: 0.9rem;
    }
}

.login-form-side {
    padding: 32px 24px;
}

.login-form-wrapper {
    max-width: 100%;
}

.field {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 16px;
    min-width: 0;
}

.field label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
}

.field label:only-child {
    display: none;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 13px 14px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    min-width: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

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

.form-row-1 {
    grid-template-columns: 1fr;
}

.form-row .field {
    margin-bottom: 0;
}

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

.form-inline>.field {
    margin-bottom: 0;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 13px 14px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.password-input-wrap {
    position: relative;
    width: 100%;
}

.password-input-wrap input[type="password"],
.password-input-wrap input[type="text"] {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
}

.password-toggle:hover {
    color: var(--text);
    background: var(--accent-soft);
    box-shadow: none;
}

.password-toggle .material-icons {
    font-size: 20px;
}

.field select:not([multiple]):not([size]),
select:not([multiple]):not([size]) {
    appearance: none;
    background-image: var(--select-arrow-image);
    background-position: right 14px center;
    background-size: 16px 16px;
    background-repeat: no-repeat;
    padding-right: 48px;
}

.field select:hover,
.dt-container .dt-length select:hover,
.student-filters .student-filter-field select:hover,
.select-inline:hover {
    border-color: rgba(139, 198, 75, 0.75);
    box-shadow: 0 0 0 4px rgba(139, 198, 75, 0.08);
}

.field select option:checked,
.field select option:focus,
.dt-container .dt-length select option:checked,
.dt-container .dt-length select option:focus,
.student-filters .student-filter-field select option:checked,
.student-filters .student-filter-field select option:focus {
    background: var(--primary);
    color: #fff;
}

.field select option:hover,
.dt-container .dt-length select option:hover,
.student-filters .student-filter-field select option:hover {
    background: rgba(139, 198, 75, 0.12);
    color: var(--text);
}

.select-inline {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    padding: 0 32px 0 0;
    background-image: var(--select-arrow-image);
    background-position: right 4px center;
    background-size: 14px 14px;
    background-repeat: no-repeat;
}

.academic-year-select:focus-visible {
    outline: none;
    box-shadow: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(139, 198, 75, 0.55);
    box-shadow: 0 0 0 4px rgba(139, 198, 75, 0.10);
}

.page-loader {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    background: rgba(10, 15, 30, 0.22);
    backdrop-filter: blur(8px);
    z-index: 9999;
}

.page-loader.is-active {
    display: flex;
}

.toast-stack {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 10001;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 28px));
    pointer-events: none;
}

.toast {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 16px 16px 16px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 90%, white 10%);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transition: opacity 180ms ease, transform 220ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.24);
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.24);
}

.toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.14);
    color: #16a34a;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.toast-content {
    min-width: 0;
}

.toast-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.toast-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}

.toast-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: var(--surface-2);
    color: var(--text);
    box-shadow: none;
    transform: none;
}

.toast-close .material-icons {
    font-size: 20px;
}

.loader-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.28);
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

.loader-text {
    color: #fff;
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.page-loader .loader-text {
    text-transform: none;
}

.fade-in {
    animation: fadeIn 240ms ease both;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pagination-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.pagination-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.pagination-link {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    transition: all 150ms ease;
}

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

.pagination-link.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-link.is-active:hover {
    transform: none;
}

.pagination-link.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination-dots {
    color: var(--muted);
    padding: 0 6px;
}

.pagination-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.back-link {
    padding-inline: 12px;
}

.back-link .material-icons {
    transition: transform 150ms ease;
}

.back-link:hover .material-icons {
    transform: translateX(-2px);
}

@media (max-width: 1200px) {

    .card-body>form:not(.student-filters):not(.no-form-grid),
    .inventory-form-grid,
    .inventory-item-grid,
    .student-field-grid,
    .fee-mode-row-grid,
    .form-row,
    .form-inline,
    .student-filters,
    .fees-overview-filter,
    .school-profile-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 15px;
    }

    .school-profile-form .school-profile-address,
    .student-field-grid .school-profile-address {
        grid-column: 1 / -1;
    }

    .fee-mode-row-action {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {

    .app-shell,
    .auth-card,
    .page-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .card-body>form:not(.student-filters):not(.no-form-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-field-grid,
    .school-profile-form .school-profile-address,
    .school-profile-form,
    .fees-overview-filter,
    .student-filters,
    .form-inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .school-profile-logo-stage {
        grid-template-columns: 1fr;
    }

    .field input,
    .field select,
    .field textarea {
        width: 100%;
    }

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

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

    .fee-mode-row-action {
        grid-column: 1 / -1;
    }

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

    .school-profile-form .school-profile-address {
        grid-column: 1 / -1;
    }

    .school-profile-form .school-profile-address textarea {
        width: 100%;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 86vw);
        transform: translateX(-102%);
        transition: transform 220ms ease;
        z-index: 60;
        height: 100vh;
    }

    body.nav-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        backdrop-filter: blur(2px);
        z-index: 55;
    }

    body.nav-open .sidebar-overlay {
        display: block;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .pagination-wrap {
        justify-content: center;
    }
}

@media (max-width: 767px) {

    .card-body>form:not(.student-filters):not(.no-form-grid),
    .inventory-form-grid,
    .inventory-item-grid,
    .student-field-grid,
    .fee-mode-row-grid,
    .school-profile-form,
    .form-row,
    .form-row-2,
    .form-inline,
    .student-filters,
    .fees-overview-filter {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    .field {
        margin-bottom: 12px;
    }

    .field input,
    .field select,
    .field textarea {
        width: 100%;
        min-width: 0;
    }

    .school-profile-form .field {
        width: 100%;
    }
}

@media (max-width: 640px) {
    body.student-portal .topbar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 12px;
    }

    body.student-portal .topbar-left {
        width: 100%;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
    }

    body.student-portal .topbar-right {
        width: 100%;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 12px;
    }

    body.student-portal .topbar-left>.nav-toggle,
    body.student-portal .topbar-right>.theme-switch {
        width: 44px;
        min-width: 44px;
    }

    body.student-portal .topbar-left>.chip,
    body.student-portal .topbar-right>.chip {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
    }

    body.student-portal .topbar-right>form {
        width: 44px;
        justify-self: end;
    }

    body.student-portal .topbar-right>form .btn-icon {
        width: 44px;
        min-width: 44px;
    }

    .toast-stack {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }

    .main {
        padding: 14px;
    }

    .topbar,
    .card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .card-header strong {
        flex: 0 1 auto;
        min-width: 0;
    }

    .card-header>*:not(strong) {
        flex-shrink: 0;
        min-width: auto;
    }

    .card-header .btn-pill,
    .card-header .btn-icon,
    .card-header a {
        min-width: auto;
        white-space: nowrap;
    }

    .card-header .topbar-right {
        margin-left: auto;
        display: flex;
        align-items: center;
    }

    .topbar {
        width: 100%;
    }

    .topbar-middle,
    .topbar-right {
        width: auto;
        min-width: auto;
    }

    .topbar-left {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
    }

    .topbar-left>.nav-toggle {
        flex: 0 0 44px;
    }

    .topbar-left>.chip {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-left>form.chip {
        width: 100%;
        flex: 1 1 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .topbar-left>form.chip .select-inline {
        width: 100%;
    }

    .topbar-middle,
    .topbar-right {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
    }

    .topbar-middle {
        width: 100%;
        justify-content: flex-end;
    }

    .topbar-right>.theme-switch,
    .topbar-right>form .btn-icon {
        flex: 0 0 44px;
    }

    .topbar-right>.chip {
        flex: 1 1 auto;
        min-width: 0;
    }

    .card-header,
    .card-body,
    .auth-form,
    .auth-hero {
        padding: 16px;
    }

    .card-body .field,
    .card-body input,
    .card-body select,
    .card-body textarea {
        width: 100%;
        min-width: 0;
    }

    .content-grid>.card,
    .card,
    .stat-grid>.card,
    .fees-overview-grid>.card {
        width: 100%;
    }

    .app-shell,
    .auth-card,
    .page-grid,
    .stat-grid {
        grid-template-columns: 1fr !important;
    }

    .page-grid>*,
    .stat-grid>*,
    .auth-card>* {
        width: 100%;
        min-width: 0;
    }

    .inventory-item-row .page-grid {
        grid-template-columns: 1fr !important;
    }

    .card>.table-wrap {
        padding: 0 16px 16px;
    }

    .card-body>form:not(.student-filters):not(.no-form-grid) {
        grid-template-columns: 1fr;
    }

    .school-profile-form {
        grid-template-columns: 1fr;
        display: grid;
    }

    .school-profile-form .school-profile-address {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }

    .school-profile-form .school-profile-address textarea {
        width: 100%;
        min-width: 0;
    }

    .school-profile-logo-uploader {
        padding: 16px;
    }

    .school-profile-logo-preview-large {
        height: 170px;
    }

    .school-profile-logo-dropzone {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .inventory-form-grid,
    .inventory-item-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

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

    body.student-portal .stat-grid,
    body.student-portal .fees-overview-grid,
    body.student-portal .student-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .student-profile-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-form-grid .field,
    .inventory-item-grid .field {
        width: 100%;
        min-width: 0;
    }

    .inventory-form-grid input,
    .inventory-form-grid select,
    .inventory-form-grid textarea,
    .inventory-item-grid input,
    .inventory-item-grid select,
    .inventory-item-grid textarea {
        width: 100%;
        min-width: 0;
    }

    .fee-mode-row-grid {
        grid-template-columns: 1fr;
    }

    .fee-mode-row-action .btn-pill {
        width: 100%;
        justify-content: center;
    }

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

    .form-inline,
    .form-row,
    .form-row-2 {
        grid-template-columns: 1fr !important;
        display: flex;
        flex-direction: column;
    }

    .field input,
    .field select,
    .field textarea {
        width: 100%;
        min-width: 0;
    }

    .stat-grid,
    .content-grid,
    .page-grid {
        gap: 14px;
    }

    .auth-shell {
        padding: 14px;
    }

    .auth-hero {
        padding-bottom: 28px;
    }

    .pagination-nav {
        width: 100%;
        justify-content: center;
    }

    .form-actions .btn-pill,
    .btn-submit {
        width: 100%;
        min-width: 100%;
        max-width: none;
    }

    .page-grid {
        margin-top: 14px;
    }

    .fees-overview-grid {
        grid-template-columns: 1fr;
    }

    .fees-overview-filter {
        width: 100%;
    }

    .fees-overview-filter .field {
        width: 100%;
        min-width: 0;
    }

    .fee-bar-chart {
        padding: 22px 14px 16px 42px;
    }

    .fee-bar-chart-bars {
        min-height: 260px;
        gap: 12px;
    }

    .fee-bar-track {
        width: min(84px, 100%);
        height: 180px;
    }

    .fee-mode-bar-track {
        width: 100%;
    }

    .fee-mode-overview-grid {
        grid-template-columns: 1fr;
    }

    .fee-mode-overview-head {
        flex-direction: column;
    }

    .fee-mode-overview-head,
    .fee-mode-overview-stats,
    .fee-mode-mini-chart-bars {
        gap: 10px;
    }

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

    .fee-mode-mini-chart-bars {
        min-height: 168px;
    }

    .fee-mode-mini-track {
        height: 120px;
        width: 30px;
    }

    .fee-payment-item-body {
        grid-template-columns: 1fr;
    }

    .dt-container .dt-layout-row {
        flex-direction: column;
        align-items: stretch;
    }

    .dt-container .dt-layout-start,
    .dt-container .dt-layout-end {
        width: 100%;
        justify-content: space-between;
    }

    body:not(.student-portal) .student-filters,
    body:not(.student-portal) .fees-overview-filter {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px;
        align-items: stretch;
    }

    body:not(.student-portal) .student-filters .student-filter-field,
    body:not(.student-portal) .student-filters .student-filter-export,
    body:not(.student-portal) .fees-overview-filter .field,
    .form-inline .field {
        width: 100%;
    }

    .form-inline {
        display: flex !important;
        flex-direction: column;
    }
}

@media (min-width: 1201px) {

    .card-body>form:not(.student-filters):not(.no-form-grid),
    .inventory-form-grid,
    .inventory-item-grid,
    .student-field-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

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

    .fees-overview-body .fees-overview-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .field {
        margin-bottom: 16px;
    }
}

@media (min-width: 1201px) {

    .fees-overview-grid,
    .fees-overview-filter,
    .student-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .fees-overview-body .fees-overview-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1101px) {
    .fees-overview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fees-overview-body .fees-overview-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.global-print-shell {
    display: none;
}

.global-print-header {
    text-align: center;
    margin-bottom: 24px;
}

.global-print-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
}

.global-print-copy h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

.global-print-copy p {
    margin: 4px 0 0;
    color: #111827;
    font-size: 1rem;
}

.global-print-title {
    font-weight: 700;
}

@media print {
    html {
        font-size: 100%;
    }

    body {
        background: #ffffff !important;
        color: #111827 !important;
    }

    body.is-section-printing .app-shell,
    body.is-section-printing .page-loader,
    body.is-section-printing .sidebar-overlay,
    body.is-section-printing [data-toast-stack] {
        display: none !important;
    }

    body.is-section-printing .global-print-shell {
        display: block !important;
        padding: 24px;
    }

    body.is-section-printing .global-print-stage .card,
    body.is-section-printing .global-print-stage .card-body,
    body.is-section-printing .global-print-stage .card-header {
        background: #ffffff !important;
        box-shadow: none !important;
        border: 0 !important;
    }

    body.is-section-printing .global-print-stage .card {
        border-radius: 0 !important;
    }

    body.is-section-printing .global-print-stage .card-header {
        padding: 0 0 12px !important;
    }

    body.is-section-printing .global-print-stage .card-header strong {
        font-size: 1.1rem;
    }

    body.is-section-printing .global-print-stage .card-body {
        padding: 0 !important;
    }

    body.is-section-printing .global-print-stage table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    body.is-section-printing .global-print-stage th,
    body.is-section-printing .global-print-stage td {
        border: 1px solid #111827 !important;
        padding: 8px 10px !important;
        text-align: left !important;
        vertical-align: top !important;
        color: #111827 !important;
    }

    body.is-section-printing .global-print-stage .chip,
    body.is-section-printing .global-print-stage .student-detail-item,
    body.is-section-printing .global-print-stage .card-empty-state,
    body.is-section-printing .global-print-stage .fee-mode-overview-card,
    body.is-section-printing .global-print-stage .fee-bar-card {
        break-inside: avoid;
    }
}
