@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --ink: #132238;
    --muted: #61708a;
    --line: #d8e2ee;
    --teal: #173f78;
    --teal-dark: #102d58;
    --blue: #173f78;
    --red: #c9332b;
    --green: #0f8a66;
    --amber: #ff941f;
    --orange-dark: #c96400;
    --sky: #eaf2ff;
    --shadow: 0 18px 46px rgba(19, 34, 56, 0.11);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: 'DM Sans', Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: inherit;
}

.admin-shell {
    display: grid;
    grid-template-columns: 284px minmax(0, 1fr);
    min-height: 100vh;
    align-items: start;
    transition: grid-template-columns 220ms ease;
}

.admin-shell.menu-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    height: 100vh;
    min-height: 0;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(16, 45, 88, 0.96), rgba(23, 63, 120, 0.98)),
        var(--teal);
    color: #ffffff;
    box-shadow: 14px 0 34px rgba(16, 45, 88, 0.2);
    overflow: hidden;
    transition: width 220ms ease, box-shadow 220ms ease;
}

.admin-sidebar-top {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 16px 14px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.admin-brand.logo-brand {
    display: inline-flex;
    justify-content: center;
    min-height: auto;
    min-width: 0;
    padding: 0;
}

.admin-brand.logo-brand img {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 58px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff;
    padding: 4px;
    transition: width 220ms ease, height 220ms ease, max-height 220ms ease;
}

.admin-brand span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: var(--amber);
    font-weight: 900;
}

.admin-brand strong {
    font-size: 17px;
}

.admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 0 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.admin-menu-toggle:hover,
.admin-menu-toggle:focus {
    border-color: rgba(255, 255, 255, 0.36);
    background: rgba(255, 148, 31, 0.9);
    transform: translateY(-1px);
}

.menu-toggle-icon {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 16px;
    height: 2px;
    border-radius: inherit;
    background: currentColor;
}

.menu-toggle-icon::before {
    top: -5px;
}

.menu-toggle-icon::after {
    top: 5px;
}

.admin-nav {
    display: grid;
    grid-auto-rows: max-content;
    align-content: start;
    align-items: stretch;
    gap: 6px;
    min-height: 0;
    flex: 1;
    padding: 10px 8px 18px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
}

.menu-collapsed .admin-nav {
    display: none;
}

.nav-group {
    position: relative;
    padding-bottom: 7px;
}

.nav-direct,
.nav-group-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #d7e4df;
    padding: 0 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.nav-direct {
    margin-bottom: 7px;
}

.nav-direct::after,
.nav-group::after {
    content: '';
    position: absolute;
    right: 10px;
    bottom: 0;
    left: 10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
}

.nav-direct:hover,
.nav-direct:focus,
.nav-direct.active,
.nav-group.active > .nav-group-toggle,
.nav-group.is-open > .nav-group-toggle,
.nav-group:focus-within > .nav-group-toggle {
    border-color: rgba(255, 255, 255, 0.32);
    background: var(--amber);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(255, 148, 31, 0.18);
    transform: translateX(2px);
}

.nav-chevron {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 160ms ease;
}

.nav-group.is-open .nav-chevron,
.nav-group:focus-within .nav-chevron {
    transform: translateY(1px) rotate(225deg);
}

.nav-submenu {
    display: grid;
    max-height: 0;
    gap: 4px;
    margin-top: 0;
    overflow: hidden;
    border-left: 2px solid rgba(255, 148, 31, 0.65);
    opacity: 0;
    transform: translateY(-5px);
    transition: max-height 240ms ease, opacity 180ms ease, transform 180ms ease, margin-top 180ms ease;
}

.nav-group:focus-within .nav-submenu,
.nav-group.is-open .nav-submenu {
    max-height: 420px;
    margin-top: 8px;
    opacity: 1;
    transform: translateY(0);
}

.nav-submenu a {
    position: relative;
    display: block;
    margin-left: 10px;
    border-radius: 7px;
    color: #e9f2ff;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-submenu a + a::before {
    content: '';
    position: absolute;
    top: -3px;
    right: 8px;
    left: 8px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), rgba(255, 148, 31, 0.42), transparent);
}

.nav-submenu a:hover,
.nav-submenu a:focus,
.nav-submenu a.active {
    background: rgba(255, 148, 31, 0.18);
    color: #ffffff;
    transform: translateX(3px);
}

.admin-sidebar-bottom {
    margin-top: auto;
    padding: 12px 10px 52px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(16, 45, 88, 0.2), rgba(16, 45, 88, 0.66));
}

.sidebar-logout-button {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.sidebar-logout-button:hover,
.sidebar-logout-button:focus {
    border-color: rgba(255, 255, 255, 0.34);
    background: var(--amber);
    box-shadow: 0 12px 24px rgba(255, 148, 31, 0.22);
    transform: translateY(-1px);
}

.sidebar-logout-icon {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.sidebar-logout-icon::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 1px;
    width: 10px;
    height: 14px;
    border: 2px solid currentColor;
    border-right: 0;
    border-radius: 4px 0 0 4px;
}

.sidebar-logout-icon::after {
    content: '';
    position: absolute;
    top: 9px;
    right: 1px;
    width: 13px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 5px -4px 0 -1px currentColor, 5px 4px 0 -1px currentColor;
}

.admin-main {
    min-width: 0;
    padding: 20px 24px 72px;
}

.menu-collapsed .admin-sidebar-top {
    align-items: center;
    padding-inline: 10px;
}

.menu-collapsed .admin-brand.logo-brand img {
    width: 50px;
    height: 50px;
    max-height: 50px;
    object-fit: cover;
    object-position: left center;
    padding: 3px;
}

.menu-collapsed .admin-menu-toggle {
    width: 46px;
    padding: 0;
}

.menu-collapsed [data-admin-menu-toggle-text] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.menu-collapsed .admin-sidebar-bottom {
    padding-inline: 10px;
}

.menu-collapsed .sidebar-logout-button {
    width: 46px;
    min-height: 46px;
    margin-inline: auto;
    padding: 0;
}

.menu-collapsed .sidebar-logout-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.eyebrow {
    color: var(--orange-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-topbar h1 {
    margin: 4px 0 0;
    font-size: 24px;
    line-height: 1.2;
}

.admin-account {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.admin-account span {
    color: var(--muted);
    font-weight: 700;
}

.admin-account a,
.link-button {
    border: 0;
    background: transparent;
    color: var(--teal-dark);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
}

.admin-account .account-action {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid rgba(255, 148, 31, 0.28);
    border-radius: 8px;
    background: #fff3e6;
    padding: 0 10px;
}

.portal-notifications {
    position: relative;
    z-index: 140;
}

.admin-topbar-actions .portal-notification-menu {
    right: 0;
    left: auto;
}

.portal-notification-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid rgba(23, 63, 120, 0.14);
    border-radius: 8px;
    background: #ffffff;
    color: var(--teal-dark);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
    list-style: none;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(23, 32, 42, 0.08);
}

.portal-notification-trigger::-webkit-details-marker {
    display: none;
}

.portal-notification-icon {
    position: relative;
    display: inline-block;
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-radius: 9px 9px 6px 6px;
}

.portal-notification-icon::before,
.portal-notification-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: currentColor;
}

.portal-notification-icon::before {
    top: -5px;
    width: 7px;
    height: 4px;
    border-radius: 8px 8px 0 0;
}

.portal-notification-icon::after {
    bottom: -6px;
    width: 7px;
    height: 3px;
    border-radius: 999px;
}

.portal-notification-badge {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: #e9eef6;
    color: var(--teal-dark);
    padding: 0 6px;
    font-size: 11px;
    line-height: 1;
}

.portal-notification-badge.has-count {
    background: var(--amber);
    color: #ffffff;
}

.portal-notification-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: min(380px, calc(100vw - 56px));
    overflow: hidden;
    border: 1px solid #ccd9ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 54px rgba(23, 32, 42, 0.2);
}

.portal-notification-menu-head,
.portal-notification-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
}

.portal-notification-menu-head strong,
.portal-notification-panel-head h2 {
    margin: 0;
    color: var(--teal-dark);
    font-size: 16px;
}

.portal-notification-panel-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.portal-notification-menu-head button {
    border: 0;
    background: transparent;
    color: var(--orange-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.portal-notification-menu-list {
    display: grid;
    max-height: 330px;
    overflow: auto;
}

.portal-notification-item,
.portal-notification-row {
    display: grid;
    width: 100%;
    gap: 4px;
    border: 0;
    border-bottom: 1px solid #edf2f8;
    background: #ffffff;
    color: inherit;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
}

.portal-notification-item.is-unread,
.portal-notification-row.is-unread {
    background: #fff8ef;
}

.portal-notification-item:hover,
.portal-notification-item:focus,
.portal-notification-row:hover,
.portal-notification-row:focus {
    background: #edf5ff;
}

.portal-notification-item-title,
.portal-notification-row strong {
    color: var(--teal-dark);
    font-size: 13px;
    font-weight: 900;
}

.portal-notification-item-message,
.portal-notification-row em {
    color: #4e617a;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.35;
}

.portal-notification-item small,
.portal-notification-row small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.portal-notification-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    background: #f5f8fc;
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.portal-notification-dashboard {
    margin-bottom: 12px;
}

.portal-notification-list {
    display: grid;
}

.portal-notification-row {
    grid-template-columns: 64px minmax(150px, 0.9fr) minmax(220px, 1.4fr) 150px;
    align-items: center;
}

.portal-notification-status {
    display: inline-grid;
    width: fit-content;
    min-height: 24px;
    place-items: center;
    border-radius: 999px;
    background: #e8eef7;
    color: var(--muted);
    padding: 0 10px;
    font-size: 11px;
    font-weight: 900;
}

.portal-notification-row.is-unread .portal-notification-status {
    background: #ff941f;
    color: #ffffff;
}

.portal-notification-empty {
    padding: 16px;
    color: var(--muted);
    font-weight: 800;
}

.admin-notification-dashboard {
    overflow: visible;
}

.admin-notification-dashboard .portal-notification-panel-head {
    padding: 10px 14px;
}

.admin-notification-table-wrap {
    border: 0;
    border-radius: 0 0 8px 8px;
}

.admin-notification-dashboard table {
    min-width: 860px;
}

.admin-notification-dashboard th,
.admin-notification-dashboard td {
    vertical-align: middle;
}

.admin-notification-dashboard td:nth-child(3) {
    color: #40546f;
    font-weight: 700;
}

.portal-notification-status.is-unread-status {
    background: var(--amber);
    color: #ffffff;
}

.notification-action-stack {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.button.compact {
    width: auto;
    min-height: 28px;
    padding: 0 12px;
    font-size: 11px;
    line-height: 1;
}

.broadcast-filter-form {
    align-items: end;
}

.broadcast-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.broadcast-mode-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(23, 63, 120, 0.16);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    padding: 12px;
    cursor: pointer;
}

.broadcast-mode-card input {
    width: 18px;
    height: 18px;
    accent-color: var(--amber);
}

.broadcast-mode-card strong,
.broadcast-recipient-table td strong {
    display: block;
    color: var(--teal-dark);
    font-weight: 900;
}

.broadcast-mode-card small,
.broadcast-recipient-table td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.broadcast-recipient-table table {
    min-width: 980px;
}

.broadcast-recipient-table input[type='checkbox'] {
    width: 18px;
    height: 18px;
    accent-color: var(--amber);
}

.topbar-logout-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(23, 63, 120, 0.14);
    border-radius: 8px;
    background: #ffffff;
    color: var(--teal-dark);
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(23, 32, 42, 0.08);
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.topbar-logout-button:hover,
.topbar-logout-button:focus {
    border-color: rgba(255, 148, 31, 0.5);
    background: var(--amber);
    color: #ffffff;
    transform: translateY(-1px);
}

.topbar-logout-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right: 0;
    border-radius: 5px 0 0 5px;
}

.topbar-logout-icon::before,
.topbar-logout-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    background: currentColor;
}

.topbar-logout-icon::before {
    right: -8px;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    transform: translateY(-50%);
}

.topbar-logout-icon::after {
    right: -9px;
    width: 7px;
    height: 7px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    background: transparent;
    transform: translateY(-50%) rotate(45deg);
}

.idle-modal[hidden] {
    display: none;
}

.idle-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(16, 45, 88, 0.62);
    backdrop-filter: blur(8px);
}

.idle-modal-card {
    width: min(430px, 100%);
    border: 1px solid rgba(255, 148, 31, 0.28);
    border-radius: 8px;
    background: #ffffff;
    padding: 24px;
    color: var(--ink);
    box-shadow: 0 28px 70px rgba(16, 45, 88, 0.26);
    text-align: center;
}

.idle-modal-kicker {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    border-radius: 999px;
    background: #fff3e8;
    color: var(--amber);
    padding: 0 10px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.idle-modal-card h2 {
    margin: 12px 0 8px;
    font-size: 22px;
    line-height: 1.2;
}

.idle-modal-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.idle-count-ring {
    display: inline-grid;
    width: 96px;
    height: 96px;
    place-items: center;
    margin: 18px auto 4px;
    border: 8px solid var(--sky);
    border-top-color: var(--amber);
    border-radius: 999px;
    color: var(--teal-dark);
    font-size: 30px;
    font-weight: 900;
}

.idle-modal-card .form-actions {
    justify-content: center;
    margin-top: 20px;
}

.link-button:disabled {
    color: var(--muted);
    cursor: not-allowed;
}

.panel,
.stat-card,
.login-card,
.notice {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    margin-bottom: 18px;
    overflow: hidden;
}

.admin-split-page {
    display: grid;
    grid-template-rows: minmax(240px, auto) minmax(360px, 50vh);
    gap: 18px;
    min-height: calc(100vh - 190px);
}

.admin-form-zone,
.admin-table-zone {
    min-height: 0;
}

.admin-form-scroll {
    max-height: 42vh;
    overflow: auto;
}

.admin-table-zone {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.admin-table-zone .table-wrap {
    min-height: 0;
    overflow: auto;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
}

.panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.panel-body {
    padding: 20px;
}

.dashboard-context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.dashboard-context-card {
    position: relative;
    display: grid;
    gap: 5px;
    min-height: 82px;
    align-content: center;
    overflow: hidden;
    border: 1px solid rgba(23, 63, 120, 0.13);
    border-top: 4px solid var(--amber);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    color: inherit;
    padding: 12px 16px;
    text-decoration: none !important;
    box-shadow: var(--shadow);
}

.dashboard-context-card::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 148, 31, 0.14);
}

.dashboard-context-card span {
    color: var(--orange-dark);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
}

.dashboard-context-card strong {
    color: var(--teal-dark);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.05;
}

.dashboard-context-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-context-card[href]:hover,
.dashboard-context-card[href]:focus {
    border-color: rgba(255, 143, 31, 0.42);
    border-top-color: var(--orange-dark);
    background: #fffaf4;
    transform: translateY(-1px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.stat-card {
    position: relative;
    min-height: 64px;
    overflow: hidden;
    padding: 10px 12px 10px 14px;
    border: 1px solid rgba(23, 63, 120, 0.13);
    border-left: 4px solid var(--amber);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    color: inherit;
    text-decoration: none !important;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 143, 31, 0.12);
}

.stat-card:hover,
.stat-card:focus {
    border-color: rgba(255, 143, 31, 0.42);
    border-left-color: var(--orange-dark);
    background: #fffaf4;
    box-shadow: 0 14px 30px rgba(23, 32, 42, 0.1);
    transform: translateY(-1px);
}

.stat-card,
.stat-card *,
.quick-action-card,
.quick-action-card * {
    text-decoration: none !important;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin-top: 5px;
    color: var(--teal-dark);
    font-size: 22px;
    line-height: 1;
}

.quick-actions-panel {
    margin-bottom: 12px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.quick-action-card {
    display: block;
    min-height: 50px;
    border: 1px solid rgba(23, 63, 120, 0.18);
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fbff, #ffffff);
    padding: 9px 11px;
    text-decoration: none !important;
}

.quick-action-card:hover,
.quick-action-card:focus {
    border-color: var(--amber);
    background: #fff6ec;
}

.quick-action-card span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
}

.quick-action-card strong {
    display: block;
    margin-top: 3px;
    color: var(--teal-dark);
    font-size: 13px;
    line-height: 1.15;
}

.notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    box-shadow: none;
    font-weight: 700;
}

.notice.success {
    border-color: rgba(19, 115, 51, 0.28);
    background: #edf8f1;
    color: var(--green);
}

.notice.error {
    border-color: rgba(180, 35, 24, 0.28);
    background: #fff1ef;
    color: var(--red);
}

.notice.warning {
    border-color: rgba(255, 148, 31, 0.36);
    background: #fff7eb;
    color: #955300;
}

.notice.info {
    border-color: rgba(23, 63, 120, 0.28);
    background: #eef5ff;
    color: var(--blue);
}

.local-otp-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-top: 10px;
    border: 1px dashed rgba(149, 83, 0, 0.4);
    border-radius: 8px;
    background: #ffffff;
    color: var(--teal-dark);
    padding: 0 14px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 5px;
}

.notice .local-otp-code {
    display: flex;
    width: max-content;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

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

.tab,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.tab.active,
.primary-button {
    border-color: var(--amber);
    background: var(--amber);
    color: #ffffff;
}

.primary-button:hover,
.primary-button:focus {
    border-color: var(--orange-dark);
    background: var(--orange-dark);
}

.danger-button {
    border-color: var(--red);
    background: var(--red);
    color: #ffffff;
}

.secondary-button {
    background: #f8fbff;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.data-table-controls label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.data-table-controls select,
.data-table-controls input {
    width: auto;
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12px;
}

.data-table-controls input {
    width: min(260px, 48vw);
}

.data-table-pages {
    display: inline-flex;
    gap: 7px;
}

.data-table-exports {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.data-table-exports .export-button {
    min-height: 32px;
    padding: 0 12px;
    border-color: rgba(18, 63, 123, 0.18);
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 900;
}

.data-table-exports .export-button:hover,
.data-table-exports .export-button:focus {
    border-color: rgba(255, 148, 31, 0.56);
    background: #fff4e7;
    color: var(--orange-dark);
}

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

th,
td {
    padding: 10px 9px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: #223653;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
}

th[data-sortable='true'] {
    cursor: pointer;
}

th[data-sortable='true']:focus {
    outline: 2px solid rgba(255, 148, 31, 0.34);
    outline-offset: -2px;
}

td {
    color: #132238;
    font-size: 13px;
    font-weight: 600;
}

.mini-photo {
    display: block;
    width: 58px;
    height: 72px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #eef3f8;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.badge-pending {
    background: #fff8e6;
    color: var(--amber);
}

.badge-approved {
    background: #eaf7ef;
    color: var(--green);
}

.badge-rejected {
    background: #fff1ef;
    color: var(--red);
}

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

.icon-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(46px, 1fr));
    gap: 6px;
    min-width: 110px;
}

.icon-action {
    display: inline-grid;
    min-height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--teal-dark);
    padding: 5px 7px;
    text-align: center;
    text-decoration: none !important;
}

.icon-action span {
    display: inline-grid;
    width: 15px;
    height: 15px;
    place-items: center;
    color: currentColor;
}

.icon-action span::before {
    content: '';
    display: block;
    width: 15px;
    height: 15px;
    background: currentColor;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
}

.action-view span::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5c5 0 9 5.2 10 7-1 1.8-5 7-10 7s-9-5.2-10-7c1-1.8 5-7 10-7zm0 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm0 2.2a1.8 1.8 0 1 1 0 3.6 1.8 1.8 0 0 1 0-3.6z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5c5 0 9 5.2 10 7-1 1.8-5 7-10 7s-9-5.2-10-7c1-1.8 5-7 10-7zm0 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm0 2.2a1.8 1.8 0 1 1 0 3.6 1.8 1.8 0 0 1 0-3.6z'/%3E%3C/svg%3E");
}

.action-edit span::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 17.3V21h3.7L18.8 9.9l-3.7-3.7L4 17.3zM21 7.7a1 1 0 0 0 0-1.4L18.7 4a1 1 0 0 0-1.4 0l-1.2 1.2 3.7 3.7L21 7.7z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 17.3V21h3.7L18.8 9.9l-3.7-3.7L4 17.3zM21 7.7a1 1 0 0 0 0-1.4L18.7 4a1 1 0 0 0-1.4 0l-1.2 1.2 3.7 3.7L21 7.7z'/%3E%3C/svg%3E");
}

.action-form span::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l5 5v15H6V2zm8 1.5V8h4.5L14 3.5zM8 12h8v2H8v-2zm0 4h8v2H8v-2z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l5 5v15H6V2zm8 1.5V8h4.5L14 3.5zM8 12h8v2H8v-2zm0 4h8v2H8v-2z'/%3E%3C/svg%3E");
}

.action-id span::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18v14H3V5zm2 2v10h14V7H5zm2 2h5v2H7V9zm0 3h5v2H7v-2zm8-2h2v2h-2v-2zm-1 4h4v1.5h-4V14z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18v14H3V5zm2 2v10h14V7H5zm2 2h5v2H7V9zm0 3h5v2H7v-2zm8-2h2v2h-2v-2zm-1 4h4v1.5h-4V14z'/%3E%3C/svg%3E");
}

.icon-action strong {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    line-height: 1;
}

.icon-action:hover,
.icon-action:focus {
    border-color: var(--amber);
    background: #fff6ec;
}

.inline-form {
    display: inline;
}

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

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

.field label {
    display: block;
    margin-bottom: 7px;
    color: #223653;
    font-size: 13px;
    font-weight: 800;
}

.required,
.field-error {
    color: var(--red);
}

.field-error {
    margin: 5px 0 0;
    font-size: 12px;
    font-weight: 800;
}

.has-error input,
.has-error select,
.has-error textarea {
    border-color: var(--red);
}

label.field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid #b9c7da;
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    outline: none;
    padding: 8px 10px;
}

input[type='checkbox'] {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    vertical-align: middle;
}

input[readonly] {
    background: #f2f6fb;
    color: var(--muted);
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(255, 148, 31, 0.16);
}

.upload-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.45fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: center;
    border: 1px solid rgba(23, 63, 120, 0.16);
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fbff, #fff7ee);
    padding: 16px;
}

.upload-panel strong {
    display: block;
    color: var(--teal-dark);
    font-size: 17px;
    line-height: 1.2;
}

.upload-panel span,
.file-meta {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.file-input-card {
    display: block;
    margin: 0;
}

.file-input-card input[type='file'] {
    min-height: 48px;
    border-style: dashed;
    background: #ffffff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.file-input-card input[type='file']::file-selector-button {
    min-height: 30px;
    margin-right: 10px;
    border: 0;
    border-radius: 6px;
    background: var(--teal);
    color: #ffffff;
    padding: 0 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.file-input-card input[type='file']:hover::file-selector-button,
.file-input-card input[type='file']:focus::file-selector-button {
    background: var(--amber);
}

.table-link {
    color: var(--teal-dark);
    font-weight: 900;
    text-decoration: none;
}

.table-link:hover,
.table-link:focus {
    color: var(--orange-dark);
    text-decoration: underline;
}

.fee-student-selector {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) max-content;
    gap: 10px;
    align-items: start;
    margin-bottom: 10px;
}

.fee-student-selector > .button {
    align-self: start;
    min-height: 34px;
    margin-top: 26px;
    white-space: nowrap;
}

.fee-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.student-combobox {
    position: relative;
    z-index: 180;
}

.student-combobox-toggle {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #b9c7da;
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    padding: 8px 12px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.student-combobox-toggle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #405168;
    border-bottom: 2px solid #405168;
    transform: rotate(45deg);
}

.student-combobox-toggle[aria-expanded='true'] {
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(255, 148, 31, 0.16);
}

.student-combobox-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 600;
    border: 1px solid #b9c7da;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(19, 34, 56, 0.16);
    padding: 10px;
}

.student-combobox-search {
    min-height: 36px;
    margin-bottom: 8px;
}

.student-combobox-options {
    display: grid;
    gap: 5px;
    max-height: 240px;
    overflow: auto;
}

.student-combobox-option {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 7px;
    background: #f8fbff;
    color: var(--ink);
    padding: 7px 9px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.student-combobox-option:hover,
.student-combobox-option:focus {
    background: #fff6ec;
    color: var(--teal-dark);
}

.student-combobox-empty {
    padding: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.fee-student-card {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.fee-student-card > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    padding: 8px 10px;
}

.fee-student-card span,
.fee-row-total span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.fee-student-card strong,
.fee-row-total strong {
    display: block;
    margin-top: 4px;
    color: var(--teal-dark);
}

.fee-live-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 4px 0 10px;
}

.fee-live-summary > div {
    border: 1px solid rgba(23, 63, 120, 0.16);
    border-top: 4px solid var(--amber);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #fff7ee);
    padding: 10px 12px;
}

.fee-live-summary span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.fee-live-summary strong {
    display: block;
    margin-top: 4px;
    color: var(--teal-dark);
    font-size: 24px;
    font-weight: 900;
    line-height: 1.1;
}

.fee-row-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0;
}

.fee-row-toolbar strong {
    color: var(--teal-dark);
    font-size: 15px;
}

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

.fee-row {
    display: grid;
    grid-template-columns: 28px minmax(170px, 1.35fr) repeat(5, minmax(92px, 0.66fr)) minmax(132px, 0.8fr) minmax(118px, auto);
    gap: 7px;
    align-items: end;
    border: 1px solid rgba(23, 63, 120, 0.16);
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fbff, #fff8ef);
    padding: 8px;
}

.fee-row-number {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: var(--teal);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.fee-row .field label {
    margin-bottom: 4px;
    font-size: 11px;
}

.fee-row input,
.fee-row select {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
}

.fee-row-total {
    display: grid;
    gap: 5px;
    justify-items: start;
}

.fee-row-total small {
    color: var(--orange-dark);
    font-size: 11px;
    font-weight: 900;
}

.fee-row-total .button {
    min-height: 28px;
}

.fee-head-due-list {
    display: grid;
    gap: 5px;
    min-width: 240px;
}

.fee-head-due-list span {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    background: #fff6ec;
    color: var(--teal-dark);
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.fee-module-grid {
    display: grid;
    grid-template-columns: minmax(0, calc(76% - 5px)) minmax(230px, calc(24% - 5px));
    gap: 10px;
    align-items: start;
    margin-bottom: 10px;
}

.fee-module-grid > form {
    min-width: 0;
    overflow-x: auto;
}

.cash-collection-box,
.selected-fee-ledger {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    padding: 14px;
}

.cash-collection-box {
    min-width: 0;
}

.cash-collection-box h3,
.selected-fee-ledger h3,
.fee-admin-tables h3 {
    margin: 0 0 12px;
    color: var(--teal-dark);
    font-size: 15px;
}

.cash-collection-box textarea {
    min-height: 76px;
    resize: vertical;
}

.cash-collection-box .button {
    width: 100%;
    white-space: normal;
}

.selected-fee-ledger {
    margin-top: 10px;
}

.compact-table {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.selected-fee-ledger .compact-table {
    overflow: auto;
}

.selected-fee-ledger table {
    min-width: 1040px;
}

.fee-due-date {
    color: var(--teal-dark);
    font-weight: 900;
    white-space: nowrap;
}

.fee-overdue-row td {
    background: #fff4f2;
}

.fee-overdue-row .fee-due-date,
.fee-fine-due {
    color: var(--red);
    font-weight: 900;
}

.fee-overdue-pill,
.fee-ok-pill {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.fee-overdue-pill {
    background: #ffe4e0;
    color: var(--red);
}

.fee-ok-pill {
    background: #e9f8f2;
    color: var(--green);
}

.fee-report-panel {
    overflow: visible;
}

.report-filter-form {
    display: grid;
    gap: 14px;
}

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

.report-mode-form {
    display: grid;
    gap: 12px;
    align-content: start;
    border: 1px solid rgba(23, 63, 120, 0.14);
    border-top: 4px solid var(--teal);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    padding: 14px;
    box-shadow: 0 10px 24px rgba(19, 34, 56, 0.06);
}

.report-mode-form.active {
    border-top-color: var(--amber);
    box-shadow: 0 16px 34px rgba(255, 148, 31, 0.12);
}

.report-form-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.report-form-head > span {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: #fff6ec;
    color: var(--orange-dark);
    font-size: 12px;
    font-weight: 900;
}

.report-form-head strong {
    display: block;
    color: var(--teal-dark);
    font-size: 15px;
    line-height: 1.2;
}

.report-form-head small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

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

.report-form-grid .wide {
    grid-column: 1 / -1;
}

.report-mode-form .field label {
    font-size: 12px;
}

.report-mode-form input,
.report-mode-form select {
    min-height: 36px;
    font-size: 13px;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

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

.report-actions {
    justify-content: flex-start;
    margin-top: 0;
}

.report-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.report-title-row h3 {
    margin: 3px 0 0;
    font-size: 18px;
}

.report-title-row > strong {
    border-radius: 999px;
    background: #fff6ec;
    color: var(--orange-dark);
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.report-summary-card {
    border: 1px solid rgba(23, 63, 120, 0.12);
    border-top: 4px solid var(--amber);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    padding: 12px 14px;
}

.report-summary-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.report-summary-card strong {
    display: block;
    margin-top: 8px;
    color: var(--teal-dark);
    font-size: 22px;
    font-weight: 900;
}

.head-total-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.head-total-strip span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fbff;
    color: var(--muted);
    padding: 0 11px;
    font-size: 12px;
    font-weight: 800;
}

.head-total-strip strong {
    color: var(--teal-dark);
}

.accounting-summary-grid,
.accounting-report-grid,
.accounting-daybook-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

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

.accounting-daybook-grid,
.accounting-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.accounting-entry-page {
    margin-bottom: 18px;
}

.accounting-transaction-panel,
.accounting-ledger-panel {
    margin-bottom: 18px;
}

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

.accounting-ledger-panel.income {
    border-top: 4px solid var(--green);
}

.accounting-ledger-panel.expense {
    border-top: 4px solid var(--red);
}

.accounting-ledger-panel .panel-header > strong {
    border-radius: 999px;
    background: #f5f8fc;
    color: var(--teal-dark);
    padding: 9px 12px;
    font-size: 15px;
    white-space: nowrap;
}

.accounting-ledger-panel.income .panel-header > strong {
    background: #eaf7ef;
    color: var(--green);
}

.accounting-ledger-panel.expense .panel-header > strong,
.report-summary-card.danger strong {
    color: var(--red);
}

.accounting-ledger-panel table,
.accounting-report-grid table {
    min-width: 780px;
}

.accounting-ledger-panel td small,
.accounting-report-grid td small,
.accounting-entry-page td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}

.fee-report-table-panel tfoot th {
    border-top: 2px solid var(--teal);
    background: #f8fbff;
    color: var(--teal-dark);
    font-size: 13px;
}

.fee-admin-tables {
    display: grid;
    gap: 18px;
    min-height: 0;
    padding: 16px;
    overflow: auto;
}

.fee-admin-tables section {
    min-height: 0;
}

.fees-page {
    grid-template-rows: auto auto;
    min-height: auto;
    padding-bottom: 68px;
}

body.admin-page-student-fees .admin-main,
body.admin-page-fee-due-records .admin-main,
body.admin-page-fee-payment-records .admin-main {
    padding-bottom: 16px;
}

body.admin-page-student-fees .fees-page,
body.admin-page-fee-due-records .fees-page,
body.admin-page-fee-payment-records .fees-page,
body.teacher-page-cashier-fees .fees-page {
    display: block;
    min-height: 0;
    padding-bottom: 0;
}

body.admin-page-student-fees .app-footer,
body.admin-page-fee-due-records .app-footer,
body.admin-page-fee-payment-records .app-footer,
body.teacher-page-cashier-fees .student-footer {
    position: static;
    margin-top: 12px;
}

body.teacher-page-cashier-fees .student-main {
    padding-bottom: 16px;
}

.fees-page .admin-form-zone {
    position: relative;
    z-index: 30;
    overflow: visible;
}

.fees-page .admin-form-scroll {
    max-height: none;
    overflow: visible;
}

.fees-page .admin-table-zone {
    position: relative;
    z-index: 1;
    display: block;
    overflow: visible;
}

.fees-page .fee-admin-tables {
    overflow: visible;
    padding: 16px 18px 22px;
}

.fees-page .fee-admin-tables section {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.fees-page .fee-admin-tables h3 {
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
}

.fees-page .fee-admin-tables .data-table-controls {
    position: static;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
}

.fees-page .fee-admin-tables .data-table-controls input {
    width: min(360px, 100%);
}

.fees-page .fee-admin-tables .table-wrap {
    min-height: 0;
    max-height: 440px;
    overflow: auto;
}

.fees-page .fee-admin-tables table {
    min-width: 1320px;
}

.fees-page .fee-admin-tables th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #ffffff;
}

.fees-page .fee-admin-tables td {
    min-height: 48px;
    line-height: 1.35;
    vertical-align: middle;
}

.payment-action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 170px;
}

.payment-action-stack form {
    margin: 0;
}

.payment-action-stack .button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.badge-success,
.badge-initiated {
    background: #fff8e6;
    color: var(--amber);
}

.badge-failed,
.badge-cancelled {
    background: #fff1ef;
    color: var(--red);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.empty-cell {
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

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

.detail-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.detail-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-item strong {
    display: block;
    margin-top: 4px;
    word-break: break-word;
}

.admin-edit-form {
    display: grid;
    gap: 14px;
}

.edit-section {
    border: 1px solid var(--line);
    border-top: 4px solid var(--amber);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    padding: 14px;
}

.edit-section h3 {
    margin: 0 0 12px;
    color: var(--teal-dark);
    font-size: 16px;
}

.sticky-actions {
    position: sticky;
    right: 0;
    bottom: 42px;
    z-index: 5;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    padding: 10px;
    box-shadow: var(--shadow);
}

.application-print-sheet {
    display: grid;
    gap: 10px;
    max-width: 960px;
    margin: 0 auto 18px;
    border: 1px solid rgba(23, 63, 120, 0.22);
    border-top: 5px solid var(--amber);
    border-radius: 8px;
    background: #ffffff;
    padding: 16px;
    box-shadow: var(--shadow);
}

.application-print-header {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 92px;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--teal-dark);
}

.application-print-header > img {
    display: block;
    width: 100%;
    max-height: 62px;
    object-fit: contain;
}

.application-print-header strong {
    display: block;
    color: var(--teal-dark);
    font-size: 22px;
    line-height: 1.15;
}

.application-print-header span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.application-print-header figure {
    display: grid;
    width: 86px;
    height: 98px;
    place-items: center;
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.application-print-header figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.application-print-band,
.application-print-grid {
    display: grid;
    gap: 6px;
}

.application-print-band {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.application-print-grid > div,
.application-print-band > div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fbff;
    padding: 7px 8px;
}

.application-print-section {
    display: grid;
    gap: 7px;
}

.application-print-section h3 {
    margin: 0;
    border-left: 4px solid var(--amber);
    color: var(--teal-dark);
    padding-left: 8px;
    font-size: 14px;
}

.application-print-sheet span,
.application-print-grid span,
.application-print-band span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.application-print-sheet strong,
.application-print-grid strong,
.application-print-band strong {
    display: block;
    margin-top: 2px;
    color: var(--ink);
    font-size: 11px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.application-document-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.application-document-list span {
    border-radius: 999px;
    background: #fff6ec;
    color: var(--orange-dark);
    padding: 5px 8px;
}

.application-print-note {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.application-print-sign {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.application-print-sign div {
    display: flex;
    min-height: 42px;
    align-items: flex-end;
    justify-content: center;
    border-bottom: 1px solid #223653;
}

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

.admitted-report-card {
    margin-bottom: 0;
}

.admitted-filter-form {
    align-items: end;
}

.id-card-stage {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
    margin-bottom: 18px;
}

.student-id-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: 390px;
    min-height: 246px;
    overflow: hidden;
    border: 1px solid rgba(23, 63, 120, 0.26);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.student-id-card header {
    display: grid;
    gap: 4px;
    justify-items: center;
    background: linear-gradient(180deg, var(--teal), var(--teal-dark));
    color: #ffffff;
    padding: 10px 12px;
    text-align: center;
}

.student-id-card header img {
    width: 220px;
    max-height: 52px;
    border-radius: 6px;
    background: #ffffff;
    object-fit: contain;
    padding: 3px;
}

.student-id-card header strong {
    font-size: 13px;
    letter-spacing: 0.4px;
}

.student-id-card main {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
}

.student-id-card figure {
    display: grid;
    width: 96px;
    height: 116px;
    place-items: center;
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.student-id-card figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.id-card-info h2 {
    margin: 0;
    color: var(--teal-dark);
    font-size: 18px;
    line-height: 1.1;
}

.id-card-info p {
    margin: 3px 0 8px;
    color: var(--orange-dark);
    font-weight: 900;
}

.student-id-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 8px;
    margin: 0;
}

.student-id-card dl div {
    min-width: 0;
}

.student-id-card dt {
    color: var(--muted);
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.student-id-card dd {
    margin: 1px 0 0;
    color: var(--ink);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.student-id-card footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--line);
    background: #f8fbff;
    padding: 8px 12px;
}

.student-id-card footer span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
}

.student-id-card footer strong {
    min-width: 110px;
    border-top: 1px solid var(--teal-dark);
    color: var(--teal-dark);
    padding-top: 3px;
    font-size: 9px;
    text-align: center;
}

.id-card-back {
    min-height: 246px;
}

.id-card-back header {
    min-height: 72px;
}

.id-card-back section {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.id-card-back p {
    margin: 0;
    border-left: 4px solid var(--amber);
    background: #fff6ec;
    color: #223653;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 800;
}

.admission-slip {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(23, 63, 120, 0.22);
    border-radius: 8px;
    background: #ffffff;
    padding: 18px;
    box-shadow: var(--shadow);
}

.admission-slip-header {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--teal-dark);
}

.admission-slip-header img {
    display: block;
    width: 100%;
    max-height: 68px;
    object-fit: contain;
}

.admission-slip-header strong {
    display: block;
    color: var(--teal-dark);
    font-size: 22px;
}

.admission-slip-header span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.admission-slip-band,
.admission-slip-grid {
    display: grid;
    gap: 8px;
}

.admission-slip-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.admission-slip-grid .wide {
    grid-column: 1 / -1;
}

.admission-slip-band > div,
.admission-slip-grid > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    padding: 10px;
}

.admission-slip span,
.admission-slip-grid span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.admission-slip strong,
.admission-slip-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.admission-slip-band strong {
    color: var(--teal-dark);
    font-size: 17px;
}

.admission-slip-note {
    border-left: 5px solid var(--amber);
    border-radius: 8px;
    background: #fff6ec;
    padding: 10px 12px;
}

.admission-slip-note p {
    margin: 4px 0 0;
    color: #223653;
}

.admission-sign-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 10px;
}

.admission-sign-row div {
    min-height: 58px;
    border-bottom: 1px solid #223653;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5px;
}

.admission-sign-row span {
    color: #223653;
    font-size: 11px;
}

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

.attendance-filter-panel {
    position: relative;
    z-index: 260;
    overflow: visible;
}

.attendance-filter-panel .panel-body {
    overflow: visible;
}

.attendance-filter-form {
    grid-template-columns: minmax(420px, 1.7fr) minmax(145px, 0.45fr) minmax(170px, 0.55fr) max-content;
    align-items: end;
    position: relative;
    z-index: 2;
}

.attendance-filter-form .field {
    min-width: 0;
    margin-bottom: 0;
}

.attendance-filter-form .student-combobox-toggle span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attendance-filter-form .form-actions {
    align-self: end;
    margin: 0;
}

.attendance-filter-form .form-actions .button {
    min-height: 34px;
    white-space: nowrap;
}

.attendance-filter-form .student-combobox {
    z-index: 900;
}

.attendance-filter-form .student-combobox-menu {
    z-index: 1200;
}

.attendance-summary-grid {
    position: relative;
    z-index: 1;
}

.attendance-empty-state {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 150px;
    border: 1px dashed rgba(23, 63, 120, 0.28);
    background: linear-gradient(135deg, #f8fbff, #fff7ee);
    padding: 24px;
    text-align: center;
}

.attendance-empty-state h3 {
    margin: 0;
    color: var(--teal-dark);
    font-size: 18px;
}

.attendance-empty-state p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
}

.attendance-empty-state-inline {
    min-height: 120px;
    border-width: 0;
    border-top: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
}

.attendance-export-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.attendance-matrix-wrap,
.attendance-summary-table-wrap {
    overflow: auto;
    padding: 12px;
}

.attendance-matrix,
.attendance-summary-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.attendance-matrix th,
.attendance-matrix td,
.attendance-summary-table th,
.attendance-summary-table td {
    border-right: 1px solid #c8d4e4;
    border-bottom: 1px solid #c8d4e4;
    padding: 8px;
    vertical-align: middle;
}

.attendance-matrix thead th,
.attendance-summary-table thead th {
    background: #0f4f91;
    color: #ffffff;
    font-weight: 900;
    text-align: center;
}

.attendance-matrix thead tr:nth-child(2) th {
    background: #76bdf2;
    color: #051d3f;
}

.attendance-matrix .attendance-month-head {
    background: #0b63b6;
    color: #ffffff;
    font-size: 14px;
}

.attendance-person-head,
.attendance-person-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 238px;
    min-width: 238px;
    max-width: 238px;
    background: #ffffff;
    text-align: left;
    white-space: normal;
}

.attendance-person-head {
    background: #073f82 !important;
    color: #ffffff;
}

.attendance-person-cell strong,
.attendance-person-cell span,
.attendance-person-cell small {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.attendance-person-cell span,
.attendance-person-cell small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
}

.attendance-matrix .is-weekend-head {
    background: #e6f4ff;
}

.attendance-day-cell {
    width: 72px;
    min-width: 72px;
    height: 64px;
    background: #f7f9fc;
    color: #061a38;
    text-align: center;
}

.attendance-day-cell span,
.attendance-day-cell strong,
.attendance-day-cell em {
    display: block;
}

.attendance-day-cell span {
    font-weight: 800;
    line-height: 1.2;
}

.attendance-day-cell strong {
    font-size: 13px;
    font-weight: 900;
}

.attendance-day-cell em {
    margin-top: 3px;
    color: #c21f30;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 1.1;
}

.attendance-day-cell.is-off {
    background: #e5f3ff;
    color: #04456f;
}

.attendance-day-cell.is-absent {
    background: #ffd6d8;
    color: #9d0d19;
}

.attendance-day-cell.is-present {
    background: #f8fbff;
}

.attendance-day-cell.has-warning {
    background: #fff3bf;
    box-shadow: inset 0 0 0 2px rgba(194, 31, 48, 0.28);
}

.attendance-summary-table {
    min-width: 760px;
}

.attendance-summary-table td {
    background: #ffffff;
    font-weight: 800;
}

.attendance-location-stack {
    display: grid;
    gap: 8px;
    min-width: 185px;
}

.admin-attendance-location-item {
    display: grid;
    gap: 3px;
    justify-items: start;
}

.attendance-location-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid #bfd1ea;
    border-radius: 999px;
    background: #f7fbff;
    padding: 6px 10px;
    color: #0b4b8c;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.attendance-location-pill:hover {
    border-color: #ff951a;
    color: #9b5200;
}

.admin-attendance-location-item small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
}

.admin-ticket-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 620px;
}

.admin-ticket-layout .ticket-list-panel {
    border-right: 1px solid var(--line);
    background: #f8fbff;
}

.ticket-list {
    display: grid;
    gap: 8px;
    max-height: 72vh;
    overflow: auto;
    padding: 12px;
}

.ticket-list a {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 11px;
    text-decoration: none !important;
}

.ticket-list a.active,
.ticket-list a:hover,
.ticket-list a:focus {
    border-color: var(--amber);
    background: #fff7eb;
}

.ticket-list strong {
    color: var(--teal-dark);
    font-size: 12px;
}

.ticket-list span {
    font-weight: 900;
}

.ticket-list small {
    color: var(--muted);
    font-weight: 700;
}

.ticket-chat-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    min-width: 0;
}

.ticket-chat-head {
    margin: 0;
    box-shadow: none;
}

.ticket-thread {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 0;
    max-height: 55vh;
    overflow: auto;
    padding: 16px;
    background: #f8fbff;
}

.ticket-message {
    width: min(76%, 720px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 10px 24px rgba(19, 34, 56, 0.08);
}

.ticket-message.student {
    justify-self: end;
    border-color: rgba(255, 148, 31, 0.35);
    background: #fff9f0;
}

.ticket-message.teacher {
    border-color: rgba(23, 63, 120, 0.22);
}

.ticket-message.admin {
    justify-self: center;
    border-color: rgba(23, 63, 120, 0.28);
    background: #eef5ff;
}

.ticket-message header,
.ticket-status-form,
.admin-ticket-compose,
.ticket-monitor-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ticket-message header {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.ticket-participant-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.ticket-participant-meta strong {
    color: var(--teal-dark);
}

.ticket-message p {
    margin: 8px 0 0;
    font-weight: 700;
}

.ticket-attachment {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--teal);
    color: #ffffff;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none !important;
}

.admin-ticket-compose,
.ticket-status-form,
.ticket-monitor-note {
    border-top: 1px solid var(--line);
    background: #ffffff;
    padding: 12px 16px;
}

.ticket-monitor-note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.admin-ticket-compose textarea {
    min-height: 76px;
}

.admin-ticket-compose textarea,
.ticket-status-form select {
    margin: 0;
}

.login-page {
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 100vh;
    align-items: center;
    justify-items: center;
    padding: 24px 24px 72px;
    background: linear-gradient(180deg, #f8fbff 0%, #eaf2ff 100%);
}

.login-card {
    width: min(420px, 100%);
    margin-bottom: 52px;
    padding: 28px;
}

.login-card .admin-brand {
    min-height: auto;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
    color: var(--ink);
}

.login-card .admin-brand.logo-brand {
    margin-bottom: 14px;
}

.login-card .admin-brand.logo-brand img {
    max-width: 100%;
    padding: 0;
    background: transparent;
}

.login-card h1 {
    margin: 0 0 8px;
}

.login-card p {
    margin: 0 0 20px;
    color: var(--muted);
}

.login-card .field {
    margin-bottom: 14px;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.captcha-row img {
    width: 180px;
    height: 58px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.resend-form {
    margin-top: 16px;
    text-align: center;
}

.otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.otp-boxes input {
    width: 100%;
    min-width: 0;
    height: 58px;
    min-height: 58px;
    padding: 0;
    border: 1px solid #b9c7da;
    border-radius: 8px;
    background: #ffffff;
    color: var(--teal-dark);
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.otp-boxes input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(255, 148, 31, 0.16);
}

.field-note {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.error-text {
    color: var(--red);
    font-weight: 800;
}

.login-footer-link {
    margin-top: 16px;
    text-align: center;
}

.forgot-button {
    width: auto;
    min-height: 34px;
    border-color: rgba(255, 148, 31, 0.28);
    background: #fff3e6;
    color: var(--teal-dark);
    padding: 0 16px;
    box-shadow: none;
}

.forgot-button:hover,
.forgot-button:focus {
    border-color: var(--amber);
    background: var(--amber);
    color: #ffffff;
}

.app-footer,
.auth-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    overflow: hidden;
    width: 100%;
    min-height: 38px;
    border-radius: 0;
    background: var(--amber);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 38px;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(255, 148, 31, 0.18);
}

.app-footer span,
.auth-footer span {
    display: inline-block;
    min-width: 100%;
    padding-left: 100%;
    animation: footer-marquee 17s linear infinite;
}

.app-footer {
    margin: 0;
}

.auth-footer {
    width: 100%;
    margin: 0;
}

@keyframes footer-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Global compact density pass for admin screens. */
body {
    font-size: 13px;
}

.admin-shell {
    grid-template-columns: 268px minmax(0, 1fr);
}

.admin-main {
    padding: 14px 16px 64px;
}

.admin-sidebar-top {
    gap: 8px;
    padding: 10px 10px 9px;
}

.admin-brand.logo-brand img {
    max-height: 50px;
    padding: 3px;
}

.admin-menu-toggle {
    min-height: 32px;
}

.admin-nav {
    gap: 4px;
    padding: 8px 6px 14px;
}

.nav-group {
    padding-bottom: 5px;
}

.nav-direct,
.nav-group-toggle {
    min-height: 34px;
    padding: 0 10px;
}

.nav-direct {
    margin-bottom: 5px;
}

.nav-group:focus-within .nav-submenu,
.nav-group.is-open .nav-submenu {
    margin-top: 5px;
}

.nav-submenu a {
    margin-left: 8px;
    padding: 7px 9px;
    font-size: 11.5px;
}

.admin-sidebar-bottom {
    padding: 8px 8px 46px;
}

.sidebar-logout-button {
    min-height: 36px;
    border-radius: 8px;
}

.admin-topbar {
    gap: 12px;
    margin-bottom: 12px;
}

.admin-topbar h1 {
    font-size: 22px;
}

.eyebrow {
    font-size: 11px;
}

.admin-topbar-actions {
    gap: 8px;
}

.portal-notification-trigger,
.topbar-logout-button {
    min-height: 34px;
}

.topbar-logout-button {
    width: 34px;
    height: 34px;
}

.panel {
    margin-bottom: 12px;
}

.panel-header {
    gap: 10px;
    padding: 12px 16px;
}

.panel-header h2 {
    font-size: 17px;
}

.panel-header p {
    margin-top: 2px;
    font-size: 12.5px;
}

.panel-body {
    padding: 14px 16px;
}

.form-grid {
    gap: 10px 12px;
}

.field {
    margin-bottom: 10px;
}

.field label {
    margin-bottom: 5px;
    font-size: 12px;
}

input,
select,
textarea {
    min-height: 34px;
    border-radius: 7px;
    padding: 6px 9px;
    font-size: 13px;
}

textarea {
    min-height: 76px;
}

input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(255, 148, 31, 0.14);
}

.tab,
.button {
    min-height: 32px;
    border-radius: 7px;
    padding: 0 10px;
    font-size: 11.5px;
}

.form-actions,
.inline-actions,
.payment-action-stack {
    gap: 7px;
}

.dashboard-context-grid,
.stats-grid {
    gap: 8px;
    margin-bottom: 10px;
}

.dashboard-context-card {
    min-height: 64px;
    gap: 3px;
    border-top-width: 3px;
    padding: 9px 12px;
}

.dashboard-context-card::after {
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
}

.dashboard-context-card span,
.dashboard-context-card small {
    font-size: 10.5px;
}

.dashboard-context-card strong {
    font-size: 20px;
}

.stat-card {
    min-height: 58px;
    padding: 9px 11px;
}

.data-table-controls {
    gap: 8px;
    padding: 8px 10px;
    font-size: 11.5px;
}

.data-table-controls select,
.data-table-controls input {
    min-height: 30px;
    padding: 5px 8px;
}

th,
td {
    padding: 7px 8px;
}

th {
    font-size: 10.5px;
}

td {
    font-size: 12px;
}

.badge {
    min-height: 22px;
    padding: 0 8px;
    font-size: 10.5px;
}

.mini-photo {
    width: 48px;
    height: 60px;
}

.admin-split-page {
    grid-template-rows: minmax(210px, auto) minmax(320px, 50vh);
    gap: 12px;
}

.admin-form-scroll {
    max-height: 39vh;
}

.upload-panel,
.cash-collection-box,
.selected-fee-ledger,
.fee-student-card > div,
.student-combobox-menu {
    padding: 10px;
}

.file-input-card,
.fee-row {
    padding: 10px;
}

.fee-student-selector,
.fee-student-card,
.fee-live-summary,
.fee-row-list,
.fee-module-grid,
.fee-admin-tables {
    gap: 8px;
}

.fee-student-selector {
    margin-bottom: 10px;
}

.fee-student-selector > .button {
    min-height: 34px;
    margin-top: 26px;
}

.student-combobox-toggle {
    min-height: 34px;
    padding: 6px 10px;
}

.student-combobox-search {
    min-height: 32px;
}

.student-combobox-options {
    max-height: 210px;
}

.student-combobox-option {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 12px;
}

.fee-row {
    gap: 8px;
}

.fee-row-number {
    width: 24px;
    height: 24px;
}

.cash-collection-box h3,
.selected-fee-ledger h3,
.fee-admin-tables h3 {
    margin-bottom: 9px;
    font-size: 14px;
}

.cash-collection-box textarea {
    min-height: 64px;
}

.attendance-matrix-wrap,
.attendance-summary-table-wrap {
    padding: 8px;
}

.attendance-matrix,
.attendance-summary-table {
    font-size: 11px;
}

.attendance-matrix th,
.attendance-matrix td,
.attendance-summary-table th,
.attendance-summary-table td {
    padding: 6px;
}

.attendance-person-head,
.attendance-person-cell {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
}

.attendance-day-cell {
    width: 64px;
    min-width: 64px;
    height: 54px;
}

.portal-notification-menu-head,
.portal-notification-panel-head,
.portal-notification-item,
.portal-notification-row {
    padding: 9px 11px;
}

.otp-boxes {
    gap: 7px;
}

.otp-boxes input {
    height: 52px;
    min-height: 52px;
    font-size: 24px;
}

.attendance-export-report {
    display: contents;
}

.attendance-report-letterhead,
.attendance-report-title-card,
.attendance-report-footer {
    display: none;
}

@media print {
    body.attendance-print-mode {
        background: #ffffff !important;
        color: #000000;
        font-size: 9px;
    }

    body.attendance-print-mode * {
        visibility: hidden;
    }

    body.attendance-print-mode .attendance-export-report,
    body.attendance-print-mode .attendance-export-report * {
        visibility: visible;
    }

    body.attendance-print-mode .attendance-export-report {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        display: block;
        width: 100%;
        padding: 0;
    }

    body.attendance-print-mode .attendance-report-letterhead {
        display: grid;
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 14px;
        align-items: center;
        border-bottom: 3px solid #173f78;
        padding-bottom: 8px;
    }

    body.attendance-print-mode .attendance-report-letterhead img {
        width: 180px;
        max-height: 66px;
        object-fit: contain;
    }

    body.attendance-print-mode .attendance-report-letterhead h2,
    body.attendance-print-mode .attendance-report-title-card h1 {
        margin: 0;
        color: #061a38;
    }

    body.attendance-print-mode .attendance-report-letterhead p,
    body.attendance-print-mode .attendance-report-title-card p {
        margin: 2px 0 0;
        color: #24364f;
        font-weight: 700;
    }

    body.attendance-print-mode .attendance-report-title-card {
        display: block;
        margin: 8px 0 10px;
        border: 1px solid #9eb2ce;
        background: #f4f8ff !important;
        padding: 8px 10px;
        text-align: center;
    }

    body.attendance-print-mode .attendance-report-footer {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border-top: 2px solid #173f78;
        margin-top: 10px;
        padding-top: 6px;
        color: #24364f;
        font-size: 9px;
        font-weight: 700;
    }

    body.attendance-print-mode .attendance-export-section {
        margin: 0 0 10px;
        border: 0;
        box-shadow: none;
        page-break-inside: avoid;
    }

    body.attendance-print-mode .attendance-export-section .panel-header {
        display: block;
        min-height: auto;
        border: 0;
        padding: 0 0 5px;
    }

    body.attendance-print-mode .attendance-matrix-wrap,
    body.attendance-print-mode .attendance-summary-table-wrap {
        overflow: visible;
        padding: 0;
    }

    body.attendance-print-mode .attendance-person-head,
    body.attendance-print-mode .attendance-person-cell {
        position: static;
        width: 150px;
        min-width: 150px;
        max-width: 150px;
    }

    body.attendance-print-mode .attendance-day-cell {
        width: 28px;
        min-width: 28px;
        height: auto;
    }
}

@media (max-width: 1100px) {
    .admin-shell {
        grid-template-columns: 248px minmax(0, 1fr);
    }

    .admin-shell.menu-collapsed {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .admin-nav {
        gap: 6px;
        padding-inline: 10px;
    }

    .admin-brand.logo-brand img {
        max-height: 52px;
    }

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

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

    .report-forms-grid {
        grid-template-columns: 1fr;
    }

    .accounting-summary-grid,
    .accounting-daybook-grid,
    .accounting-report-grid,
    .accounting-transaction-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 720px) {
    body {
        font-size: 13px;
    }

    .admin-shell,
    .admin-shell.menu-collapsed {
        display: block;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        min-height: 0;
    }

    .admin-sidebar-top {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px;
    }

    .admin-brand.logo-brand img {
        width: min(100%, 320px);
        max-height: 62px;
    }

    .admin-menu-toggle {
        width: 100%;
    }

    .admin-nav {
        display: grid;
        grid-template-columns: 1fr;
        max-height: 70vh;
        padding: 10px 14px 14px;
    }

    .menu-collapsed .admin-nav {
        display: none;
    }

    .nav-direct,
    .nav-group-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .nav-submenu {
        position: static;
        min-width: 0;
        margin-top: 6px;
        box-shadow: none;
    }

    .admin-main {
        padding: 14px 14px 70px;
    }

    .admin-topbar,
    .panel-header,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-topbar-actions,
    .portal-notification-panel-head {
        align-items: stretch;
        justify-content: flex-start;
    }

    .portal-notification-menu {
        width: min(360px, calc(100vw - 28px));
    }

    .admin-account {
        justify-content: space-between;
        white-space: normal;
    }

    .stats-grid,
    .dashboard-context-grid,
    .quick-actions-grid,
    .form-grid,
    .detail-grid,
    .admin-ticket-layout,
    .application-print-header,
    .application-print-band,
    .application-print-grid,
    .application-print-sign,
    .admitted-report-grid,
    .report-forms-grid,
    .report-form-grid,
    .report-filter-grid,
    .report-summary-grid,
    .accounting-summary-grid,
    .accounting-daybook-grid,
    .accounting-report-grid,
    .accounting-transaction-grid {
        grid-template-columns: 1fr;
    }

    .admin-ticket-layout .ticket-list-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

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

    .attendance-filter-form .form-actions .button {
        width: 100%;
    }

    .student-id-card {
        width: min(390px, 100%);
    }

    .student-id-card main {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .student-id-card figure {
        width: 88px;
        height: 108px;
    }

    .report-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .fee-student-selector,
    .fee-student-card,
    .fee-live-summary,
    .fee-module-grid,
    .fee-row,
    .broadcast-mode-grid {
        grid-template-columns: 1fr;
    }

    .fee-row-number {
        width: 100%;
        border-radius: 8px;
    }

    .fee-row-total {
        justify-items: stretch;
    }

    .admin-topbar h1 {
        font-size: 23px;
    }

    .button,
    .tab {
        width: 100%;
    }

    .otp-boxes {
        gap: 7px;
    }

    .otp-boxes input {
        height: 50px;
        min-height: 50px;
        font-size: 22px;
    }
}

@page {
    size: A4;
    margin: 10mm;
}

@media print {
    body {
        min-width: 0;
        background: #ffffff !important;
        color: #000000;
        font-size: 11px;
    }

    .admin-sidebar,
    .admin-topbar,
    .notice,
    .no-print,
    .app-footer {
        display: none !important;
    }

    .admin-main {
        padding: 0;
    }

    .application-print-sheet,
    .student-id-card {
        box-shadow: none;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .application-print-sheet {
        max-width: none;
        margin: 0;
        gap: 6px;
        border: 0;
        border-radius: 0;
        padding: 0;
    }

    .application-print-header {
        grid-template-columns: 160px minmax(0, 1fr) 72px;
        gap: 8px;
        padding-bottom: 5px;
    }

    .application-print-header > img {
        max-height: 42px;
    }

    .application-print-header strong {
        font-size: 15px;
    }

    .application-print-header figure {
        width: 66px;
        height: 76px;
        border-radius: 4px;
    }

    .application-print-band,
    .application-print-grid {
        gap: 4px;
    }

    .application-print-band {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

    .application-print-grid > div,
    .application-print-band > div {
        border-radius: 3px;
        background: #ffffff !important;
        padding: 4px 5px;
    }

    .application-print-section h3 {
        font-size: 11px;
    }

    .application-print-sheet span,
    .application-print-grid span,
    .application-print-band span {
        font-size: 7px;
    }

    .application-print-sheet strong,
    .application-print-grid strong,
    .application-print-band strong,
    .application-print-note {
        font-size: 8.5px;
        line-height: 1.18;
    }

    .application-document-list span {
        border: 1px solid #d8e2ee;
        background: #ffffff !important;
        padding: 2px 5px;
        font-size: 7px;
    }

    .application-print-sign div {
        min-height: 30px;
    }

    .id-card-stage {
        justify-content: flex-start;
        gap: 10mm;
        margin: 0;
    }

    .student-id-card {
        width: 86mm;
        min-height: 54mm;
        border-radius: 3mm;
        break-inside: avoid;
    }

    .student-id-card header {
        padding: 2.5mm 3mm;
    }

    .student-id-card header img {
        width: 48mm;
        max-height: 12mm;
    }

    .student-id-card main {
        grid-template-columns: 23mm minmax(0, 1fr);
        gap: 3mm;
        padding: 3mm;
    }

    .student-id-card figure {
        width: 23mm;
        height: 28mm;
    }

    .id-card-info h2 {
        font-size: 12px;
    }

    .student-id-card dd {
        font-size: 7.5px;
    }

    .student-id-card footer {
        padding: 2mm 3mm;
    }

    .admission-slip {
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        gap: 7px;
        page-break-inside: avoid;
    }

    .admission-slip-header {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 10px;
        padding-bottom: 6px;
    }

    .admission-slip-header img {
        max-height: 48px;
    }

    .admission-slip-header strong {
        font-size: 16px;
    }

    .admission-slip-band,
    .admission-slip-grid {
        gap: 5px;
    }

    .admission-slip-band > div,
    .admission-slip-grid > div,
    .admission-slip-note {
        border-radius: 4px;
        background: #ffffff !important;
        padding: 5px 7px;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .admission-slip span,
    .admission-slip-grid span {
        font-size: 8px;
    }

    .admission-slip strong,
    .admission-slip-grid strong,
    .admission-slip-note p {
        font-size: 10px;
    }

    .admission-slip-band strong {
        font-size: 12px;
    }

    .admission-sign-row div {
        min-height: 38px;
    }
}
