@font-face {
    font-family: "Thmanyah";
    src: local("Thmanyah"), local("ثمانية"),
         url("../fonts/thmanyahserifdisplay-bold.otf") format("opentype");
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Thmanyah";
    src: local("Thmanyah"), local("ثمانية"),
         url("../fonts/thmanyahserifdisplay-regular.otf") format("opentype");
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Thmanyah Sans";
    src: url("../fonts/thmanyahsans-regular.otf") format("opentype");
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Thmanyah Sans";
    src: url("../fonts/thmanyahsans-bold.ttf") format("truetype");
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #118C44;
    --primary-dark: #0D6933;
    --secondary-color: #FCDB06;
    --accent-color: #FCDB06;
    --background-color: #f4f7f7;
    --surface-color: #ffffff;
    --text-color: #1f2933;
    --muted-color: #687782;
    --border-color: #d8e0e3;
    --danger-color: #c63d3d;
    --warning-color: #8A7600;
    --success-color: #118C44;
    --info-color: #0D6933;
    --shadow-soft: 0 16px 34px rgba(31, 41, 51, .08);
    --shadow-light: 0 8px 20px rgba(31, 41, 51, .055);
    --radius-sm: 6px;
    --radius-md: 8px;
    --sidebar-width: 252px;
    --sidebar-collapsed-width: 82px;
    --font-heading: "Thmanyah Sans", "Cairo", Tahoma, Arial, sans-serif;
    --font-body: "Cairo", Tahoma, Arial, sans-serif;
    --font-print: "Thmanyah Sans", Tahoma, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    background:
        linear-gradient(180deg, #f8fbfb 0%, var(--background-color) 260px);
    color: var(--text-color);
    line-height: 1.65;
    letter-spacing: 0;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 18px;
    right: 18px;
    bottom: 18px;
    left: auto;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 50;
    overflow: hidden;
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 26px;
    background: rgba(255, 255, 255, .7);
    box-shadow: 0 24px 58px rgba(17, 140, 68, .1), inset 0 1px 0 rgba(255, 255, 255, .7);
    backdrop-filter: blur(26px) saturate(155%);
    -webkit-backdrop-filter: blur(26px) saturate(155%);
    transition: width .22s ease, padding .22s ease, transform .22s ease;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(17, 140, 68, .09), transparent 38%),
        linear-gradient(90deg, rgba(252, 219, 6, .07), transparent 58%);
}

.brand-block {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 8px 6px 14px;
    overflow: hidden;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(17, 140, 68, .08);
    object-fit: contain;
    padding: 5px;
    flex: 0 0 auto;
}

.brand-block strong {
    display: block;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.15;
}

.brand-block span {
    display: block;
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 700;
}

.brand-block > div,
.side-link > span:not(.nav-icon):not(.submenu-arrow),
.side-sub-link,
.side-section,
.sidebar-foot span,
.sidebar-foot strong,
.sidebar-foot a {
    transition: opacity .18s ease, transform .18s ease;
}

.side-nav {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: start;
    gap: 5px;
    padding: 8px 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.side-section {
    margin: 16px 12px 6px;
    color: #9aa7af;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .02em;
}

.side-link {
    position: relative;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    color: #818d95;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.side-group {
    border-radius: 14px;
}

.side-group[open] {
    background: linear-gradient(180deg, rgba(17, 140, 68, .035), transparent);
}

.side-group summary {
    list-style: none;
}

.side-group summary::-webkit-details-marker {
    display: none;
}

.side-group .side-link {
    cursor: pointer;
}

.side-link:hover,
.side-link.active {
    color: var(--primary-color);
    background: rgba(17, 140, 68, .075);
    border-color: rgba(17, 140, 68, .08);
}

.side-link.active::before {
    content: "";
    position: absolute;
    inset-inline-end: -14px;
    top: 8px;
    bottom: 8px;
    width: 5px;
    border-radius: 999px 0 0 999px;
    background: var(--primary-color);
}

/* إطار هوية متحرك للصفحة المختارة من دون تغيير أبعاد عناصر القائمة. */
.side-nav > .side-link.active:not(.side-link-biometric),
.side-sub-link.active:not(.side-sub-link-biometric) {
    border-color: transparent;
    background:
        linear-gradient(rgba(244, 252, 247, .96), rgba(244, 252, 247, .96)) padding-box,
        linear-gradient(105deg,
            rgba(17, 140, 68, .22),
            #118c44,
            #fcdb06,
            #118c44,
            rgba(17, 140, 68, .22)) border-box;
    background-size: 100% 100%, 240% 100%;
    background-position: 0 0, 100% 0;
    box-shadow: 0 7px 18px rgba(17, 140, 68, .11), inset 0 0 0 1px rgba(255, 255, 255, .5);
    animation: sidebarActiveBorderFlow 3.2s linear infinite;
}

@keyframes sidebarActiveBorderFlow {
    to { background-position: 0 0, -140% 0; }
}

/* تأثير البصمة يظهر فقط عندما تكون صفحة كشف البصمة مفتوحة. */
.side-sub-link-biometric.active {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 38px;
    color: #0d6933;
    border: 0;
    background: transparent;
    box-shadow: 0 7px 18px rgba(17, 140, 68, .09);
    transform: none;
}

.side-sub-link-biometric.active::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: -220px;
    width: auto;
    border-radius: 0;
    background: conic-gradient(
        from 0deg,
        rgba(17, 140, 68, .1) 0deg,
        rgba(17, 140, 68, .14) 235deg,
        rgba(43, 211, 105, .98) 292deg,
        #118c44 326deg,
        rgba(17, 140, 68, .1) 360deg
    );
    animation: biometricBorderOrbit 3.4s linear infinite;
}

.side-sub-link-biometric.active::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 2px;
    border-radius: 10px;
    background: rgba(248, 253, 250, .96);
    box-shadow: inset 0 0 18px rgba(17, 140, 68, .055);
}

.side-sub-link-biometric.active > span {
    position: relative;
    z-index: 2;
}

.side-sub-link-biometric.active:hover {
    color: #08672e;
    background: transparent;
    border-color: transparent;
    box-shadow: 0 9px 22px rgba(17, 140, 68, .16);
    transform: none;
}

.side-sub-link-biometric.active .sub-icon {
    position: relative;
    color: #118c44;
    filter: drop-shadow(0 0 5px rgba(43, 211, 105, .34));
    animation: biometricFingerprintPulse 1.8s ease-in-out infinite;
}

.side-sub-link-biometric.active .sub-icon::after {
    content: "";
    position: absolute;
    inset-inline: 2px;
    top: 2px;
    height: 2px;
    border-radius: 99px;
    background: #2bd369;
    box-shadow: 0 0 7px rgba(43, 211, 105, .9);
    opacity: .85;
    animation: biometricScanLine 1.85s ease-in-out infinite;
}

.side-sub-link-biometric.active .nav-svg path {
    stroke-dasharray: 7 3;
    animation: biometricFingerprintTrace 2.5s linear infinite;
}

@keyframes biometricBorderOrbit {
    to { transform: rotate(1turn); }
}

@keyframes biometricFingerprintPulse {
    0%, 100% { transform: scale(.94); opacity: .72; }
    48% { transform: scale(1.1); opacity: 1; }
}

@keyframes biometricScanLine {
    0%, 100% { transform: translateY(1px); opacity: .2; }
    50% { transform: translateY(16px); opacity: 1; }
}

@keyframes biometricFingerprintTrace {
    to { stroke-dashoffset: -30; }
}

@media (prefers-reduced-motion: reduce) {
    .side-nav > .side-link.active:not(.side-link-biometric),
    .side-sub-link.active:not(.side-sub-link-biometric),
    .side-sub-link-biometric.active::before,
    .side-sub-link-biometric.active .sub-icon,
    .side-sub-link-biometric.active .sub-icon::after,
    .side-sub-link-biometric.active .nav-svg path {
        animation: none;
    }
}

.submenu-arrow {
    margin-inline-start: auto;
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: #9aa7af;
    font-size: 14px;
    transition: transform .2s ease;
}

.side-group[open] .submenu-arrow {
    transform: rotate(180deg);
}

.side-group[open] .side-submenu {
    animation: sidebarSubmenuIn .16s ease both;
}

@keyframes sidebarSubmenuIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.side-submenu {
    position: relative;
    display: grid;
    gap: 2px;
    margin: 3px 32px 8px 6px;
    padding: 3px 0 3px 10px;
    border-inline-end: 1px solid rgba(17, 140, 68, .22);
    background: transparent;
    border-radius: 0;
}

.side-submenu::before,
.side-submenu::after {
    content: "";
    position: absolute;
    inset-inline-end: -1px;
    width: 1px;
    height: 14px;
    background: rgba(17, 140, 68, .22);
}

.side-submenu::before {
    top: 0;
    border-start-start-radius: 99px;
}

.side-submenu::after {
    bottom: 0;
    border-end-start-radius: 99px;
}

.side-sub-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #65727c;
    font-size: 12px;
    font-weight: 900;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.sub-icon {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: #93a1aa;
}

.side-sub-link:hover {
    background: rgba(17, 140, 68, .075);
    color: var(--primary-color);
    transform: translateX(-2px);
}

.side-sub-link.active {
    color: var(--primary-color);
    transform: translateX(-2px);
}

.nav-icon,
.search-icon,
.bell-icon,
.top-icon {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.nav-svg {
    width: 20px;
    height: 20px;
}

.sub-icon .nav-svg {
    width: 16px;
    height: 16px;
}

.search-icon::before,
.bell-icon::before,
.top-icon::before {
    font-size: 18px;
    line-height: 1;
}

.search-icon::before { content: "⌕"; }
.bell-icon::before { content: "◌"; }
.top-icon-menu::before { content: "☰"; }
.top-icon-bell::before { content: "◌"; }
.top-icon-chevron::before { content: "⌄"; font-size: 13px; }

.sidebar-foot {
    position: relative;
    z-index: 1;
    margin-top: auto;
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 18px;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(17, 140, 68, .96), rgba(13, 105, 51, .98)),
        linear-gradient(90deg, rgba(255, 255, 255, .08), transparent);
    overflow: hidden;
}

.sidebar-foot span,
.sidebar-foot strong,
.sidebar-foot a {
    display: block;
}

.sidebar-foot span {
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
    font-weight: 800;
}

.sidebar-foot strong {
    color: #fff;
    font-size: 14px;
}

.sidebar-foot a {
    margin-top: 4px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--primary-dark);
    background: #fff;
    font-size: 12px;
    font-weight: 900;
}

.main-panel {
    min-height: 100vh;
    margin-right: calc(var(--sidebar-width) + 36px);
    transition: margin-right .22s ease;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    padding-inline: 12px;
}

body.sidebar-collapsed .main-panel {
    margin-right: calc(var(--sidebar-collapsed-width) + 36px);
}

body.sidebar-collapsed .brand-block {
    justify-content: center;
    padding-inline: 8px;
}

body.sidebar-collapsed .brand-logo {
    width: 42px;
    height: 42px;
}

body.sidebar-collapsed .brand-block > div,
body.sidebar-collapsed .side-section,
body.sidebar-collapsed .side-link > span:not(.nav-icon):not(.submenu-arrow),
body.sidebar-collapsed .submenu-arrow,
body.sidebar-collapsed .side-submenu,
body.sidebar-collapsed .sidebar-foot span,
body.sidebar-collapsed .sidebar-foot strong,
body.sidebar-collapsed .sidebar-foot a {
    display: none;
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
}

body.sidebar-collapsed .side-section,
body.sidebar-collapsed .side-submenu {
    display: none;
}

body.sidebar-collapsed .side-link {
    justify-content: center;
    padding-inline: 10px;
}

body.sidebar-collapsed .side-nav {
    padding-inline: 0;
}

body.sidebar-collapsed .sidebar-foot {
    min-height: 50px;
    padding: 10px;
}

body.sidebar-collapsed .sidebar-foot::before {
    content: "سنة";
    display: grid;
    place-items: center;
    min-height: 28px;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
    font-weight: 800;
}

.topbar {
    position: sticky;
    top: 12px;
    z-index: 30;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 14px 24px 0;
    padding: 12px 18px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(216, 224, 227, .84);
    border-radius: 24px;
    box-shadow: 0 16px 36px rgba(31, 41, 51, .055);
}

.icon-button,
.notification-button {
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    border-radius: var(--radius-md);
    min-width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.sidebar-toggle {
    display: inline-grid;
}

.global-search {
    position: relative;
    flex: 1;
    max-width: 680px;
}

.global-search input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 44px 0 16px;
    background: var(--surface-color);
    color: var(--text-color);
    outline: none;
}

.global-search input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(252, 219, 6, .12);
}

.global-search .search-icon {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-color);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    display: none;
    overflow: hidden;
    z-index: 80;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    border-inline: 0;
    border-top: 0;
    background: #fff;
    width: 100%;
    color: var(--text-color);
    cursor: pointer;
    text-align: right;
}

.search-result-item:last-child {
    border-bottom: 0;
}

.top-actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-menu {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    inset-block-start: calc(100% + 10px);
    inset-inline-start: 0;
    width: min(420px, calc(100vw - 28px));
    max-height: 76vh;
    overflow-y: auto;
    display: none;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    z-index: 90;
}

.dropdown-menu.active .dropdown-panel,
.user-menu.active .dropdown-panel {
    display: block;
}

.dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-head strong {
    font-family: var(--font-heading);
    font-size: 18px;
}

.dropdown-head span {
    color: var(--muted-color);
    font-size: 12px;
}

.notification-button {
    position: relative;
}

.notification-badge {
    position: absolute;
    inset-block-start: -6px;
    inset-inline-start: -6px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--danger-color);
    color: #fff;
    font-size: 11px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    cursor: pointer;
}

.user-chip img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: contain;
}

.user-chip strong,
.user-chip span {
    display: block;
}

.user-chip strong {
    font-size: 13px;
}

.user-chip span {
    color: var(--muted-color);
    font-size: 11px;
}

.logout-link {
    color: var(--danger-color);
    font-weight: 700;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.notification-section {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.notification-section:last-child {
    border-bottom: 0;
}

.notification-section h3 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--muted-color);
}

.online-count {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    margin-inline-start: 5px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: #e5f6eb;
    font-size: 11px;
}

.notification-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    color: var(--text-color);
}

.notification-item:hover {
    background: #f7fafb;
}

.notification-item strong,
.notification-item small {
    display: block;
}

.notification-item strong {
    font-size: 13px;
}

.notification-item small {
    color: var(--muted-color);
    font-size: 11px;
}

.notification-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    margin-top: 8px;
    background: var(--warning-color);
    flex: 0 0 auto;
}

.notification-dot.info {
    background: var(--accent-color);
}

.notification-dot.success {
    background: var(--success-color);
    box-shadow: 0 0 0 3px rgba(17, 140, 68, 0.12);
}

.notification-item.danger .notification-dot {
    background: var(--danger-color);
}

.notification-empty {
    padding: 12px;
    color: var(--muted-color);
    font-size: 12px;
}

.user-menu {
    position: relative;
}

.user-dropdown {
    inset-inline-start: auto;
    inset-inline-end: 0;
    width: min(310px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
}

.user-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
}

.user-card-head img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: contain;
}

.user-card-head strong,
.user-card-head span {
    display: block;
}

.user-card-head span {
    color: var(--muted-color);
    font-size: 12px;
}

.user-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
}

.user-details span {
    color: var(--muted-color);
    font-size: 12px;
}

.user-details strong {
    font-size: 12px;
    text-align: left;
    overflow-wrap: anywhere;
}

.user-menu-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
}

.content-panel {
    width: min(100%, 1640px);
    margin: 0 auto;
    padding: 24px 30px 44px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.page-heading::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: -1px;
    width: 92px;
    height: 2px;
    background: var(--secondary-color);
}

.page-heading h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 30px;
    line-height: 1.25;
    font-weight: 800;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted-color);
    font-size: 12px;
    margin-top: 4px;
}

.dashboard-grid,
.layout-grid,
.filter-grid,
.form-grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin-bottom: 18px;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    min-height: 116px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block: 18px;
    width: 3px;
    border-radius: 999px;
    background: var(--primary-color);
}

.metric-card.gold::after { background: var(--secondary-color); }
.metric-card.red::after { background: var(--danger-color); }
.metric-card.green::after { background: var(--success-color); }
.metric-card.blue::after { background: var(--accent-color); }

.metric-card span:not(.metric-icon) {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 5px;
    color: var(--text-color);
    font-size: 22px;
    line-height: 1.35;
}

.metric-icon {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius-md);
    color: var(--primary-color);
    background: rgba(17, 140, 68, .1);
    flex: 0 0 auto;
}

.metric-card.gold .metric-icon { color: var(--primary-dark); background: rgba(252, 219, 6, .24); }
.metric-card.red .metric-icon { color: var(--danger-color); background: rgba(198, 61, 61, .12); }
.metric-card.green .metric-icon { color: var(--success-color); background: rgba(17, 140, 68, .12); }
.metric-card.blue .metric-icon { color: var(--primary-dark); background: rgba(252, 219, 6, .24); }

.metric-icon::before {
    font-size: 22px;
    line-height: 1;
}

.metric-students::before { content: "◎"; }
.metric-due::before { content: "◷"; }
.metric-late::before { content: "!"; font-weight: 900; }
.metric-cash::before { content: "د"; font-weight: 900; }
.metric-week::before { content: "▥"; }
.metric-balance::before { content: "▣"; }
.metric-month::before { content: "◫"; }

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, .75fr);
    gap: 16px;
    margin-bottom: 16px;
}

.chart-card-large canvas {
    min-height: 230px;
}

.two-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 16px;
}

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

.stat-card,
.card,
.login-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
}

.stat-card {
    min-height: 132px;
    padding: 17px;
    display: grid;
    align-content: space-between;
    border-top: 4px solid var(--primary-color);
}

.stat-card.gold { border-top-color: var(--secondary-color); }
.stat-card.green { border-top-color: var(--success-color); }
.stat-card.red { border-top-color: var(--danger-color); }
.stat-card.blue { border-top-color: var(--accent-color); }

.stat-card span {
    color: var(--muted-color);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin: 8px 0 2px;
    font-size: 23px;
    color: var(--text-color);
}

.stat-card small {
    color: var(--muted-color);
}

.card {
    padding: 18px;
    margin-bottom: 18px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.card-header h2,
.section-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
}

.toolbar {
    display: block;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fbfdfd;
}

.toolbar-actions,
.toolbar-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-actions:empty {
    display: none;
}

.toolbar-filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
    gap: 10px;
}

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

.payments-report-filter-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.payments-report-filter-fields > label {
    display: grid;
    gap: 5px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.payments-report-filter-fields input,
.payments-report-filter-fields select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-color);
    padding: 8px 12px;
}

.payments-report-filter-fields .student-select-search {
    min-width: 0;
}

.payments-report-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.account-create-modal {
    width: min(560px, calc(100vw - 32px));
}

.students-toolbar-actions {
    margin-bottom: 10px;
}

.toolbar > input[data-table-search] {
    width: 100%;
}

.btn {
    border: 1px solid transparent;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(31, 41, 51, .08);
}

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

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

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

.btn-light {
    background: #f7fafb;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-info {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 12px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
}

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

.table th,
.table td {
    padding: 12px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
    vertical-align: middle;
}

.table th {
    background: #f0f5f4;
    color: #2d3c43;
    font-size: 12px;
    font-weight: 800;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table th.sortable {
    cursor: pointer;
}

.table tbody tr:hover {
    background: #fbfdfd;
}

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

.table.compact {
    min-width: 520px;
}

.table.compact th,
.table.compact td {
    padding: 10px;
}

.muted {
    color: var(--muted-color);
    font-size: 12px;
    display: block;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 800;
}

.badge-success {
    background: rgba(17, 140, 68, .12);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(252, 219, 6, .15);
    color: #9c6610;
}

.badge-danger {
    background: rgba(198, 61, 61, .13);
    color: var(--danger-color);
}

.badge-muted {
    background: #edf0f2;
    color: #65727c;
}

.badge-info {
    background: rgba(252, 219, 6, .24);
    color: var(--primary-dark);
}

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

.action-group form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.table .action-group {
    min-width: max-content;
}

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

.form-grid label,
.form-grid .field {
    display: grid;
    gap: 6px;
}

.form-grid label.full,
.field.full,
.full,
.form-actions {
    grid-column: 1 / -1;
}

.form-grid span,
.field-title {
    color: #35454d;
    font-size: 13px;
    font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.toolbar input,
.toolbar select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-color);
    padding: 8px 12px;
    outline: none;
}

.form-grid textarea {
    min-height: 96px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 8px;
}

.filters-panel {
    display: none;
    margin-bottom: 14px;
    padding: 14px;
    background: #f9fbfb;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.filters-panel.active {
    display: block;
}

.advanced-filters {
    display: block;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #f9fbfb;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.advanced-filters summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 800;
    list-style: none;
}

.advanced-filters summary::-webkit-details-marker {
    display: none;
}

.advanced-filters form {
    margin-top: 14px;
}

.payments-board {
    margin: 0 auto 24px;
    padding: 18px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
}

.payments-searchbar {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    direction: ltr;
}

.payments-filter-control {
    position: static;
    flex: 0 0 auto;
}

.payments-filter-control summary {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--primary-color);
    cursor: pointer;
    list-style: none;
    box-shadow: var(--shadow-light);
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.payments-filter-control summary:hover,
.payments-filter-control[open] summary {
    border-color: rgba(17, 140, 68, .26);
    background: rgba(17, 140, 68, .07);
    color: var(--primary-color);
}

.payments-filter-control summary::-webkit-details-marker {
    display: none;
}

.payments-filter-control summary svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.payments-filter-panel {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline: 0;
    z-index: 40;
    width: auto;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    direction: rtl;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.payments-filter-panel label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.payments-filter-panel span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
}

.payments-filter-panel input,
.payments-filter-panel select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-color);
    padding: 7px 10px;
    outline: none;
}

.payments-filter-panel input:focus,
.payments-filter-panel select:focus {
    border-color: rgba(17, 140, 68, .45);
    box-shadow: 0 0 0 3px rgba(17, 140, 68, .10);
}

.payments-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
}

.payments-quick-search {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    direction: rtl;
    min-width: 0;
}

.payments-quick-search input {
    width: min(100%, 192px);
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--text-color);
    padding: 0 18px;
    outline: none;
    text-align: center;
    font-weight: 700;
}

.payments-quick-search input::placeholder {
    color: var(--muted-color);
    opacity: .58;
}

.payments-quick-search input:focus {
    border-color: rgba(17, 140, 68, .35);
    box-shadow: 0 0 0 4px rgba(17, 140, 68, .08);
}

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

.payments-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
    table-layout: auto;
}

.payments-table th {
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    padding: 10px 12px;
}

.payments-table th:first-child {
    border-start-start-radius: 22px;
    border-end-start-radius: 22px;
}

.payments-table th:last-child {
    border-start-end-radius: 22px;
    border-end-end-radius: 22px;
}

.payments-table td {
    height: 70px;
    padding: 13px 12px;
    border-bottom: 1px solid rgba(216, 224, 227, .72);
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
}

.payments-table tbody tr {
    position: relative;
}

.payments-table tbody tr:hover td,
.payments-table tbody tr:has(.row-actions[open]) td {
    background: rgba(17, 140, 68, .055);
}

.payments-table tbody tr:hover td:first-child,
.payments-table tbody tr:has(.row-actions[open]) td:first-child {
    border-start-start-radius: 28px;
    border-end-start-radius: 28px;
}

.payments-table tbody tr:hover td:last-child,
.payments-table tbody tr:has(.row-actions[open]) td:last-child {
    border-start-end-radius: 28px;
    border-end-end-radius: 28px;
}

.payments-table td strong {
    font-weight: 500;
}

.payment-pills {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    overflow: hidden;
    border-radius: 999px;
}

.payment-pill {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 13px;
    line-height: 1;
}

.payment-pill-status {
    background: rgba(17, 140, 68, .14);
    color: var(--success-color);
}

.payment-pill-method {
    background: rgba(252, 219, 6, .17);
    color: #765509;
}

.payment-method-bank_transfer,
.payment-method-card {
    background: rgba(252, 219, 6, .24);
    color: var(--primary-dark);
}

.payment-status-cancelled,
.payment-status-reversed {
    background: rgba(198, 61, 61, .12);
    color: var(--danger-color);
}

.payment-status-pending {
    background: rgba(252, 219, 6, .16);
    color: #795709;
}

.payment-amount {
    white-space: nowrap;
}

.payments-actions-cell {
    width: 86px;
}

.row-actions {
    position: relative;
    width: max-content;
    margin: 0 auto;
}

.row-actions summary {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    gap: 2px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--primary-color);
    cursor: pointer;
    list-style: none;
    box-shadow: 0 4px 10px rgba(31, 41, 51, .03);
}

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

.row-actions summary span {
    width: 4px;
    height: 4px;
    display: block;
    border-radius: 50%;
    background: currentColor;
}

.row-actions[open] summary {
    outline: 4px solid rgba(17, 140, 68, .13);
}

.row-actions-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 45;
    min-width: 118px;
    padding: 8px 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    text-align: right;
}

.row-actions-menu a {
    display: block;
    padding: 8px 14px;
    color: var(--text-color);
    font-size: 13px;
    white-space: nowrap;
}

.row-actions-menu a:hover {
    background: rgba(17, 140, 68, .06);
    color: var(--primary-color);
}

.row-actions-menu form {
    margin: 0;
}

.row-actions-menu button {
    width: 100%;
    display: block;
    border: 0;
    background: transparent;
    padding: 8px 14px;
    color: var(--danger-color);
    font: inherit;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
    cursor: pointer;
}

.row-actions-menu button:hover {
    background: #fff4f4;
}

.row-actions-menu .student-action-edit {
    color: var(--text-color);
}

.row-actions-menu .student-action-edit:hover {
    background: rgba(17, 140, 68, .06);
    color: var(--primary-color);
}

.row-actions-menu .danger-link {
    color: var(--danger-color);
}

.row-actions-menu .danger-link:hover {
    background: #fff4f4;
    color: var(--danger-color);
}

.payments-board .pagination {
    margin-top: 14px;
}

.installments-board {
    margin: 0 auto 24px;
    padding: 18px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
}

.installments-searchbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    direction: ltr;
}

.installments-pay-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 14px;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    box-shadow: var(--shadow-light);
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.installments-pay-button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.installments-pay-button span {
    font-size: 24px;
    line-height: 1;
}

.installments-filter-control {
    position: relative;
    width: max-content;
}

.installments-filter-control summary {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    list-style: none;
    box-shadow: var(--shadow-light);
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.installments-filter-control summary:hover,
.installments-filter-control[open] summary {
    border-color: rgba(17, 140, 68, .28);
    background: rgba(17, 140, 68, .07);
    color: var(--primary-color);
}

.installments-filter-control summary::-webkit-details-marker {
    display: none;
}

.installments-filter-control svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.installments-filter-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    width: min(620px, calc(100vw - 48px));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.installments-filter-panel label {
    display: grid;
    gap: 6px;
}

.installments-filter-panel span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
}

.installments-filter-panel input,
.installments-filter-panel select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-color);
    padding: 7px 10px;
    outline: none;
}

.installments-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
}

.installments-quick-search {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    direction: rtl;
    margin-inline-start: auto;
}

.installments-quick-search input {
    width: min(100%, 360px);
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-color);
    padding: 0 18px;
    outline: none;
    text-align: right;
    font-weight: 700;
}

.installments-search-submit {
    min-width: 82px;
    height: 38px;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 800;
}

.installments-search-submit:hover {
    background: var(--primary-dark);
}

.installments-quick-search input::placeholder {
    color: var(--muted-color);
    opacity: .58;
}

.installments-quick-search input:focus,
.installments-filter-panel input:focus,
.installments-filter-panel select:focus {
    border-color: rgba(17, 140, 68, .45);
    box-shadow: 0 0 0 3px rgba(17, 140, 68, .10);
}

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

.installments-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
    table-layout: auto;
}

.installments-table th {
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    padding: 10px 12px;
}

.installments-table th:first-child {
    border-start-start-radius: var(--radius-sm);
    border-end-start-radius: var(--radius-sm);
}

.installments-table th:last-child {
    border-start-end-radius: var(--radius-sm);
    border-end-end-radius: var(--radius-sm);
}

.installments-table td {
    height: 70px;
    padding: 13px 12px;
    border-bottom: 1px solid rgba(216, 224, 227, .72);
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
}

.installments-table tbody tr:hover td,
.installments-table tbody tr:has(.row-actions[open]) td {
    background: rgba(17, 140, 68, .055);
}

.installments-table tbody tr:hover td:first-child,
.installments-table tbody tr:has(.row-actions[open]) td:first-child {
    border-start-start-radius: var(--radius-sm);
    border-end-start-radius: var(--radius-sm);
}

.installments-table tbody tr:hover td:last-child,
.installments-table tbody tr:has(.row-actions[open]) td:last-child {
    border-start-end-radius: var(--radius-sm);
    border-end-end-radius: var(--radius-sm);
}

.installment-amount {
    white-space: nowrap;
}

.installment-status {
    min-width: 104px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 15px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 13px;
}

.installment-status-unpaid,
.installment-status-overdue {
    color: var(--danger-color);
    background: rgba(198, 61, 61, .12);
}

.installment-status-paid,
.installment-status-full_exempt {
    color: var(--success-color);
    background: rgba(17, 140, 68, .12);
}

.installment-status-partial,
.installment-status-partial_exempt {
    color: #795709;
    background: rgba(252, 219, 6, .16);
}

.installment-status-void {
    color: #5d6872;
    background: #e9ecef;
}

.installments-actions-cell {
    width: 86px;
}

.installments-board .pagination {
    margin-top: 14px;
}

.installment-pay-backdrop.active {
    display: grid;
    place-items: center;
}

.installment-pay-modal {
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    position: relative;
    padding: 26px 20px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    box-shadow: 0 24px 60px rgba(31, 41, 51, .24);
}

.installment-pay-close {
    position: absolute;
    top: 20px;
    left: 22px;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 2px solid #c74343;
    border-radius: 50%;
    background: #fff;
    color: #c74343;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    outline: 2px dashed rgba(252, 219, 6, .18);
    outline-offset: 6px;
}

.installment-pay-modal h2 {
    margin: 0 0 22px;
    text-align: right;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
}

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

.installment-pay-form label {
    display: grid;
    gap: 6px;
}

.installment-pay-form label > span {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 700;
}

.installment-pay-form input,
.installment-pay-form select,
.installment-pay-form textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-color);
    padding: 8px 14px;
    outline: none;
}

.installment-pay-form input[readonly] {
    color: #8290a2;
    background: #f8fbfa;
}

.student-combobox {
    position: relative;
}

.student-combobox input[type="search"] {
    padding-inline-end: 36px;
}

.student-combobox::after {
    content: "⌕";
    position: absolute;
    inset-block-start: 50%;
    inset-inline-end: 14px;
    transform: translateY(-50%);
    color: var(--muted-color);
    pointer-events: none;
    font-size: 15px;
}

.student-combobox-results {
    position: absolute;
    z-index: 30;
    inset-block-start: calc(100% + 6px);
    inset-inline: 0;
    display: none;
    max-height: 230px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.student-combobox-results.active {
    display: grid;
    gap: 4px;
}

.student-combobox-option,
.student-combobox-empty {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 9px 10px;
    text-align: right;
    cursor: pointer;
}

.student-combobox-option:hover,
.student-combobox-option:focus {
    background: rgba(17, 140, 68, .07);
    outline: none;
}

.student-combobox-option strong,
.student-combobox-option span {
    display: block;
}

.student-combobox-option strong {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.4;
}

.student-combobox-option span {
    color: var(--muted-color);
    font-size: 11px;
}

.student-combobox-empty {
    color: var(--muted-color);
    cursor: default;
}

/* Searchable student select used by reports and financial forms. */
.student-select-search {
    position: relative;
    min-width: min(100%, 260px);
}

.student-select-native {
    display: none !important;
}

.student-select-search-input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-color);
    padding: 8px 38px 8px 12px;
    outline: none;
}

.student-select-search::after {
    content: "⌕";
    position: absolute;
    inset-block-start: 10px;
    inset-inline-end: 13px;
    color: var(--muted-color);
    pointer-events: none;
}

.student-select-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 12%, transparent);
}

.student-select-search-results {
    position: absolute;
    z-index: 60;
    inset-block-start: calc(100% + 6px);
    inset-inline: 0;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.student-select-search-results.active {
    display: grid;
    gap: 3px;
}

.student-select-search-option {
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-color);
    padding: 9px 10px;
    text-align: right;
    font: inherit;
    cursor: pointer;
}

.student-select-search-option:hover,
.student-select-search-option:focus {
    background: color-mix(in srgb, var(--primary-color) 9%, transparent);
    outline: none;
}

.student-select-search-empty {
    padding: 10px;
    color: var(--muted-color);
    font-size: 13px;
}

.account-ledger-filter-card {
    overflow: visible;
}

.account-ledger-export-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.account-ledger-filter {
    display: grid;
    grid-template-columns: minmax(300px, 1.7fr) repeat(2, minmax(170px, .75fr)) auto;
    gap: 14px;
    align-items: end;
}

.account-ledger-filter label {
    display: grid;
    gap: 7px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
}

.account-ledger-filter .student-select-search {
    min-width: 100%;
}

.account-ledger-submit {
    min-height: 42px;
    min-width: 110px;
}

.account-ledger-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0 12px;
    padding: 2px 4px;
}

.account-ledger-heading span,
.account-ledger-heading p {
    color: var(--muted-color);
}

.account-ledger-heading h2 {
    margin: 3px 0;
    font-size: 21px;
}

.account-ledger-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.account-ledger-summary article {
    position: relative;
    display: grid;
    gap: 8px;
    min-height: 118px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.account-ledger-summary article::after {
    content: "";
    position: absolute;
    inset-block: 18px;
    inset-inline-end: 0;
    width: 3px;
    background: var(--primary-color);
}

.account-ledger-summary span,
.account-ledger-summary small {
    color: var(--muted-color);
    font-weight: 700;
}

.account-ledger-summary strong {
    align-self: end;
    font-size: 22px;
}

.account-ledger-summary .account-ledger-closing {
    border-color: color-mix(in srgb, var(--primary-color) 35%, var(--border-color));
    background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-color));
}

.account-ledger-results .table td {
    vertical-align: middle;
}

.account-ledger-results .btn-sm {
    min-height: 32px;
    padding: 5px 10px;
    white-space: nowrap;
}

.ledger-debit {
    color: var(--primary-dark);
    font-weight: 700;
}

.ledger-credit {
    color: #9b2525;
    font-weight: 700;
}

.ledger-balance-side {
    display: block;
    margin-top: 2px;
    color: var(--muted-color);
    font-size: 10px;
}

.account-ledger-welcome .empty-state {
    min-height: 240px;
}

.account-ledger-welcome .empty-state strong,
.account-ledger-welcome .empty-state span {
    display: block;
}

@media (max-width: 1050px) {
    .account-ledger-filter {
        grid-template-columns: 1fr 1fr;
    }

    .account-ledger-account-field {
        grid-column: 1 / -1;
    }

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

@media (max-width: 680px) {
    .account-ledger-filter,
    .account-ledger-summary {
        grid-template-columns: 1fr;
    }

    .account-ledger-account-field {
        grid-column: auto;
    }

    .account-ledger-submit {
        width: 100%;
    }

    .account-ledger-export-actions,
    .account-ledger-export-actions .btn {
        width: 100%;
    }
}

.trial-balance-filter-card {
    overflow: visible;
}

.trial-balance-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr)) auto auto auto auto;
    gap: 12px;
    align-items: end;
}

.trial-balance-filter > label:not(.trial-balance-check) {
    display: grid;
    gap: 7px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
}

.trial-balance-check {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    white-space: nowrap;
}

.trial-balance-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-color);
}

.trial-balance-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.trial-balance-status article {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-inline-end: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.trial-balance-status article > span,
.trial-balance-status article > small {
    color: var(--muted-color);
    font-weight: 700;
}

.trial-balance-status article > small {
    grid-column: 1 / -1;
}

.trial-balance-status .is-balanced strong {
    color: var(--primary-color);
}

.trial-balance-status .is-unbalanced {
    border-inline-end-color: #b52b2b;
}

.trial-balance-status .is-unbalanced strong {
    color: #b52b2b;
}

.trial-balance-status .is-partial {
    border-inline-end-color: var(--secondary-color);
}

.trial-balance-table thead tr:first-child th[colspan] {
    border-bottom-color: color-mix(in srgb, white 42%, transparent);
    text-align: center;
}

.trial-balance-table td:nth-last-child(-n + 6),
.trial-balance-table th:nth-last-child(-n + 6) {
    white-space: nowrap;
}

.trial-balance-table tfoot td,
.trial-balance-print-table tfoot td {
    font-weight: 800;
}

.trial-balance-print-table {
    font-size: 7.4px;
}

.trial-balance-print-table th,
.trial-balance-print-table td {
    padding: .9mm .7mm;
}

@media (max-width: 1180px) {
    .trial-balance-filter {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 720px) {
    .trial-balance-filter,
    .trial-balance-status {
        grid-template-columns: 1fr;
    }

    .trial-balance-filter .btn {
        width: 100%;
    }
}

.installment-pay-form textarea {
    min-height: 96px;
    resize: vertical;
}

.installment-pay-form .full {
    grid-column: 1 / -1;
}

.pay-checkbox {
    grid-column: 1 / -1;
    display: flex !important;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    color: #b4c0d3;
}

.pay-checkbox input {
    width: 20px;
    height: 20px;
    min-height: 0;
    padding: 0;
}

.pay-fill-actions {
    display: grid;
    align-content: end;
}

.pay-fill-actions button {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(17, 140, 68, .28);
    border-radius: var(--radius-sm);
    background: rgba(17, 140, 68, .08);
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 800;
}

.pay-fill-actions button:hover {
    background: rgba(17, 140, 68, .14);
}

.installment-choice-list {
    display: grid;
    gap: 8px;
    max-height: 190px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #f8fbfa;
}

.installment-choice-empty {
    padding: 10px;
    color: var(--muted-color);
    text-align: center;
}

.installment-choice-item {
    display: flex !important;
    flex-direction: row-reverse;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    cursor: pointer;
}

.installment-choice-item:hover {
    background: rgba(17, 140, 68, .05);
}

.installment-choice-item:has(input:checked) {
    border-color: rgba(17, 140, 68, .42);
    background: rgba(17, 140, 68, .08);
}

.installment-choice-item input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    min-height: auto;
    margin-top: 3px;
    padding: 0;
}

.installment-choice-item span {
    padding: 0 !important;
}

.installment-choice-item strong,
.installment-choice-item small {
    display: block;
}

.installment-choice-item strong {
    color: var(--text-color);
    font-size: 13px;
}

.installment-choice-item small {
    color: var(--muted-color);
    font-size: 11px;
}

.installment-pay-submit {
    min-width: 78px;
    min-height: 40px;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}

.installment-show-card {
    width: 100%;
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    box-shadow: var(--shadow-light);
}

.student-profile-page {
    width: min(100%, 1280px);
    margin: 0 auto 26px;
    display: grid;
    gap: 16px;
}

.student-profile-hero {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-light);
}

.student-profile-cover {
    position: relative;
    min-height: 150px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 20%, rgba(255, 255, 255, .12), transparent 28%),
        linear-gradient(135deg, #063F1E 0%, var(--primary-dark) 52%, var(--primary-color) 100%);
}

.student-profile-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 34px);
}

.student-profile-cover img {
    width: 138px;
    max-height: 82px;
    object-fit: contain;
    opacity: .38;
    filter: saturate(.8);
    z-index: 1;
}

.student-profile-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 18px;
    padding: 0 28px 24px;
    margin-top: -58px;
}

.student-profile-avatar {
    position: relative;
    z-index: 1;
    width: 128px;
    height: 128px;
    border: 5px solid #fff;
    border-radius: 50%;
    background: #fff;
    object-fit: cover;
    box-shadow: 0 16px 28px rgba(31, 41, 51, .18);
}

.student-profile-title {
    padding-top: 64px;
}

.student-profile-title > span {
    display: inline-flex;
    margin-bottom: 4px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.student-profile-title h2 {
    margin: 0;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 900;
}

.student-profile-title p {
    margin: 3px 0 10px;
    color: #697690;
    font-size: 14px;
    font-weight: 700;
}

.student-profile-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding-bottom: 4px;
}

.profile-action,
.profile-row-action {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(17, 140, 68, .22);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-color);
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 900;
}

.profile-action.primary,
.profile-row-action:hover {
    background: #eaf7ef;
    border-color: rgba(17, 140, 68, .32);
}

.student-profile-info {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, .86);
    box-shadow: var(--shadow-light);
}

.student-profile-info.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 8px;
    box-shadow: none;
}

.student-profile-info div {
    min-height: 66px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 10px 16px;
    border-inline-start: 1px solid var(--border-color);
}

.student-profile-info div:last-child {
    border-inline-start: 0;
}

.student-profile-info span,
.student-finance-strip span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.student-profile-info strong,
.student-finance-strip strong {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 900;
}

.student-profile-switch,
.student-profile-tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(216, 224, 227, .72);
}

.student-profile-switch.has-financial-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.student-profile-switch a,
.student-profile-tabs a {
    min-height: 40px;
    display: grid;
    place-items: center;
    color: #324052;
    font-weight: 900;
}

.student-profile-switch a.is-active,
.student-profile-tabs a.is-active {
    background: rgba(17, 140, 68, .14);
    color: var(--primary-color);
    box-shadow: inset 0 -3px 0 var(--primary-color);
}

.student-finance-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-light);
}

.student-finance-strip div {
    min-height: 66px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 10px 16px;
    border-inline-start: 1px solid var(--border-color);
}

.student-finance-strip div:last-child {
    border-inline-start: 0;
}

.student-profile-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    box-shadow: var(--shadow-light);
    scroll-margin-top: 92px;
}

.student-profile-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px 14px;
}

.student-profile-section-head h3 {
    margin: 0;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 19px;
}

.student-profile-section-head span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.student-report-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.student-report-actions .profile-row-action {
    min-height: 32px;
    padding: 5px 10px;
}

.students-directory-table th:last-child,
.students-directory-table td:last-child {
    width: 92px;
    text-align: center;
}

.students-directory-table td {
    vertical-align: middle;
}

.student-code-cell,
.student-phone-cell {
    color: var(--text-color);
    font-weight: 800;
    white-space: nowrap;
}

.student-name-cell {
    display: grid;
    gap: 3px;
    color: var(--text-color);
}

.student-name-cell:hover strong {
    color: var(--primary-color);
}

.student-name-cell span {
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 700;
}

.student-actions-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.student-actions-trigger {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-content: center;
    gap: 3px;
    padding: 0;
    border: 1px solid #d8e4dc;
    border-radius: 50%;
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(27, 66, 45, .06);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.student-actions-trigger span {
    width: 4px;
    height: 4px;
    display: block;
    border-radius: 50%;
    background: currentColor;
}

.student-actions-trigger:hover,
.student-actions-trigger:focus-visible,
.student-actions-dropdown.is-open .student-actions-trigger {
    border-color: rgba(17, 140, 68, .42);
    background: #eef9f2;
    box-shadow: 0 0 0 4px rgba(17, 140, 68, .1), 0 8px 18px rgba(27, 66, 45, .09);
    outline: 0;
    transform: translateY(-1px);
}

.student-actions-panel {
    position: fixed;
    z-index: 130;
    width: 220px;
    overflow: hidden;
    padding: 6px;
    border: 1px solid #d9e5de;
    border-radius: 8px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 42px rgba(25, 55, 39, .18);
    text-align: right;
    animation: studentActionsIn .16s ease-out both;
}

.payment-actions-panel {
    width: 232px;
}

.student-actions-panel[hidden] {
    display: none;
}

.student-actions-head {
    display: grid;
    gap: 1px;
    margin: 0 4px 5px;
    padding: 7px 9px 9px;
    border-bottom: 1px solid #e6ede9;
}

.student-actions-head strong {
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 13px;
}

.student-actions-head span {
    color: var(--muted-color);
    font-size: 10px;
    font-weight: 700;
}

.student-actions-panel form {
    margin: 0;
}

.student-actions-item {
    width: 100%;
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-color);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    text-align: right;
    cursor: pointer;
    white-space: nowrap;
    transition: color .16s ease, background .16s ease;
}

.student-actions-item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.student-actions-item:hover,
.student-actions-item:focus-visible {
    background: #eef9f2;
    color: var(--primary-color);
    outline: 0;
}

.student-actions-item.danger {
    color: var(--danger-color);
}

.student-actions-item.danger svg {
    stroke: var(--danger-color);
}

.student-actions-item.danger:hover,
.student-actions-item.danger:focus-visible {
    background: #fff2f2;
    color: var(--danger-color);
}

@keyframes studentActionsIn {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.student-quick-edit-modal {
    width: min(100%, 520px);
}

.student-quick-edit-modal .modal-header p {
    margin: 3px 0 0;
}

.student-academic-overview {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.student-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--border-color);
}

.student-details-grid > div {
    min-height: 76px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface-color);
}

.student-details-grid > div.full {
    grid-column: 1 / -1;
}

.student-details-grid span,
.student-financial-toolbar span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
}

.student-details-grid strong {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 800;
}

.student-finance-summary strong {
    font-size: 17px;
}

.student-financial-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, .84);
}

.student-financial-toolbar > div:first-child {
    display: grid;
    gap: 2px;
}

.student-financial-toolbar strong {
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 16px;
}

.student-payments-table .payment-pills {
    justify-content: center;
}

.profile-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
}

.profile-table th {
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    padding: 9px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.profile-table th:first-child {
    border-start-start-radius: 20px;
    border-end-start-radius: 20px;
}

.profile-table th:last-child {
    border-start-end-radius: 20px;
    border-end-end-radius: 20px;
}

.profile-table td {
    min-height: 58px;
    padding: 13px 12px;
    border-bottom: 1px solid #edf1f0;
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
}

.profile-table tbody tr:hover td {
    background: #f2fbf5;
}

.installment-show-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.installment-show-head span {
    color: var(--muted-color);
    font-size: 13px;
}

.installment-show-head strong {
    display: block;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 19px;
}

.installment-show-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.installment-show-card h2 {
    margin: 0 0 14px;
    font-family: var(--font-heading);
    font-size: 19px;
}

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

.vouchers-board {
    width: min(100%, 1280px);
    margin: 0 auto 24px;
    padding: 18px;
    border: 1px solid #dce7e3;
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow-light);
}

.voucher-type-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.voucher-type-tabs a {
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #dfe9e5;
    border-radius: 999px;
    background: #fff;
    color: #314155;
    font-weight: 900;
}

.voucher-type-tabs a.active,
.voucher-type-tabs a:hover {
    border-color: rgba(17, 140, 68, .28);
    background: #eaf7ef;
    color: var(--success-color);
}

.vouchers-searchbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    direction: rtl;
}

.vouchers-add-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    padding: 8px 18px;
    cursor: pointer;
    font-weight: 900;
}

.vouchers-add-button span {
    font-size: 22px;
    line-height: 1;
}

.vouchers-filter-control {
    position: relative;
}

.vouchers-filter-control summary {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #dce4ea;
    border-radius: 50%;
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    list-style: none;
}

.vouchers-filter-control summary::-webkit-details-marker {
    display: none;
}

.vouchers-filter-control svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.vouchers-filter-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 55;
    width: min(720px, calc(100vw - 40px));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid #dce7e3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(31, 41, 51, .16);
}

.vouchers-filter-panel label {
    display: grid;
    gap: 5px;
}

.vouchers-filter-panel span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.vouchers-filter-panel input,
.vouchers-filter-panel select,
.vouchers-quick-search input,
.voucher-form input,
.voucher-form select,
.voucher-form textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid #dce4ea;
    border-radius: 14px;
    background: #fff;
    color: var(--text-color);
    padding: 8px 13px;
    outline: none;
}

.field-error {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(188, 56, 45, .12) !important;
}

.permissions-hero {
    width: min(100%, 1280px);
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid rgba(17, 140, 68, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .78);
    box-shadow: var(--shadow-light);
    padding: 18px 20px;
}

.permissions-hero h2 {
    margin: 0 0 6px;
    color: var(--text-color);
    font-size: 22px;
    font-weight: 900;
}

.permissions-hero p {
    margin: 0;
    color: var(--muted-color);
    font-weight: 700;
}

.permissions-hero-stat {
    min-width: 130px;
    display: grid;
    gap: 4px;
    justify-items: center;
    border: 1px solid #dbe8e1;
    border-radius: 8px;
    background: #f5fbf7;
    padding: 12px;
}

.permissions-hero-stat span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.permissions-hero-stat strong {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 900;
}

.inline-permission-form {
    display: grid;
    grid-template-columns: minmax(135px, .8fr) minmax(210px, 1.2fr) minmax(115px, .7fr) minmax(130px, .8fr) auto;
    gap: 8px;
    align-items: center;
}

.user-role-cashbox {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.user-role-cashbox > span {
    overflow: hidden;
    color: var(--primary-dark);
    font-size: 10px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.school-assignment-select {
    min-height: 92px;
    border-radius: 14px !important;
    padding: 8px !important;
}

.school-assignment-select option {
    padding: 6px 8px;
    border-radius: 8px;
}

.school-assignment-field {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(17, 140, 68, .025);
}

.school-assignment-field legend {
    padding: 0 8px;
    color: var(--text-color);
    font-weight: 900;
}

.school-assignment-field > small {
    display: block;
    margin-top: 10px;
    color: var(--muted-color);
    line-height: 1.7;
}

.school-assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.school-assignment-option,
.school-assignment-compact label {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    border: 1px solid rgba(17, 140, 68, .13);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    background: #fff;
    cursor: pointer;
}

.school-assignment-option {
    min-height: 44px;
    padding: 9px 11px;
}

.school-assignment-option:has(input:checked),
.school-assignment-compact label:has(input:checked) {
    border-color: rgba(17, 140, 68, .42);
    color: var(--primary-dark);
    background: rgba(17, 140, 68, .075);
}

.school-assignment-option input,
.school-assignment-compact input {
    width: 17px;
    height: 17px;
    min-height: 17px;
    margin: 0;
    padding: 0;
    border-radius: 4px;
    accent-color: var(--primary-color);
    flex: 0 0 auto;
}

.school-assignment-compact {
    max-height: 132px;
    display: grid;
    gap: 5px;
    padding: 5px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fbfdfc;
}

.school-assignment-compact label {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 11px;
}

.school-assignment-global {
    min-height: 56px;
    display: grid;
    align-content: center;
    padding: 8px 10px;
    border: 1px solid rgba(17, 140, 68, .16);
    border-radius: var(--radius-sm);
    background: rgba(17, 140, 68, .06);
}

.school-assignment-global-settings {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.school-assignment-global strong,
.school-assignment-global span {
    display: block;
}

.school-assignment-global strong {
    color: var(--primary-dark);
    font-size: 12px;
}

.school-assignment-global span {
    margin-top: 2px;
    color: var(--muted-color);
    font-size: 10px;
}

.permissions-role-list,
.permissions-user-list {
    display: grid;
    gap: 12px;
}

.permission-panel {
    border: 1px solid #dfe9e5;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.permission-panel > summary {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
}

.permission-panel > summary::-webkit-details-marker {
    display: none;
}

.permission-panel > summary strong {
    color: var(--text-color);
    font-weight: 900;
}

.permission-panel > summary span {
    color: var(--muted-color);
    font-size: 13px;
    font-weight: 700;
}

.permission-panel[open] > summary {
    border-bottom: 1px solid #edf2ef;
    background: #f7fbf8;
}

.permission-panel form {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.permission-module {
    display: grid;
    gap: 10px;
}

.permission-module h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 900;
}

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

.permission-check-grid label {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e3ebe7;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    font-weight: 800;
}

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

.permission-state-grid label {
    display: grid;
    gap: 6px;
    border: 1px solid #e3ebe7;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.permission-state-grid label > span {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 900;
}

.vouchers-filter-actions {
    display: flex;
    align-items: end;
    gap: 8px;
}

.vouchers-quick-search {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vouchers-quick-search input {
    width: 220px;
    border-radius: 999px;
    text-align: center;
    font-weight: 800;
}

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

.vouchers-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
}

.vouchers-table th {
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    padding: 9px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.vouchers-table th:first-child {
    border-start-start-radius: 20px;
    border-end-start-radius: 20px;
}

.vouchers-table th:last-child {
    border-start-end-radius: 20px;
    border-end-end-radius: 20px;
}

.vouchers-table td {
    min-height: 64px;
    padding: 13px 12px;
    border-bottom: 1px solid #edf1f0;
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
}

.vouchers-table tbody tr:hover td,
.vouchers-table tbody tr:has(.row-actions[open]) td {
    background: #f2fbf5;
}

.voucher-statement-cell {
    max-width: 250px;
    color: #43515f;
    text-align: right !important;
}

.vouchers-actions-cell {
    width: 84px;
}

.vouchers-board .pagination {
    margin-top: 14px;
}

.voucher-modal {
    width: min(860px, calc(100vw - 28px));
}

.voucher-form {
    display: grid;
    gap: 12px;
}

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

.voucher-fixed-type {
    min-height: 38px;
    display: grid;
    gap: 3px;
    align-content: center;
    border: 1px solid rgba(17, 140, 68, .18);
    border-radius: 14px;
    background: #f3fbf6;
    padding: 8px 13px;
}

.voucher-fixed-type span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.voucher-fixed-type strong {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 900;
}

.voucher-dynamic-section[hidden] {
    display: none;
}

.voucher-form label {
    display: grid;
    gap: 6px;
}

.voucher-form label > span {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 800;
}

.voucher-form .full,
.journal-receivers.full {
    grid-column: 1 / -1;
}

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

.journal-receivers {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid #dce7e3;
    border-radius: 8px;
    background: #fbfdfc;
}

.journal-receivers-head,
.journal-receiver-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.journal-receivers-head {
    grid-template-columns: 1fr auto;
}

.journal-receiver-row {
    grid-template-columns: minmax(0, 1.5fr) minmax(150px, .7fr) auto;
}

.journal-receiver-row button {
    min-height: 38px;
    border: 1px solid rgba(198, 61, 61, .22);
    border-radius: 12px;
    background: #fff4f4;
    color: var(--danger-color);
    cursor: pointer;
    padding: 6px 12px;
    font-weight: 800;
}

/* Dedicated journal voucher workspace. */
.journal-board {
    width: min(100%, 1280px);
    margin: 0 auto 26px;
    padding: 20px;
    border: 1px solid #dce7e3;
    border-radius: 8px;
    background: rgba(255, 255, 255, .84);
    box-shadow: var(--shadow-light);
}

.journal-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.journal-page-head h2 {
    margin: 0 0 5px;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 23px;
}

.journal-page-head p,
.journal-query-summary {
    margin: 0;
    color: var(--muted-color);
    font-size: 13px;
    font-weight: 700;
}

.journal-primary-actions,
.journal-query-summary,
.journal-form-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.journal-query-summary {
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 11px 13px;
    border: 1px solid #e1ebe6;
    border-radius: 8px;
    background: #f7fbf8;
}

.journal-query-summary strong {
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.journal-query-modal {
    width: min(560px, calc(100vw - 28px));
}

.journal-create-modal {
    width: min(1160px, calc(100vw - 28px));
}

.journal-date-query-form,
.journal-form-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

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

.journal-date-query-form label,
.journal-form-meta label {
    display: grid;
    gap: 6px;
}

.journal-date-query-form label span,
.journal-form-meta label span {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 900;
}

.journal-date-query-form input,
.journal-form-meta input,
.journal-entry-table input,
.journal-entry-table select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #dce4ea;
    border-radius: 10px;
    background: #fff;
    color: var(--text-color);
    padding: 8px 11px;
    outline: none;
}

.journal-date-query-form input:focus,
.journal-form-meta input:focus,
.journal-entry-table input:focus,
.journal-entry-table select:focus {
    border-color: rgba(17, 140, 68, .52);
    box-shadow: 0 0 0 3px rgba(17, 140, 68, .1);
}

.journal-statement-field {
    grid-column: span 2;
}

.journal-entry-wrap {
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid #dfe9e5;
    border-radius: 8px;
    background: #fff;
}

.journal-entry-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.journal-entry-table th {
    padding: 11px 10px;
    background: var(--primary-color);
    color: #fff;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
}

.journal-entry-table td {
    padding: 9px;
    border-bottom: 1px solid #edf1f0;
    text-align: center;
    vertical-align: middle;
}

.journal-entry-table td:first-child {
    width: 44px;
    color: var(--muted-color);
    font-weight: 900;
}

.journal-entry-table td:nth-child(2) {
    width: 30%;
}

.journal-entry-table td:nth-child(3),
.journal-entry-table td:nth-child(4) {
    width: 16%;
}

.journal-entry-table tfoot td {
    border-bottom: 0;
    background: #f7fbf8;
    color: var(--text-color);
    font-weight: 900;
}

.journal-entry-table .journal-difference-row td {
    background: #eef7f1;
    color: var(--primary-color);
}

#journalDifference.is-balanced {
    color: var(--success-color);
}

#journalDifference.is-unbalanced {
    color: var(--danger-color);
}

.journal-remove-entry {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(198, 61, 61, .24);
    border-radius: 8px;
    background: #fff7f7;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.journal-add-entry {
    margin: 11px;
}

.journal-form-actions {
    justify-content: flex-start;
    margin-top: 18px;
}

.cashboxes-page {
    width: min(100%, 1320px);
    margin: 0 auto 26px;
    display: grid;
    gap: 16px;
    font-family: var(--font-heading);
}

.cashboxes-reset-control {
    border: 1px solid rgba(198, 61, 61, .2);
    border-radius: var(--radius-md);
    background: #fffafa;
    overflow: hidden;
}

.cashboxes-reset-control summary {
    padding: 13px 16px;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
}

.cashboxes-reset-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 0 16px 16px;
}

.cashboxes-reset-form label {
    display: grid;
    gap: 6px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.cashboxes-reset-form input {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(198, 61, 61, .2);
    border-radius: 10px;
    background: #fff;
    color: var(--text-color);
    padding: 8px 12px;
    outline: none;
}

.cashboxes-reset-form input:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(198, 61, 61, .09);
}

.students-reset-control {
    width: min(100%, 1320px);
    margin: 0 auto 16px;
    border: 1px solid rgba(198, 61, 61, .2);
    border-radius: var(--radius-md);
    background: #fffafa;
    overflow: hidden;
}

.students-reset-control summary {
    padding: 14px 16px;
    color: var(--danger-color);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 900;
}

.students-reset-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 0 16px 16px;
}

.students-reset-form label {
    display: grid;
    gap: 6px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.students-reset-form input {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(198, 61, 61, .2);
    border-radius: 10px;
    background: #fff;
    color: var(--text-color);
    padding: 8px 12px;
    outline: none;
}

.students-reset-form input:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(198, 61, 61, .09);
}

.factory-reset-control {
    margin-top: 16px;
    border: 1px solid rgba(198, 61, 61, .28);
    border-radius: var(--radius-md);
    background: #fff8f8;
    overflow: hidden;
}

.factory-reset-control summary {
    padding: 15px 16px;
    color: var(--danger-color);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 900;
}

.factory-reset-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 0 16px 16px;
}

.factory-reset-form label {
    display: grid;
    gap: 6px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.factory-reset-form input {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(198, 61, 61, .26);
    border-radius: 10px;
    background: #fff;
    color: var(--text-color);
    padding: 8px 12px;
    outline: none;
}

.factory-reset-form input:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(198, 61, 61, .1);
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    white-space: nowrap;
}

.table-actions .inline-form {
    display: inline-flex;
    margin: 0;
}

.card-header p {
    margin: 4px 0 0;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
}

.cashboxes-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.cashboxes-overview .metric-card {
    min-width: 0;
    min-height: 104px;
    gap: 10px;
    padding: 14px;
}

.cashboxes-overview .metric-card > div {
    min-width: 0;
}

.cashboxes-overview .metric-card span:not(.metric-icon) {
    font-size: 13px;
    font-weight: 800;
}

.cashboxes-overview .metric-card strong {
    margin-top: 3px;
    font-size: 20px;
    white-space: nowrap;
}

.cashboxes-board {
    padding: 16px 18px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    box-shadow: var(--shadow-light);
}

.cashboxes-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.cashbox-user-balances {
    margin-bottom: 14px;
}

.cashboxes-board-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.cashbox-transfer-modal {
    width: min(720px, calc(100vw - 32px));
}

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

    .cashboxes-board-actions {
        width: 100%;
        justify-content: stretch;
    }

    .cashboxes-board-actions > * {
        flex: 1 1 220px;
    }
}

/* Human resources is intentionally administrative and visually separate from accounting. */
.hr-stats,
.hr-payroll-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.hr-filter-grid { grid-template-columns: 1.4fr repeat(3, minmax(150px, .7fr)) auto; align-items: end; margin-bottom: 16px; }
.hr-shifts { padding: 16px; border: 1px solid var(--border-color); border-right: 4px solid var(--primary-color); border-radius: 6px; background: #f8fbf9; }
.hr-shifts legend { padding: 0 8px; color: var(--primary-dark); font-family: var(--font-heading); font-weight: 800; }
.hr-payroll-table td:first-child strong,
.hr-payroll-table td:first-child small,
.hr-payroll-table td:nth-child(2) small { display: block; }
.hr-payroll-table small { margin-top: 3px; color: var(--muted-color); }
.hr-payroll-table input[type="number"] { width: 105px; min-width: 105px; }
.hr-payroll-table .table-money-input { width: 150px; min-width: 150px; }
.hr-payroll-table tfoot th { padding: 15px; color: #fff; background: var(--primary-dark); }
.hr-payroll-notes { padding-top: 16px; }
.hr-payroll-rollover { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-top:16px; border-inline-start:4px solid var(--primary-color); }
.hr-payroll-rollover > div > span { color:var(--primary-color); font-size:12px; font-weight:800; }
.hr-payroll-rollover h2 { margin:4px 0; font-size:19px; }
.hr-payroll-rollover p { margin:0; color:var(--muted-color); }
.hr-payroll-rollover form { margin:0; flex:0 0 auto; }
.attendance-stats { grid-template-columns:repeat(4,minmax(0,1fr)); margin-bottom:16px; }
.attendance-device-layout { display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); gap:16px; margin-bottom:16px; }
.attendance-token-reveal { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:16px; padding:18px; color:#fff; background:var(--primary-dark); border-inline-start:5px solid var(--accent-color); border-radius:7px; box-shadow:0 12px 28px rgba(13,105,51,.16); }
.attendance-token-reveal span { color:var(--accent-color); font-size:12px; font-weight:800; }
.attendance-token-reveal h2 { margin:4px 0; font-size:20px; }
.attendance-token-reveal p { margin:0; color:rgba(255,255,255,.78); }

.attendance-report-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-inline-start: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    background: #fff;
}

.attendance-report-toolbar > div:first-child {
    display: grid;
    gap: 3px;
}

.attendance-report-toolbar strong { font-size: 16px; }
.attendance-report-toolbar span { color: var(--muted-color); font-size: 12px; }
.attendance-report-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attendance-report-filter-card { margin-bottom: 16px; }

.attendance-report-filter {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) repeat(2, minmax(145px, .75fr)) repeat(3, minmax(150px, .8fr));
    gap: 12px;
    align-items: end;
}

.attendance-report-filter label { min-width: 0; }
.attendance-report-filter label > span { display: block; margin-bottom: 6px; color: var(--muted-color); font-size: 12px; font-weight: 700; }
.attendance-filter-buttons { display: flex; gap: 8px; align-items: center; grid-column: 1 / -1; }

.attendance-report-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.attendance-report-summary article {
    position: relative;
    min-height: 112px;
    padding: 17px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
}

.attendance-report-summary article::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: var(--primary-color);
}

.attendance-report-summary article.is-entry::before { background: #118c44; }
.attendance-report-summary article.is-exit::before { background: #2876b8; }
.attendance-report-summary article.is-review::before { background: #c64646; }
.attendance-report-summary span { display: block; color: var(--muted-color); font-size: 12px; font-weight: 700; }
.attendance-report-summary strong { display: block; margin: 8px 0 4px; color: var(--text-color); font-size: 27px; line-height: 1; }
.attendance-report-summary small { color: var(--muted-color); font-size: 10px; }
.attendance-page-count { color: var(--muted-color); font-size: 12px; font-weight: 700; }
.attendance-report-results { overflow: hidden; }
.attendance-report-results .table-responsive { margin-inline: -1px; }
.attendance-report-table { min-width: 1320px; }
.attendance-report-table th { white-space: nowrap; }
.attendance-report-table td { vertical-align: middle; }
.attendance-report-table td strong { display: block; }
.attendance-report-table td small { display: block; margin-top: 3px; color: var(--muted-color); font-size: 10px; }
.attendance-report-table .attendance-note { min-width: 180px; max-width: 260px; color: var(--muted-color); font-size: 11px; }

.attendance-event {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef3f1;
    color: #53645d;
    font-size: 11px;
    font-weight: 800;
}

.attendance-event-in { background: #e6f5eb; color: #0d6933; }
.attendance-event-out { background: #e9f2fb; color: #205f96; }
.attendance-report-pagination { display: flex; justify-content: center; gap: 6px; padding-top: 16px; }
.attendance-report-pagination a { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 11px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: #fff; color: var(--text-color); font-weight: 700; }
.attendance-report-pagination a.active { border-color: var(--primary-color); background: var(--primary-color); color: #fff; }

@media (max-width: 1180px) {
    .attendance-report-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .attendance-employee-search { grid-column: span 2; }
    .attendance-report-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .attendance-report-toolbar { align-items: stretch; flex-direction: column; }
    .attendance-report-actions .btn { flex: 1 1 130px; }
    .attendance-report-filter { grid-template-columns: 1fr; }
    .attendance-employee-search { grid-column: auto; }
    .attendance-report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.attendance-secret { display:flex; align-items:center; gap:8px; min-width:min(100%,440px); }
.attendance-secret code { direction:ltr; flex:1; padding:10px; overflow:hidden; color:#153b29; background:#fff; border-radius:5px; text-overflow:ellipsis; white-space:nowrap; }
.attendance-connection-card { display:grid; align-content:start; gap:10px; }
.attendance-connection-card > label { display:grid; gap:5px; }
.attendance-connection-card > label > span { font-size:12px; font-weight:800; }
.attendance-connection-card > label > div { display:grid; grid-template-columns:minmax(0,1fr) auto; border:1px solid var(--border-color); border-radius:5px; overflow:hidden; }
.attendance-connection-card code { direction:ltr; padding:9px; overflow-x:auto; color:#254638; background:#f7faf8; white-space:nowrap; }
.attendance-connection-card button { padding:0 12px; color:var(--primary-color); background:#fff; border:0; border-inline-start:1px solid var(--border-color); font-weight:800; cursor:pointer; }
.ltr-cell { direction: ltr; text-align: right; }

@media (max-width: 1100px) {
    .hr-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hr-stats, .hr-payroll-summary, .attendance-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attendance-device-layout { grid-template-columns:1fr; }
}

@media (max-width: 650px) {
    .hr-stats, .hr-payroll-summary, .hr-filter-grid { grid-template-columns: 1fr; }
    .hr-payroll-rollover { align-items:stretch; flex-direction:column; }
    .attendance-stats { grid-template-columns:1fr; }
    .attendance-token-reveal,.attendance-secret { align-items:stretch; flex-direction:column; }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-enter {
        animation: none;
    }
}

.cashboxes-board-head h2 {
    margin: 0;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 900;
}

.cashboxes-board-head p {
    margin: 5px 0 0;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
}

.cashboxes-reconciliation {
    min-width: 250px;
    display: grid;
    gap: 4px;
    padding: 10px 14px;
    border: 1px solid rgba(17, 140, 68, .14);
    border-radius: var(--radius-sm);
    background: rgba(17, 140, 68, .055);
}

.cashboxes-reconciliation span {
    color: var(--muted-color);
    direction: rtl;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.cashboxes-reconciliation strong {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 900;
}

.cashboxes-filterbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.cashboxes-filterbar input[type="search"] {
    grid-column: span 2;
}

.cashboxes-filterbar input,
.cashboxes-filterbar select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--text-color);
    padding: 8px 14px;
    outline: none;
    font-weight: 800;
}

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

.cashboxes-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
}

.cashboxes-table th {
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    padding: 9px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.cashboxes-table th:first-child {
    border-start-start-radius: 20px;
    border-end-start-radius: 20px;
}

.cashboxes-table th:last-child {
    border-start-end-radius: 20px;
    border-end-end-radius: 20px;
}

.cashboxes-table td {
    min-height: 64px;
    padding: 13px 12px;
    border-bottom: 1px solid rgba(216, 224, 227, .72);
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
}

.cashboxes-table tbody tr:hover td {
    background: rgba(17, 140, 68, .055);
}

.cashbox-amount {
    white-space: nowrap;
    font-weight: 900;
}

.cashbox-amount.in {
    color: var(--success-color);
}

.cashbox-amount.out {
    color: var(--danger-color);
}

.cashbox-type-badge {
    min-width: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.cashbox-type-badge.cash {
    color: var(--primary-color);
    background: rgba(17, 140, 68, .1);
}

.cashbox-type-badge.pos {
    color: var(--primary-dark);
    background: rgba(252, 219, 6, .24);
}

.cashbox-description {
    max-width: 280px;
    text-align: right !important;
    color: var(--muted-color);
}

.cashbox-account {
    min-width: 150px;
    color: var(--text-color);
    font-weight: 800;
}

.cashbox-running-balance {
    color: var(--primary-color);
    font-weight: 900;
    white-space: nowrap;
}

.cashboxes-board .pagination {
    margin-top: 14px;
}

.accounts-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.accounts-overview article {
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 7px;
    padding: 15px 17px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    box-shadow: var(--shadow-light);
}

.accounts-overview article:nth-child(2) {
    border-inline-start: 4px solid var(--success-color);
}

.accounts-overview article:nth-child(3) {
    border-inline-start: 4px solid var(--secondary-color);
}

.accounts-overview article:nth-child(4) {
    border-inline-start: 4px solid var(--accent-color);
}

.accounts-overview span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.accounts-overview strong {
    color: var(--text-color);
    font-size: 22px;
    font-weight: 900;
}

.future-collections-card {
    margin-bottom: 16px;
}

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

.future-collection-account {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-inline-start: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
}

.future-collection-account.is-credit {
    border-inline-start-color: var(--accent-color);
}

.future-collection-account > div {
    display: grid;
    gap: 5px;
}

.future-collection-account span,
.future-collection-account dt {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.future-collection-account strong {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.7;
}

.future-collection-account dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.future-collection-account dl div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 9px;
    border-radius: var(--radius-sm);
    background: var(--background-color);
}

.future-collection-account dd {
    margin: 0;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.future-collection-account dd small {
    color: var(--muted-color);
    font-size: 10px;
}

.accounts-table td {
    vertical-align: middle;
}

.account-tree-name {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding-inline-start: calc(var(--account-depth, 0) * 18px);
    color: var(--text-color);
    font-weight: 900;
}

.account-tree-name::before {
    content: "";
    width: calc(var(--account-depth, 0) * 9px);
    height: 1px;
    margin-inline-end: calc(var(--account-depth, 0) * 5px);
    background: rgba(17, 140, 68, .35);
}

.installment-show-grid label {
    display: grid;
    gap: 6px;
}

.installment-show-grid span {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 700;
}

.installment-show-grid input,
.installment-show-grid textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #f8fbfa;
    color: var(--text-color);
    padding: 8px 14px;
}

.installment-show-grid textarea {
    min-height: 96px;
}

.installment-show-grid .full {
    grid-column: 1 / -1;
}

.reservation-workspace {
    width: min(100%, 1280px);
    margin: 0 auto 22px;
    padding: 20px;
    border: 1px solid #dce7e3;
    border-radius: 24px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 18px 42px rgba(17, 140, 68, .045);
}

body:has(.reservation-workspace) .page-heading {
    width: min(100%, 1280px);
    margin: 0 auto 18px;
    padding: 14px 18px;
    justify-content: flex-end;
    border: 1px solid #dce7e3;
    border-radius: 22px;
    background: rgba(255, 255, 255, .76);
}

body:has(.reservation-workspace) .page-heading::after {
    display: none;
}

body:has(.reservation-workspace) .page-heading > div {
    width: 100%;
    text-align: right;
}

body:has(.reservation-workspace) .page-heading h1 {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 800;
}

body:has(.reservation-workspace) .breadcrumb {
    justify-content: flex-start;
}

.reservation-form,
.reservation-form-grid,
.reservation-top-grid {
    display: grid;
    gap: 14px;
}

.reservation-top-grid,
.reservation-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reservation-form label {
    display: grid;
    gap: 6px;
}

.reservation-form label > span,
.reservation-student-picker > span {
    color: #111827;
    font-weight: 700;
    padding-inline: 8px;
}

.reservation-form input,
.reservation-form select,
.reservation-form textarea,
.reservation-student-picker input,
.table-money-input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #dce4ea;
    border-radius: 999px;
    background: #fff;
    color: var(--text-color);
    padding: 8px 14px;
    outline: none;
}

.reservation-student-picker {
    position: relative;
    display: grid;
    gap: 6px;
}

.reservation-student-list {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 8px);
    z-index: 25;
    display: none;
    max-height: 338px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #dce4ea;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(31, 41, 51, .12);
}

.reservation-student-list.active {
    display: grid;
    gap: 6px;
}

.reservation-student-list-head,
.reservation-student-empty {
    padding: 6px 8px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.reservation-student-option {
    width: 100%;
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    text-align: right;
}

.reservation-student-option:hover {
    border-color: rgba(17, 140, 68, .14);
    background: rgba(17, 140, 68, .06);
}

.reservation-student-option strong,
.reservation-student-option span {
    display: block;
}

.reservation-student-option strong {
    font-size: 13px;
    font-weight: 900;
}

.reservation-student-option span {
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 700;
}

.reservation-student-option.add-new {
    margin-top: 4px;
    color: var(--primary-color);
    border-color: rgba(17, 140, 68, .16);
    background: rgba(17, 140, 68, .07);
}

.reservation-selected-student {
    display: grid;
    gap: 2px;
    padding: 9px 12px;
    border: 1px solid rgba(17, 140, 68, .16);
    border-radius: 14px;
    background: rgba(17, 140, 68, .06);
}

.reservation-selected-student strong,
.reservation-selected-student span {
    display: block;
}

.reservation-selected-student strong {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 900;
}

.reservation-selected-student span {
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 800;
}

.reservation-form textarea {
    min-height: 96px;
    border-radius: 18px;
    resize: vertical;
}

.reservation-form input[readonly] {
    color: #718096;
    background: rgba(255, 255, 255, .76);
}

.reservation-form .full {
    grid-column: 1 / -1;
}

.reservation-section-title,
.reservation-new-student h2 {
    margin: 4px 0 2px;
    font-family: var(--font-body);
    font-size: 18px;
    text-align: right;
}

.reservation-new-student {
    padding: 14px;
    border: 1px dashed #cfe0d9;
    border-radius: 18px;
    background: rgba(248, 251, 250, .82);
}

.reservation-new-student-modal {
    width: min(520px, calc(100vw - 28px));
}

.reservation-new-student-fields {
    display: grid;
    gap: 14px;
}

.reservation-new-student-fields label {
    display: grid;
    gap: 6px;
}

.reservation-new-student-fields label > span {
    color: var(--text-color);
    font-weight: 800;
}

.reservation-new-student-fields input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #dce4ea;
    border-radius: 12px;
    background: #fff;
    color: var(--text-color);
    padding: 8px 12px;
    outline: none;
}

.reservation-new-student-fields input:focus {
    border-color: rgba(17, 140, 68, .52);
    box-shadow: 0 0 0 3px rgba(17, 140, 68, .1);
}

.reservation-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.reservation-actions .btn-light {
    margin-inline-start: auto;
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    background: #fff;
    color: var(--primary-color);
}

.table-money-input {
    min-width: 130px;
    text-align: center;
}

.import-template-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid #dce7e3;
    border-radius: 16px;
    background: #f8fbfa;
}

.import-template-card div {
    display: grid;
    gap: 4px;
}

.import-template-card strong {
    font-size: 15px;
}

.import-template-card span {
    color: var(--muted-color);
    font-size: 13px;
}

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

.import-columns span {
    padding: 6px 10px;
    border: 1px solid #dce7e3;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

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

.alert {
    border-radius: var(--radius-md);
    padding: 11px 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    font-weight: 700;
}

.alert-success {
    color: var(--success-color);
    background: rgba(17, 140, 68, .12);
    border-color: rgba(17, 140, 68, .22);
}

.alert-danger {
    color: var(--danger-color);
    background: rgba(198, 61, 61, .12);
    border-color: rgba(198, 61, 61, .22);
}

.alert-warning {
    color: #8f6513;
    background: rgba(252, 219, 6, .15);
    border-color: rgba(252, 219, 6, .25);
}

.alert-info {
    color: var(--primary-dark);
    background: rgba(252, 219, 6, .18);
    border-color: rgba(252, 219, 6, .5);
}

.empty-state {
    padding: 22px;
    text-align: center;
    color: var(--muted-color);
    background: #f8fafb;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
}

.stage-list,
.alert-list {
    display: grid;
    gap: 10px;
}

.stage-row,
.alert-item,
.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fbfdfd;
}

.summary-row span,
.stage-row span {
    color: var(--muted-color);
    font-size: 12px;
}

.alert-item strong,
.alert-item span {
    display: block;
}

.alert-item span {
    color: var(--muted-color);
    font-size: 12px;
}

.chart-card canvas {
    width: 100%;
    max-height: 260px;
}

.progress-list,
.compact-list {
    display: grid;
    gap: 10px;
}

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

.progress-row > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.progress-row span {
    color: var(--muted-color);
    font-size: 12px;
}

.progress-track {
    height: 9px;
    border-radius: 999px;
    background: #edf2f3;
    overflow: hidden;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.compact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fbfdfd;
}

.compact-item:hover {
    background: #f5f9f9;
}

.compact-item.danger {
    border-color: rgba(198, 61, 61, .18);
    background: rgba(198, 61, 61, .04);
}

.compact-item strong,
.compact-item span {
    display: block;
}

.compact-item span {
    color: var(--muted-color);
    font-size: 12px;
}

.neo-dashboard {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 18px;
    border: 1px solid rgba(216, 224, 227, .82);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(246, 251, 250, .88)),
        linear-gradient(90deg, rgba(17, 140, 68, .045), rgba(252, 219, 6, .04));
    box-shadow: 0 24px 54px rgba(31, 41, 51, .07);
}

.neo-dashboard::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .52;
    background-image:
        linear-gradient(rgba(17, 140, 68, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 140, 68, .035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .48), transparent 78%);
}

.neo-dashboard-top {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr) minmax(270px, 380px);
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.neo-date-card,
.neo-student-search,
.neo-widget {
    border: 1px solid rgba(216, 224, 227, .86);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 14px 30px rgba(31, 41, 51, .055);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.neo-date-card {
    min-height: 96px;
    display: grid;
    place-items: center;
    gap: 0;
    padding: 12px;
    text-align: center;
}

.neo-date-card strong {
    color: var(--text-color);
    font-size: 34px;
    line-height: 1;
}

.neo-date-card span,
.neo-date-card small {
    display: block;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.neo-welcome {
    min-height: 96px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding-inline: 8px;
}

.neo-eyebrow {
    width: fit-content;
    margin-bottom: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--primary-color);
    background: rgba(17, 140, 68, .08);
    font-size: 11px;
    font-weight: 900;
}

.neo-welcome h2 {
    margin: 0;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: clamp(24px, 2.2vw, 36px);
    line-height: 1.25;
}

.neo-welcome p {
    max-width: 720px;
    margin: 5px 0 0;
    color: var(--muted-color);
    font-size: 13px;
    font-weight: 700;
}

.neo-student-search {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 7px;
}

.neo-student-search .search-icon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: var(--primary-color);
    background: rgba(17, 140, 68, .08);
}

.neo-student-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 700;
}

.neo-student-search input::placeholder {
    color: #a6b3bc;
}

.neo-student-search button {
    min-height: 36px;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    cursor: pointer;
    color: #fff;
    background: var(--primary-color);
    font-weight: 900;
}

.neo-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.neo-widget {
    position: relative;
    min-height: 140px;
    padding: 15px;
}

.neo-widget::after {
    content: "";
    position: absolute;
    inset-inline-start: 15px;
    inset-block-start: 15px;
    width: 3px;
    height: 36px;
    border-radius: 99px;
    background: rgba(17, 140, 68, .28);
}

.neo-widget-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.neo-widget-head span,
.neo-kpi-card > span:not(.neo-icon),
.neo-mini-stat span,
.neo-ring-card > div:last-child > span {
    display: block;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.neo-widget-head strong,
.neo-kpi-card strong,
.neo-mini-stat strong,
.neo-ring-card > div:last-child strong {
    display: block;
    color: var(--text-color);
    font-size: 18px;
    line-height: 1.35;
}

.neo-widget-head a {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 900;
}

.neo-wallet-card {
    grid-column: span 3;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 294px;
    color: #fff;
    border-color: rgba(255, 255, 255, .16);
    background:
        linear-gradient(145deg, rgba(13, 105, 51, .96), rgba(13, 105, 51, .96)),
        linear-gradient(90deg, rgba(255, 255, 255, .08), transparent);
}

.neo-wallet-card::after {
    background: rgba(252, 219, 6, .75);
}

.neo-wallet-card .neo-widget-head span,
.neo-wallet-card .neo-widget-head strong,
.neo-wallet-meta span {
    color: rgba(255, 255, 255, .78);
}

.neo-wallet-card .neo-widget-head strong {
    color: #fff;
}

.neo-money {
    display: block;
    color: #fff;
    font-size: clamp(26px, 2.35vw, 36px);
    line-height: 1.2;
}

.neo-wallet-meta {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 800;
}

.neo-wallet-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}

.neo-wallet-actions a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--primary-dark);
    background: #fff;
    font-size: 13px;
    font-weight: 900;
}

.neo-wallet-actions a.send {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .12);
}

.neo-kpi-card {
    grid-column: span 2;
    display: grid;
    align-content: center;
    gap: 6px;
    padding-inline-start: 64px;
}

.neo-kpi-card small,
.neo-mini-stat small,
.neo-ring-card small {
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 800;
}

.neo-icon {
    position: absolute;
    top: 16px;
    inset-inline-start: 16px;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius-md);
    color: var(--primary-color);
    background: rgba(17, 140, 68, .1);
}

.neo-icon::before {
    font-size: 21px;
    font-weight: 900;
}

.neo-icon-students::before { content: "◎"; }
.neo-icon-due::before { content: "◷"; }
.neo-icon-late::before { content: "!"; }

.neo-kpi-card.warning .neo-icon {
    color: #9c6610;
    background: rgba(252, 219, 6, .16);
}

.neo-kpi-card.danger .neo-icon {
    color: var(--danger-color);
    background: rgba(198, 61, 61, .12);
}

.neo-kpi-card.warning::after { background: rgba(252, 219, 6, .5); }
.neo-kpi-card.danger::after { background: rgba(198, 61, 61, .46); }

.neo-mini-stat {
    grid-column: span 3;
    display: grid;
    gap: 10px;
}

.neo-mini-stat.success::after {
    background: rgba(17, 140, 68, .45);
}

.neo-bars {
    height: 52px;
    display: flex;
    align-items: end;
    gap: 5px;
    margin-top: auto;
    padding-top: 10px;
}

.neo-bars i {
    width: 100%;
    min-height: 8px;
    border-radius: 999px 999px 4px 4px;
    background: linear-gradient(180deg, var(--accent-color), var(--primary-color));
}

.neo-ring-card {
    grid-column: span 3;
    display: flex;
    align-items: center;
    gap: 16px;
}

.neo-ring {
    width: 108px;
    height: 108px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #fff 0 56%, transparent 57%),
        conic-gradient(var(--primary-color) calc(var(--progress) * 1%), rgba(17, 140, 68, .12) 0);
    box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .7);
}

.neo-ring strong {
    display: block;
    color: var(--text-color);
    font-size: 22px;
    line-height: 1;
}

.neo-ring span {
    display: block;
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 900;
}

.neo-chart-card {
    grid-column: span 6;
    min-height: 300px;
}

.neo-doughnut-card,
.neo-bubbles-card {
    grid-column: span 3;
    min-height: 300px;
}

.neo-chart-card canvas,
.neo-doughnut-card canvas {
    width: 100%;
    max-height: 224px;
}

.neo-bubbles {
    position: relative;
    height: 190px;
    display: grid;
    place-items: center;
}

.neo-bubbles span {
    position: absolute;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 50%;
    color: var(--text-color);
    font-size: clamp(10px, 1vw, 12px);
    font-weight: 900;
    line-height: 1.35;
}

.bubble-lg {
    width: 176px;
    height: 176px;
    background: rgba(17, 140, 68, .1);
}

.bubble-md {
    width: 126px;
    height: 126px;
    transform: translateY(28px);
    color: var(--primary-dark);
    background: rgba(252, 219, 6, .2);
}

.bubble-sm {
    width: 78px;
    height: 78px;
    transform: translateY(55px);
    color: #fff;
    background: var(--primary-color);
}

.neo-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 800;
}

.neo-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.neo-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(17, 140, 68, .4);
}

.neo-legend span:nth-child(2) i { background: rgba(252, 219, 6, .7); }
.neo-legend span:nth-child(3) i { background: var(--primary-color); }

.neo-school-card {
    grid-column: span 4;
    min-height: 310px;
}

.neo-progress-list {
    display: grid;
    gap: 10px;
}

.neo-progress-row {
    display: grid;
    gap: 7px;
}

.neo-progress-row > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.neo-progress-row span {
    color: var(--text-color);
    font-size: 12px;
    font-weight: 800;
}

.neo-progress-row strong {
    color: var(--primary-color);
    font-size: 12px;
}

.neo-progress-row em {
    display: block;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef4f3;
}

.neo-progress-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.neo-actions-card {
    grid-column: span 3;
    min-height: 310px;
}

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

.neo-quick-actions a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    background: #f9fbfb;
    font-size: 12px;
    font-weight: 900;
}

.neo-quick-actions a.primary {
    color: #fff;
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.neo-action-note {
    margin-top: 14px;
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--primary-dark);
    background: rgba(17, 140, 68, .08);
}

.neo-action-note strong,
.neo-action-note span {
    display: block;
}

.neo-action-note span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.neo-activity-card {
    grid-column: span 5;
    min-height: 310px;
}

.neo-activity-list,
.neo-alert-list {
    display: grid;
    gap: 9px;
}

.neo-activity-item,
.neo-alert-list a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(216, 224, 227, .7);
    background: rgba(251, 253, 253, .78);
}

.neo-activity-item > span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(17, 140, 68, .08);
}

.neo-activity-item strong,
.neo-alert-list strong {
    display: block;
    color: var(--text-color);
    font-size: 12px;
    font-weight: 900;
}

.neo-activity-item small,
.neo-alert-list span,
.neo-activity-item time {
    display: block;
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 800;
}

.neo-alert-card {
    grid-column: span 4;
    min-height: 310px;
}

.neo-alert-list a {
    grid-template-columns: minmax(0, 1fr) auto;
    border-color: rgba(198, 61, 61, .14);
    background: rgba(198, 61, 61, .035);
}

.neo-alert-list a:hover,
.neo-activity-item:hover {
    border-color: rgba(17, 140, 68, .22);
    background: #fff;
}

@media (max-width: 1320px) {
    .neo-dashboard-top {
        grid-template-columns: 128px minmax(0, 1fr);
    }

    .neo-student-search {
        grid-column: 1 / -1;
    }

    .neo-wallet-card,
    .neo-kpi-card,
    .neo-mini-stat,
    .neo-ring-card,
    .neo-doughnut-card,
    .neo-bubbles-card,
    .neo-actions-card {
        grid-column: span 4;
    }

    .neo-chart-card,
    .neo-school-card,
    .neo-activity-card,
    .neo-alert-card {
        grid-column: span 6;
    }
}

@media (max-width: 920px) {
    .neo-dashboard {
        padding: 12px;
        border-radius: 18px;
    }

    .neo-dashboard-top,
    .neo-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .neo-student-search,
    .neo-wallet-card,
    .neo-kpi-card,
    .neo-mini-stat,
    .neo-ring-card,
    .neo-chart-card,
    .neo-doughnut-card,
    .neo-bubbles-card,
    .neo-school-card,
    .neo-actions-card,
    .neo-activity-card,
    .neo-alert-card {
        grid-column: 1 / -1;
    }

    .neo-wallet-card {
        min-height: 248px;
    }

    .neo-welcome h2 {
        font-size: 24px;
    }

    .neo-quick-actions {
        grid-template-columns: 1fr;
    }
}

.donezo-dashboard {
    padding: 16px;
    border: 1px solid rgba(216, 224, 227, .82);
    border-radius: 28px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 24px 56px rgba(31, 41, 51, .07);
}

.donezo-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

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

.donezo-hero h1 {
    margin: 4px 0 2px;
    color: #0f1720;
    font-family: var(--font-heading);
    font-size: 34px;
    line-height: 1.15;
}

.donezo-hero p {
    margin: 0;
    color: var(--muted-color);
    font-size: 13px;
    font-weight: 700;
}

.donezo-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.donezo-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.donezo-btn.primary {
    color: #fff;
    background: var(--primary-color);
    box-shadow: 0 12px 22px rgba(17, 140, 68, .18);
}

.donezo-btn.ghost {
    color: var(--text-color);
    border: 1px solid #0f1720;
    background: #fff;
}

.simple-dashboard {
    width: min(100%, 1180px);
    margin: 0 auto 28px;
    display: grid;
    gap: 18px;
}

.simple-dashboard-head {
    min-height: 116px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border: 1px solid rgba(216, 224, 227, .72);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(245, 251, 247, .86)),
        radial-gradient(circle at 10% 0%, rgba(17, 140, 68, .1), transparent 36%);
    box-shadow: 0 18px 44px rgba(31, 41, 51, .06);
}

.simple-dashboard-head span,
.simple-dashboard-head p {
    display: block;
    margin: 0;
    color: var(--muted-color);
    font-size: 13px;
    font-weight: 800;
}

.simple-dashboard-head h1 {
    margin: 6px 0;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.1;
    font-weight: 900;
}

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

.simple-balance-card {
    position: relative;
    overflow: hidden;
    min-height: 170px;
    display: grid;
    align-content: space-between;
    gap: 18px;
    padding: 22px;
    border: 1px solid rgba(216, 224, 227, .72);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 44px rgba(31, 41, 51, .06);
}

.simple-balance-card::after {
    content: "";
    position: absolute;
    inset-block: 22px;
    inset-inline-start: 0;
    width: 4px;
    border-radius: 999px;
    background: var(--primary-dark);
}

.simple-balance-card.today::after {
    background: var(--secondary-color);
}

.simple-balance-card.today.negative::after {
    background: var(--danger-color);
}

.simple-balance-card.current {
    color: #fff;
    border-color: rgba(17, 140, 68, .18);
    background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
}

.simple-balance-card.current::after {
    background: rgba(255, 255, 255, .76);
}

.simple-balance-card span {
    color: var(--muted-color);
    font-size: 14px;
    font-weight: 900;
}

.simple-balance-card strong {
    color: var(--text-color);
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1.15;
    font-weight: 900;
}

.simple-balance-card.current span {
    color: rgba(255, 255, 255, .78);
}

.simple-balance-card.current strong {
    color: #fff;
}

@keyframes dashboardFadeZoomIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.975);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.dashboard-enter {
    transform-origin: 50% 24%;
    animation: dashboardFadeZoomIn .68s cubic-bezier(.2, .82, .24, 1) both;
}

.dashboard-cashbox-strip,
.cashbox-user-balances {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.dashboard-cashbox-strip article,
.cashbox-user-balances article {
    min-width: 0;
    min-height: 96px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 14px;
    padding: 16px 18px;
    border: 1px solid rgba(17, 140, 68, .15);
    border-inline-start: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 12px 28px rgba(31, 41, 51, .055);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dashboard-cashbox-strip article div,
.cashbox-user-balances article div {
    min-width: 0;
    display: grid;
}

.dashboard-cashbox-strip span,
.cashbox-user-balances span {
    overflow: hidden;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-cashbox-strip small,
.cashbox-user-balances small {
    color: var(--muted-color);
    font-size: 11px;
}

.dashboard-cashbox-strip strong,
.cashbox-user-balances strong {
    color: var(--primary-dark);
    font-size: 20px;
    white-space: nowrap;
}

.dashboard-cashbox-strip em,
.cashbox-user-balances em {
    grid-column: 1 / -1;
    color: var(--muted-color);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.dashboard-late-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-chart-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(216, 224, 227, .82);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 18px 44px rgba(31, 41, 51, .06);
}

.dashboard-chart-panel header {
    min-height: 56px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.dashboard-chart-panel header span {
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 800;
}

.dashboard-chart-panel h2 {
    margin: 3px 0 0;
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.35;
}

.dashboard-chart-panel header > strong {
    min-width: 48px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    color: var(--primary-dark);
    background: rgba(252, 219, 6, .28);
    font-size: 22px;
}

.dashboard-chart-panel canvas {
    width: 100%;
    height: 220px;
    display: block;
}

.personal-dashboard {
    gap: 16px;
}

.dashboard-customize-button {
    flex: 0 0 auto;
}

.dashboard-shortcuts-panel {
    padding: 20px;
    border: 1px solid rgba(216, 224, 227, .8);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 14px 34px rgba(31, 41, 51, .045);
}

.dashboard-shortcuts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-shortcuts-head h2 {
    margin: 0;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 900;
}

.dashboard-shortcuts-head p {
    margin: 4px 0 0;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(182px, 1fr));
    gap: 10px;
}

.dashboard-shortcut {
    min-height: 82px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-color);
    text-decoration: none;
    cursor: grab;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.dashboard-shortcut:hover {
    transform: translateY(-2px);
    border-color: rgba(17, 140, 68, .35);
    box-shadow: 0 10px 22px rgba(17, 140, 68, .09);
}

.dashboard-shortcut.dragging {
    opacity: .46;
    cursor: grabbing;
}

.dashboard-shortcut-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary-color);
    background: rgba(17, 140, 68, .09);
}

.dashboard-shortcut-icon svg {
    width: 19px;
    height: 19px;
}

.dashboard-shortcut strong {
    font-size: 13px;
    font-weight: 900;
}

.dashboard-shortcut-handle {
    position: absolute;
    inset-inline-end: 9px;
    inset-block-start: 8px;
    color: var(--muted-color);
    font-size: 13px;
    letter-spacing: 2px;
}

.dashboard-shortcuts-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 14px;
}

.dashboard-shortcuts-empty {
    grid-column: 1 / -1;
}

.dashboard-shortcuts-modal {
    width: min(590px, calc(100vw - 32px));
}

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

.dashboard-shortcuts-options label {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
}

.dashboard-shortcuts-options input {
    accent-color: var(--primary-color);
}

.dashboard-shortcuts-options span {
    color: var(--primary-color);
}

.dashboard-shortcuts-options span svg {
    width: 18px;
    height: 18px;
}

.dashboard-shortcuts-options strong {
    font-size: 13px;
    font-weight: 800;
}

.donezo-cashbox-strip {
    display: grid;
    grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.donezo-cashbox-strip article {
    min-height: 104px;
    display: grid;
    align-content: center;
    gap: 7px;
    padding: 16px;
    border: 1px solid rgba(216, 224, 227, .68);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 26px rgba(31, 41, 51, .04);
}

.donezo-cashbox-strip article.scope,
.donezo-cashbox-strip article.current {
    color: #fff;
    border-color: rgba(17, 140, 68, .18);
    background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
}

.donezo-cashbox-strip article.out {
    border-color: rgba(198, 61, 61, .15);
    background: rgba(255, 246, 246, .94);
}

.donezo-cashbox-strip span,
.donezo-cashbox-strip small {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.donezo-cashbox-strip article.scope span,
.donezo-cashbox-strip article.scope small,
.donezo-cashbox-strip article.current span,
.donezo-cashbox-strip article.current small {
    color: rgba(255, 255, 255, .78);
}

.donezo-cashbox-strip strong {
    color: #0f1720;
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.15;
}

.donezo-cashbox-strip article.scope strong,
.donezo-cashbox-strip article.current strong {
    color: #fff;
}

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

.donezo-metric {
    position: relative;
    min-height: 144px;
    display: grid;
    align-content: space-between;
    gap: 8px;
    padding: 18px;
    border: 1px solid rgba(216, 224, 227, .65);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 26px rgba(31, 41, 51, .04);
}

.donezo-metric.featured {
    color: #fff;
    border-color: rgba(17, 140, 68, .12);
    background:
        linear-gradient(145deg, var(--primary-color), var(--primary-dark)),
        linear-gradient(90deg, rgba(255, 255, 255, .08), transparent);
}

.donezo-metric span,
.donezo-metric small {
    display: block;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.donezo-metric.featured span,
.donezo-metric.featured small {
    color: rgba(255, 255, 255, .82);
}

.donezo-metric strong {
    color: #0f1720;
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1;
}

.donezo-metric.featured strong {
    color: #fff;
}

.donezo-metric i {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--primary-color);
    background: rgba(17, 140, 68, .09);
    font-style: normal;
    font-weight: 900;
}

.donezo-metric.featured i {
    color: var(--primary-dark);
    background: #fff;
}

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

.donezo-card {
    min-height: 180px;
    padding: 16px;
    border: 1px solid rgba(216, 224, 227, .68);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 26px rgba(31, 41, 51, .04);
}

.donezo-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.donezo-card-head h2 {
    margin: 0;
    color: #0f1720;
    font-size: 17px;
    line-height: 1.25;
}

.donezo-card-head span,
.donezo-card-head a {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 900;
}

.donezo-card-head a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border: 1px solid #0f1720;
    border-radius: 999px;
    color: #0f1720;
    background: #fff;
}

.donezo-card.analytics {
    grid-column: span 6;
}

.donezo-card.reminder {
    grid-column: span 3;
}

.donezo-card.worklist {
    grid-column: span 3;
    grid-row: span 2;
}

.donezo-card.collaboration {
    grid-column: span 5;
}

.donezo-card.progress {
    grid-column: span 4;
}

.donezo-card.finance {
    grid-column: span 3;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(17, 140, 68, .96), rgba(13, 105, 51, .98)),
        linear-gradient(90deg, rgba(255, 255, 255, .08), transparent);
}

.donezo-card.finance .donezo-card-head h2,
.donezo-card.finance .donezo-card-head span,
.donezo-card.finance strong,
.donezo-card.finance small {
    color: #fff;
}

.donezo-bars-chart {
    height: 180px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
}

.donezo-bars-chart > div {
    height: 100%;
    display: grid;
    align-items: end;
    gap: 7px;
    text-align: center;
}

.donezo-bars-chart i {
    min-height: 18px;
    display: block;
    border-radius: 999px 999px 8px 8px;
    background:
        linear-gradient(180deg, var(--primary-color), rgba(17, 140, 68, .72));
}

.donezo-bars-chart > div:nth-child(3n) i {
    background: rgba(17, 140, 68, .62);
}

.donezo-bars-chart > div:nth-child(2n) i {
    background:
        repeating-linear-gradient(-45deg, rgba(17, 140, 68, .2) 0 4px, transparent 4px 8px),
        rgba(17, 140, 68, .08);
}

.donezo-bars-chart span {
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 900;
}

.donezo-card.reminder strong {
    display: block;
    color: #0f1720;
    font-size: 18px;
    line-height: 1.35;
}

.donezo-card.reminder p {
    margin: 7px 0 0;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 800;
}

.donezo-card.reminder small {
    display: block;
    margin-top: 4px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 800;
}

.donezo-card.reminder > a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding: 8px 18px;
    border-radius: 999px;
    color: #fff;
    background: var(--primary-color);
    font-size: 13px;
    font-weight: 900;
}

.donezo-task-list,
.donezo-activity-list {
    display: grid;
    gap: 10px;
}

.donezo-task-list a,
.donezo-activity-list > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.donezo-task-list a > span,
.donezo-activity-list > div > span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--primary-color);
    background: rgba(17, 140, 68, .09);
    font-size: 12px;
    font-weight: 900;
}

.donezo-task-list a > span::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 4px;
    background: var(--primary-color);
}

.donezo-task-list strong,
.donezo-task-list small,
.donezo-activity-list strong,
.donezo-activity-list small {
    display: block;
}

.donezo-task-list strong,
.donezo-activity-list strong {
    color: #0f1720;
    font-size: 12px;
    font-weight: 900;
}

.donezo-task-list small,
.donezo-activity-list small {
    color: var(--muted-color);
    font-size: 10px;
    font-weight: 800;
}

.donezo-task-list b {
    color: var(--primary-color);
    font-size: 11px;
    white-space: nowrap;
}

.donezo-activity-list em {
    color: #a27618;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.donezo-gauge {
    position: relative;
    width: min(100%, 240px);
    height: 132px;
    display: grid;
    place-items: end center;
    margin: 6px auto 12px;
    border-radius: 140px 140px 12px 12px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 100%, #fff 0 43%, transparent 44%),
        conic-gradient(from 270deg at 50% 100%, var(--primary-color) var(--angle), rgba(17, 140, 68, .12) 0 180deg, transparent 0);
}

.donezo-gauge strong {
    color: #0f1720;
    font-size: 42px;
    line-height: 1;
}

.donezo-gauge span {
    position: absolute;
    bottom: 18px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 900;
}

.donezo-progress-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    color: var(--muted-color);
    font-size: 11px;
    font-weight: 800;
}

.donezo-progress-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.donezo-progress-legend i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
}

.donezo-progress-legend span:last-child i {
    background: repeating-linear-gradient(-45deg, rgba(17, 140, 68, .4) 0 3px, transparent 3px 6px);
}

.donezo-card.finance > strong {
    display: block;
    margin-top: 18px;
    font-size: 30px;
    line-height: 1.1;
}

.donezo-mini-bars {
    height: 54px;
    display: flex;
    align-items: end;
    gap: 5px;
    margin: 18px 0 12px;
}

.donezo-mini-bars i {
    width: 100%;
    min-height: 8px;
    border-radius: 999px 999px 4px 4px;
    background: rgba(255, 255, 255, .8);
}

.donezo-card.finance small {
    color: rgba(255, 255, 255, .76);
    font-size: 12px;
    font-weight: 800;
}

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

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

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

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

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

    .donezo-card.analytics,
    .donezo-card.reminder,
    .donezo-card.worklist,
    .donezo-card.collaboration,
    .donezo-card.progress,
    .donezo-card.finance {
        grid-column: span 6;
        grid-row: auto;
    }
}

@media (max-width: 920px) {
    .simple-dashboard-head {
        min-height: auto;
        padding: 18px;
    }

    .simple-balance-grid {
        grid-template-columns: 1fr;
    }

    .simple-dashboard-head,
    .cashboxes-board-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-customize-button,
    .cashboxes-reconciliation {
        width: 100%;
    }

    .dashboard-shortcuts-options,
    .accounts-overview,
    .future-collections-grid {
        grid-template-columns: 1fr;
    }

    .future-collection-account dl {
        grid-template-columns: 1fr;
    }

    .donezo-dashboard {
        padding: 12px;
        border-radius: 18px;
    }

    .donezo-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .donezo-cashbox-strip,
    .donezo-metrics,
    .donezo-grid {
        grid-template-columns: 1fr;
    }

    .donezo-card.analytics,
    .donezo-card.reminder,
    .donezo-card.worklist,
    .donezo-card.collaboration,
    .donezo-card.progress,
    .donezo-card.finance {
        grid-column: 1 / -1;
    }

    .donezo-bars-chart {
        gap: 8px;
    }
}

.auth-body {
    background: linear-gradient(145deg, #118C44 0%, #0D6933 45%, #f5f7f8 45%, #f5f7f8 100%);
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 460px);
    padding: 26px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.login-brand img {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
}

.login-brand h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 28px;
}

.login-brand p {
    margin: 0;
    color: var(--muted-color);
}

.login-hint {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: #f4f8f7;
    color: var(--muted-color);
    text-align: center;
}

.auth-flash {
    position: fixed;
    inset-block-start: 16px;
    inset-inline: 16px;
    z-index: 100;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    background: rgba(15, 31, 37, .44);
    z-index: 120;
    overflow-y: auto;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    width: min(100%, 940px);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 22px;
}

.modal-body {
    padding: 18px;
}

.table-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.table-row-actions form {
    margin: 0;
}

.reservation-cancel-modal {
    width: min(100%, 760px);
}

.reservation-edit-modal {
    width: min(100%, 860px);
}

.reservation-edit-modal .modal-header p {
    margin: 4px 0 0;
}

.reservation-edit-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(200, 151, 31, .28);
    border-radius: var(--radius-sm);
    background: rgba(255, 216, 0, .09);
    color: #67520a;
    font-size: 13px;
    font-weight: 700;
}

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

.reservation-edit-grid label {
    display: grid;
    gap: 6px;
}

.reservation-edit-grid label > span {
    color: var(--text-color);
    font-weight: 800;
}

.reservation-edit-grid input,
.reservation-edit-grid select,
.reservation-edit-grid textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-color);
    padding: 9px 12px;
}

.reservation-edit-grid input[readonly] {
    background: var(--background-soft, #f7faf9);
    color: var(--muted-color);
}

.reservation-edit-grid textarea {
    min-height: 96px;
    resize: vertical;
}

.reservation-edit-grid .full {
    grid-column: 1 / -1;
}

.reservation-cancel-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.reservation-cancel-summary > div {
    padding: 13px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--background-soft, #f7faf9);
}

.reservation-cancel-summary span,
.reservation-cancel-summary strong {
    display: block;
}

.reservation-cancel-summary span {
    margin-bottom: 5px;
    color: var(--muted-color);
    font-size: 13px;
}

.reservation-cancel-summary strong {
    color: var(--text-color);
    font-weight: 800;
}

@media (max-width: 640px) {
    .reservation-cancel-summary,
    .reservation-edit-grid {
        grid-template-columns: 1fr;
    }
}

.close-modal {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    font-size: 22px;
}

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

.tab-link {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 9px 13px;
    color: var(--text-color);
    font-weight: 700;
}

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

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.pagination button {
    min-width: 34px;
    min-height: 34px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
}

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

@media screen {
    .print-only {
        display: none !important;
    }
}

.print-page {
    min-height: 100vh;
    background: #e9eeec;
    color: #151515;
    display: flex;
    justify-content: center;
    padding: 10mm 0;
    font-family: var(--font-print);
}

.print-page,
.print-page *,
.print-page *::before,
.print-page *::after {
    box-sizing: border-box;
}

.print-document {
    width: 148mm;
    min-height: 210mm;
    margin: 0 auto;
    padding: 6mm;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #fff;
    border: 1px solid #bfc8c4;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .16);
    color: #151515;
    font-family: var(--font-print);
    font-size: 10.8px;
    line-height: 1.45;
}

.print-document::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--print-logo-image, url("../img/logo.png")) center 102mm / 62mm auto no-repeat;
    opacity: .10;
    pointer-events: none;
}

.print-document::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(17, 140, 68, .025);
    opacity: .5;
    pointer-events: none;
}

.print-document > * {
    position: relative;
    z-index: 1;
}

.receipt-print {
    max-width: 148mm;
}

.print-header {
    display: grid;
    grid-template-columns: 26mm minmax(0, 1fr) 38mm;
    align-items: center;
    gap: 4mm;
    padding-bottom: 3.5mm;
    margin-bottom: 3.5mm;
    border-bottom: 2px solid #118C44;
}

.print-page .invoice-document .print-header {
    display: block;
    min-height: 0;
    padding: 0 0 3mm;
}

.school-identity,
.print-header .school-identity {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 1.4mm;
    min-width: 0;
}

.school-identity img,
.print-header img {
    width: 17mm;
    height: 17mm;
    object-fit: contain;
    flex: 0 0 auto;
}

.school-identity h1,
.print-title h1 {
    margin: 0;
    font-family: var(--font-print);
    font-size: 17px;
    line-height: 1.15;
    color: #0D6933;
    font-weight: 700;
}

.school-identity p,
.print-title p {
    margin: .5mm 0 0;
    color: #56645f;
    font-size: 10px;
    font-weight: 700;
}

.print-qr-box {
    display: grid;
    justify-items: center;
    gap: 1mm;
    align-self: stretch;
    padding: 1.4mm;
    border: 1px solid #c7d2ce;
    border-radius: 4px;
    background: #fff;
}

.print-qr-box img {
    width: 19mm;
    height: 19mm;
    object-fit: contain;
}

.print-qr-box span {
    color: #485751;
    font-size: 8.5px;
    font-weight: 700;
    white-space: nowrap;
}

.print-doc-badge {
    min-height: 22mm;
    display: grid;
    place-items: center;
    padding: 2mm;
    border: 1.5px solid #118C44;
    border-radius: 4px;
    background: #f8fbfa;
    color: #0D6933;
    text-align: center;
    font-family: var(--font-print);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.print-meta-box {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2mm;
    color: #151515;
    font-size: 10px;
}

.print-meta-box div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2mm;
    min-height: 8mm;
    padding: 1.4mm 2mm;
    border: 1px solid #d8dfdc;
    background: rgba(255, 255, 255, .78);
}

.print-meta-box span {
    color: #5f6c67;
    font-weight: 700;
}

.print-meta-box strong,
.print-section-title,
.print-field strong,
.print-total-box strong,
.print-table th,
.print-table tfoot td,
.signature-box,
.print-verification strong {
    font-weight: 700;
}

.print-section-title {
    display: flex;
    align-items: center;
    gap: 2mm;
    margin: 0 0 2mm;
    color: #0D6933;
    font-size: 12px;
}

.print-section-title::before {
    content: "";
    width: 3.2mm;
    height: 3.2mm;
    border-radius: 50%;
    background: #FCDB06;
}

.print-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2mm;
    margin-bottom: 3mm;
}

.print-field {
    min-height: 11.5mm;
    padding: 1.7mm 2mm;
    border: 1px solid #d8dfdc;
    border-radius: 3px;
    background: rgba(255, 255, 255, .82);
}

.print-field.wide {
    grid-column: span 2;
}

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

.print-field span {
    display: block;
    margin-bottom: .6mm;
    color: #66736e;
    font-size: 8.8px;
    font-weight: 700;
}

.print-field strong {
    display: block;
    color: #151515;
    font-size: 10.2px;
    overflow-wrap: anywhere;
}

.print-total-box {
    display: grid;
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
    gap: 3mm;
    align-items: center;
    margin: 1.5mm 0 3mm;
    padding: 2.5mm 3mm;
    border: 1px solid #118C44;
    border-right: 5px solid #FCDB06;
    border-radius: 3px;
    background: #118C44;
    color: #fff;
}

.print-total-box span {
    display: block;
    color: rgba(255, 255, 255, .78);
    font-size: 8.8px;
    font-weight: 700;
}

.print-total-box strong {
    display: block;
    margin-top: .6mm;
    font-size: 15.5px;
    line-height: 1.25;
}

.print-total-box .amount-words strong {
    font-size: 10.5px;
}

.print-mini-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2mm;
    margin: -1mm 0 3mm;
}

.print-mini-totals div {
    border: 1px solid #d8dfdc;
    border-radius: 3px;
    background: #f8faf9;
    padding: 1.5mm 2mm;
}

.print-mini-totals span {
    display: block;
    color: #66736e;
    font-size: 8.6px;
    font-weight: 700;
}

.print-mini-totals strong {
    display: block;
    color: #151515;
    font-size: 10.5px;
    font-weight: 700;
}

.print-table {
    width: 100%;
    margin: 0 0 3mm;
    border-collapse: collapse;
    background: rgba(255, 255, 255, .88);
    font-size: 9.8px;
}

.print-table th,
.print-table td {
    border: 1px solid #d8dfdc;
    padding: 1.55mm 1.8mm;
    text-align: right;
    vertical-align: middle;
}

.print-table th {
    background: #118C44;
    color: #fff;
}

.print-table tfoot td {
    background: #f2f5f4;
}

.print-note {
    margin: 1.5mm 0 0;
    padding: 1.6mm 2mm;
    border: 1px dashed #aeb9b5;
    border-radius: 3px;
    background: rgba(250, 251, 251, .82);
    color: #2f3a36;
    font-size: 9.6px;
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5mm;
    margin-top: 6mm;
}

.signature-box {
    min-height: 13mm;
    border-top: 1px solid #535f5a;
    padding-top: 1.8mm;
    text-align: center;
    color: #151515;
    font-size: 9.6px;
}

.print-verification {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4mm;
    align-items: center;
    margin-top: 3mm;
    padding-top: 2mm;
    border-top: 1px solid #d8dfdc;
    color: #53615c;
    font-size: 8.8px;
}

.print-verification strong,
.print-verification span {
    display: block;
}

.print-verification span {
    direction: ltr;
    text-align: left;
    overflow-wrap: anywhere;
    font-size: 7.6px;
}

.print-verification small {
    color: #53615c;
    font-size: 8.4px;
    font-weight: 700;
}

.report-print-page {
    align-items: flex-start;
}

.report-print-document {
    min-height: 210mm;
    height: auto;
    overflow: visible;
}

.report-print-table {
    font-size: 8.8px;
}

.report-print-table th,
.report-print-table td {
    padding: 1.25mm 1.35mm;
}

.installments-report-print-table {
    font-size: 8px;
}

.installments-report-print-table th,
.installments-report-print-table td {
    padding: 1.1mm 1mm;
}

.cashbox-report-print-table {
    font-size: 7.7px;
}

.cashbox-report-print-table th,
.cashbox-report-print-table td {
    padding: 1.05mm .9mm;
}

@media print {
    @page {
        size: 148mm 210mm;
        margin: 0;
    }

    html,
    body {
        background: #fff;
        width: 148mm;
        min-width: 148mm;
        height: auto;
        min-height: 0 !important;
        margin: 0;
        padding: 0;
        overflow: visible !important;
        font-family: var(--font-print) !important;
        print-color-adjust: economy;
        -webkit-print-color-adjust: economy;
    }

    body.auth-body,
    body.app-body {
        background: #fff !important;
        min-height: 0 !important;
    }

    .sidebar,
    .topbar,
    .page-heading,
    .toolbar,
    .btn,
    .no-print {
        display: none !important;
    }

    .app-shell {
        min-height: 0;
    }

    .main-panel {
        width: 148mm;
        max-width: 148mm;
        margin: 0;
        min-height: 0;
    }

    .content-panel {
        width: 148mm;
        max-width: 148mm;
        margin: 0;
        padding: 0;
    }

    .print-page {
        width: 148mm;
        min-width: 148mm;
        height: auto;
        min-height: 0;
        display: block;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .print-only {
        display: block !important;
    }

    .print-document {
        width: 148mm;
        min-width: 148mm;
        max-width: 148mm;
        height: auto;
        min-height: 210mm;
        max-height: none;
        margin: 0;
        padding: 6mm;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        overflow: visible;
        page-break-inside: auto;
        break-inside: auto;
        font-family: var(--font-print) !important;
    }

    .report-print-document {
        min-height: 210mm;
    }

    .print-document::before {
        display: block !important;
        background-image: var(--print-logo-image, url("../img/logo.png")) !important;
        background-repeat: no-repeat !important;
        background-position: center 102mm !important;
        background-size: 54mm auto !important;
        opacity: .055 !important;
    }

    .print-document::after {
        display: none;
    }

    .print-qr-box {
        display: grid !important;
    }

    .school-identity img,
    .print-header img {
        display: block !important;
    }

    .print-header {
        grid-template-columns: minmax(0, 1fr) 38mm;
    }

    *,
    *::before,
    *::after {
        background-image: none !important;
        filter: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        animation: none !important;
        transition: none !important;
    }

    .report-print-document .print-table thead {
        display: table-header-group;
    }

    .report-print-document .print-table tfoot {
        display: table-footer-group;
    }

    .report-print-document .print-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .content-panel > .card:not(.no-print) {
        width: 148mm;
        max-width: 148mm;
        margin: 0;
        padding: 7mm;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        page-break-inside: auto;
        break-inside: auto;
        min-height: 0;
    }

    .print-header {
        gap: 3mm;
        padding-bottom: 2.8mm;
        margin-bottom: 2.8mm;
    }

    .school-identity img,
    .print-header img {
        width: 16mm;
        height: 16mm;
    }

    .school-identity h1,
    .print-title h1 {
        font-size: 16px;
    }

    .school-identity p,
    .print-title p,
    .print-document p {
        font-size: 9.5px;
    }

    .print-doc-badge {
        min-width: 0;
        min-height: 21mm;
        padding: 1.5mm 2mm;
        font-size: 14px;
    }

    .print-meta-box {
        gap: 1.5mm;
        font-size: 9.2px;
    }

    .print-section-title {
        margin-bottom: 2mm;
        font-size: 11.5px;
    }

    .print-info-grid {
        gap: 1.7mm;
        margin-bottom: 2.5mm;
    }

    .print-field {
        min-height: 10.5mm;
        padding: 1.45mm 1.8mm;
    }

    .print-field span {
        font-size: 8.4px;
    }

    .print-field strong {
        font-size: 9.8px;
    }

    .print-total-box {
        margin: 1.2mm 0 2.5mm;
        padding: 2.2mm 2.8mm;
    }

    .print-total-box strong {
        font-size: 14.5px;
    }

    .print-total-box .amount-words strong {
        font-size: 10px;
    }

    .print-table {
        margin-bottom: 2.5mm;
        font-size: 9.2px;
    }

    .print-table th,
    .print-table td {
        padding: 1.35mm 1.55mm;
    }

    .print-note {
        padding: 1.4mm 1.7mm;
        font-size: 9px;
    }

    .signature-grid {
        gap: 4mm;
        margin-top: 5mm;
    }

    .signature-box {
        min-height: 11mm;
        font-size: 9px;
    }

    .print-qr-box img {
        width: 18mm;
        height: 18mm;
    }

    .print-verification {
        margin-top: 2mm;
        padding-top: 1.6mm;
        font-size: 8px;
    }

    .print-verification span {
        font-size: 7px;
    }

    .print-verification small {
        font-size: 7.8px;
    }
}

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .payments-table-wrap {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .payments-table {
        min-width: 1040px;
    }

    .installments-table-wrap {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .installments-table {
        min-width: 1120px;
    }

    .vouchers-table-wrap {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .vouchers-table {
        min-width: 1180px;
    }

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

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

    .cashboxes-table-wrap {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .cashboxes-table {
        min-width: 1640px;
    }

    .student-profile-section .table-responsive {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .profile-table {
        min-width: 940px;
    }
}

@media (max-width: 920px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform .2s ease;
        width: var(--sidebar-width);
    }

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

    .main-panel {
        margin-right: 0;
    }

    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
    }

    body.sidebar-collapsed .main-panel {
        margin-right: 0;
    }

    body.sidebar-collapsed .brand-block > div,
    body.sidebar-collapsed .side-section,
    body.sidebar-collapsed .side-link > span:not(.nav-icon):not(.submenu-arrow),
    body.sidebar-collapsed .submenu-arrow,
    body.sidebar-collapsed .side-submenu,
    body.sidebar-collapsed .sidebar-foot span,
    body.sidebar-collapsed .sidebar-foot strong,
    body.sidebar-collapsed .sidebar-foot a {
        display: initial;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    body.sidebar-collapsed .brand-block > div {
        display: block;
    }

    body.sidebar-collapsed .side-link > span:not(.nav-icon):not(.submenu-arrow) {
        display: inline;
    }

    body.sidebar-collapsed .submenu-arrow {
        display: inline-grid;
    }

    body.sidebar-collapsed .sidebar-foot span,
    body.sidebar-collapsed .sidebar-foot strong,
    body.sidebar-collapsed .sidebar-foot a {
        display: block;
    }

    body.sidebar-collapsed .side-section,
    body.sidebar-collapsed .side-submenu {
        display: grid;
    }

    body.sidebar-collapsed .side-link {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    body.sidebar-collapsed .brand-logo {
        width: 44px;
        height: 44px;
    }

    body.sidebar-collapsed .sidebar-foot::before {
        display: none;
    }

    .sidebar-toggle {
        display: inline-grid;
    }

    .topbar {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .global-search {
        order: 3;
        max-width: none;
        flex-basis: 100%;
    }

    .payments-searchbar {
        grid-template-columns: minmax(0, 1fr) auto;
        direction: rtl;
    }

    .payments-quick-search {
        grid-column: 1 / -1;
        width: 100%;
        flex-wrap: wrap;
        order: -1;
    }

    .payments-quick-search input {
        flex: 1 1 180px;
        width: auto;
    }

    .payments-filter-panel {
        inset-inline: 0;
        width: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .installments-searchbar {
        grid-template-columns: auto auto;
        direction: rtl;
    }

    .installments-quick-search {
        grid-column: 1 / -1;
        width: 100%;
        flex-wrap: wrap;
        order: -1;
    }

    .installments-quick-search input {
        flex: 1 1 180px;
        width: auto;
    }

    .installments-filter-panel {
        right: 0;
        left: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .vouchers-searchbar {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .vouchers-quick-search {
        width: 100%;
        flex-wrap: wrap;
        margin-inline-start: 0;
    }

    .vouchers-quick-search input {
        flex: 1 1 180px;
        width: auto;
    }

    .vouchers-filter-panel {
        right: 0;
        left: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .journal-page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .journal-primary-actions {
        width: 100%;
    }

    .journal-primary-actions .btn {
        flex: 1 1 0;
    }

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

    .cashboxes-overview,
    .cashboxes-filterbar {
        grid-template-columns: 1fr;
    }

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

    .stats-grid,
    .dashboard-kpis,
    .two-columns,
    .three-columns {
        grid-template-columns: 1fr;
    }

    .user-chip div,
    .user-chip .top-icon-chevron {
        display: none;
    }

    .student-profile-info,
    .student-finance-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-radius: 8px;
    }

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

    .student-profile-info.compact {
        grid-template-columns: 1fr;
    }

    .student-profile-main {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .student-profile-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .content-panel {
        padding: 18px 14px 30px;
    }

    .page-heading h1 {
        font-size: 23px;
    }

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

    .journal-board {
        padding: 14px;
    }

    .journal-primary-actions,
    .journal-query-summary,
    .journal-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .journal-date-query-form,
    .journal-form-meta {
        grid-template-columns: 1fr;
    }

    .journal-statement-field {
        grid-column: auto;
    }

    .card {
        padding: 14px;
    }

    .payments-board {
        padding: 12px;
        border-radius: var(--radius-md);
    }

    .installments-board {
        padding: 12px;
        border-radius: var(--radius-md);
    }

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

    .installments-filter-panel,
    .installment-pay-form,
    .installment-show-grid,
    .voucher-type-tabs,
    .voucher-form-grid,
    .voucher-dynamic-section,
    .cashboxes-reset-form,
    .students-reset-form,
    .factory-reset-form,
    .student-profile-info,
    .student-profile-info.compact,
    .student-finance-strip,
    .student-details-grid,
    .reservation-top-grid,
    .reservation-form-grid {
        grid-template-columns: 1fr;
    }

    .student-details-grid > div.full {
        grid-column: auto;
    }

    .student-financial-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .student-profile-main {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding-inline: 16px;
    }

    .student-profile-title {
        padding-top: 0;
    }

    .student-profile-actions {
        justify-content: center;
    }

    .student-profile-info,
    .student-finance-strip {
        border-radius: 8px;
    }

    .student-profile-info div,
    .student-finance-strip div {
        border-inline-start: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .student-profile-info div:last-child,
    .student-finance-strip div:last-child {
        border-bottom: 0;
    }

    .student-profile-switch,
    .student-profile-tabs {
        border-radius: 8px;
        grid-template-columns: 1fr;
    }

    .student-profile-switch.has-financial-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .student-profile-switch a {
        min-width: 0;
        padding-inline: 6px;
        text-align: center;
        font-size: 11px;
    }

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

    .student-report-actions {
        justify-content: flex-start;
    }

    .installment-pay-modal {
        padding: 26px 12px 16px;
    }

    .vouchers-board {
        padding: 12px;
    }

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

    .journal-receiver-row,
    .journal-receivers-head {
        grid-template-columns: 1fr;
    }

    .import-template-card {
        align-items: stretch;
        flex-direction: column;
    }

    .dropdown-panel {
        inset-inline-start: auto;
        inset-inline-end: 0;
        width: calc(100vw - 28px);
    }

    .toolbar-filters,
    .form-actions {
        width: 100%;
    }

    .payments-report-filter-fields {
        grid-template-columns: 1fr;
    }

    .payments-report-filter-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .permissions-hero,
    .permission-panel > summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .inline-permission-form,
    .permission-check-grid,
    .permission-state-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        flex: 0 0 auto;
    }
}

/* Keep Safari's print viewport independent from the mobile layout rules above. */
@media print {
    html,
    body,
    .main-panel,
    .content-panel,
    .print-page,
    .print-document,
    .content-panel > .card:not(.no-print) {
        width: 148mm !important;
        min-width: 148mm !important;
        max-width: 148mm !important;
    }

    .content-panel,
    .print-page {
        padding: 0 !important;
        margin: 0 !important;
    }

    .print-document {
        display: block !important;
        min-height: 210mm !important;
        padding: 6mm !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        visibility: visible !important;
    }

    .print-document > * {
        visibility: visible !important;
    }

    /* Receipts, vouchers and installment statements are single A5 documents.
       Keeping their page box fixed prevents Safari from creating a trailing blank page. */
    .print-page:not(.report-print-page) {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        break-after: avoid-page !important;
        page-break-after: avoid !important;
    }

    .print-page:not(.report-print-page) .invoice-document {
        /* 198mm leaves a printer-safe bottom area inside the 210mm A5 sheet. */
        height: 198mm !important;
        min-height: 198mm !important;
        max-height: 198mm !important;
        overflow: hidden !important;
        break-after: avoid-page !important;
        page-break-after: avoid !important;
    }

    .print-page:not(.report-print-page) .receipt-print {
        display: flex !important;
        flex-direction: column !important;
    }

    .print-page:not(.report-print-page) .receipt-print .signature-grid {
        flex: 0 0 auto;
        margin-top: auto !important;
        padding-top: 7mm;
    }

    .report-print-document {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }
}

/* Native tables keep Arabic print layouts stable in the browser and in PDF engines. */
.print-page table.print-meta-box,
.print-page table.print-info-grid,
.print-page table.print-mini-totals,
.print-page table.print-total-box,
.print-page table.signature-grid {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
}

.print-page table.print-meta-box,
.print-page table.print-mini-totals {
    border-spacing: 1.2mm 0;
}

.print-page table.print-info-grid {
    border-spacing: 1.5mm 1.7mm;
    margin-bottom: 1.3mm;
}

.print-page table.signature-grid {
    border-spacing: 3mm 0;
}

.print-page table.print-meta-box td,
.print-page table.print-mini-totals td,
.print-page table.print-info-grid td.print-field {
    vertical-align: top;
    background: rgba(255, 255, 255, .88);
}

.print-page table.print-meta-box td,
.print-page table.print-mini-totals td {
    width: 33.333%;
}

.print-page table.receipt-balance-summary td {
    width: 50%;
}

.print-page table.print-info-grid td.print-field {
    width: 50%;
}

.print-page table.print-info-grid td.print-field.full,
.print-page table.print-info-grid td.print-field.wide {
    width: 100%;
}

.print-page table.print-total-box td {
    width: 50%;
    vertical-align: top;
}

.print-page table.signature-grid td {
    width: 33.333%;
    vertical-align: top;
}

.print-page .print-brand-row {
    display: table;
    width: 100%;
    table-layout: fixed;
    margin: 0 0 2mm;
    border-collapse: collapse;
}

.print-page .print-brand-row td {
    display: table-cell;
    vertical-align: middle;
}

.print-page .print-brand-logo {
    width: 21mm;
    text-align: right;
}

.print-page .print-brand-logo img {
    width: 16mm;
    height: 16mm;
    object-fit: contain;
}

.print-page .print-brand-title {
    text-align: center;
}

.print-page .print-brand-title h1 {
    margin: 0;
    color: #0D6933;
    font-family: var(--font-print);
    font-size: 17px;
    font-weight: 700;
}

.print-page .print-brand-title p {
    margin: 1mm 0 0;
    color: #56645f;
    font-size: 9px;
    font-weight: 700;
}

.print-page .print-school-address,
.school-identity .print-school-address {
    display: block !important;
    margin-top: 1mm;
    color: #344d42;
    font-family: Arial, sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.35;
}

.settings-logo-field {
    align-content: start;
}

.settings-logo-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--muted-color);
    font-size: 12px;
}

.settings-logo-preview img {
    width: 58px;
    height: 58px;
    padding: 4px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

@media print {
    .no-print,
    .no-print *,
    .print-page .form-actions,
    .print-page button,
    .print-page .btn {
        display: none !important;
        visibility: hidden !important;
    }

    .print-document::before {
        background-image: var(--print-logo-image, url("../img/logo.png")) !important;
    }
}

.print-page .print-brand-qr {
    width: 24mm;
    text-align: center;
}

.print-page .print-brand-qr .print-qr-box {
    position: static;
    width: 19mm;
    margin: 0 auto;
    padding: 1mm;
    border: 1px solid #118C44;
    border-top: 2mm solid #FCDB06;
}

.print-page .print-brand-qr .print-qr-box img {
    display: block;
    width: 16mm;
    height: 16mm;
    margin: 0 auto;
}

.print-page .print-brand-qr .print-qr-box span {
    display: none;
}

.print-page .print-qr-caption {
    display: block;
    width: 24mm;
    margin: 1.1mm auto 0;
    color: #314a40;
    font-family: var(--font-print);
    font-size: 8px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}


.print-page .print-document,
.print-page .print-document table,
.print-page .print-document td,
.print-page .print-document th,
.print-page .print-document span,
.print-page .print-document strong {
    font-family: var(--font-print);
}

.print-page .print-meta-box strong,
.print-page .print-field strong,
.print-page .print-mini-totals strong,
.print-page .print-table td,
.print-page .print-note,
.print-page .signature-box {
    font-family: var(--font-print);
    font-weight: 400;
}

.print-page .print-brand-title h1,
.print-page .school-identity h1,
.print-page .print-section-title,
.print-page .print-doc-badge {
    font-family: var(--font-heading);
}

.print-page .print-qr-box {
    padding: 1.4mm;
    border: 1px solid #118C44;
    border-top: 2mm solid #FCDB06;
}

.print-page .print-qr-box span {
    margin-top: 1mm;
    padding-top: .8mm;
    border-top: 1px solid #d2ded8;
    color: #314a40;
}

.developer-simulation-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    color: #0D6933;
    background: #eef8f1;
    border: 1px solid #b9dbc5;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
}

.developer-simulation-badge span,
.developer-live-state span {
    width: 8px;
    height: 8px;
    background: #118C44;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(17, 140, 68, .12);
}

.developer-simulation-badge.maintenance-active {
    color: #805f00;
    background: #fff9dc;
    border-color: #ead36b;
}

.developer-simulation-badge.maintenance-active span {
    background: #d3a900;
    box-shadow: 0 0 0 4px rgba(252, 219, 6, .2);
}

.developer-maintenance-note { margin-top: 14px; }

.developer-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
    padding: 22px;
    color: #fff;
    background: #0D6933;
    border-right: 5px solid #FCDB06;
    border-radius: 8px;
}

.developer-hero h2 { margin: 4px 0; font-size: 25px; }
.developer-hero p { margin: 0; color: rgba(255,255,255,.78); }
.developer-hero > div > span { color: #FCDB06; font-size: 12px; font-weight: 800; }
.developer-live-state { display: inline-flex; align-items: center; gap: 9px; min-width: 142px; padding: 10px 13px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 6px; font-weight: 800; }
.developer-live-state span { background: #67dc91; box-shadow: 0 0 0 4px rgba(103,220,145,.16); }
.developer-live-state.danger span { background: #ffce52; box-shadow: 0 0 0 4px rgba(255,206,82,.16); }

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

.developer-checks-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.developer-check-card { padding: 16px; }
.developer-check-row { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.developer-check-row:last-child { border-bottom: 0; }
.developer-check-row > span { padding: 4px 6px; text-align: center; color: #0D6933; background: #e7f5ec; border-radius: 4px; font-size: 11px; font-weight: 800; }
.developer-check-row.failed > span { color: #a32b2b; background: #f9e8e8; }
.developer-check-row strong, .developer-check-row small { display: block; }
.developer-check-row small { margin-top: 2px; color: var(--muted-color); overflow-wrap: anywhere; }

.developer-backup-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-color); }
.developer-backup-list strong, .developer-backup-list small { display: block; }
.developer-backup-list small { margin-top: 3px; color: var(--muted-color); }
.developer-backup-list form { margin: 0; }
.developer-operational-reset {
    margin-bottom: 16px;
    border-color: rgba(192, 48, 48, .24);
    box-shadow: 0 12px 34px rgba(121, 31, 31, .07);
}
.developer-operational-reset .card-header {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}
.developer-reset-scope {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}
.developer-reset-scope > div {
    min-height: 94px;
    display: grid;
    align-content: start;
    gap: 5px;
    padding: 13px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #f8faf9;
}
.developer-reset-scope strong {
    color: var(--primary-color);
    font-family: var(--font-heading);
}
.developer-reset-scope span {
    color: var(--muted-color);
    font-size: 12px;
    line-height: 1.8;
}
.developer-reset-form {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}
.developer-restore-hero { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:18px; padding:22px; color:#fff; background:linear-gradient(135deg,#0b5f31,#118c44); border:1px solid rgba(255,255,255,.14); border-radius:7px; box-shadow:0 14px 34px rgba(13,105,51,.15); }
.developer-restore-hero span { color:#FCDB06; font-size:12px; font-weight:800; }
.developer-restore-hero h2 { margin:4px 0; font-size:25px; }
.developer-restore-hero p { margin:0; color:rgba(255,255,255,.8); }
.developer-restore-layout { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr); gap:16px; margin-bottom:16px; }
.developer-backup-select { display:grid; gap:7px; }
.developer-backup-select > span { font-weight:800; }
.developer-restore-divider { display:flex; align-items:center; gap:12px; margin:14px 0; color:var(--muted-color); }
.developer-restore-divider::before,.developer-restore-divider::after { content:""; flex:1; height:1px; background:var(--border-color); }
.developer-restore-safety ul { display:grid; gap:0; margin:0; padding:0; list-style:none; }
.developer-restore-safety li { display:grid; gap:2px; padding:11px 0; border-bottom:1px solid var(--border-color); }
.developer-restore-safety li:last-child { border-bottom:0; }
.developer-restore-safety li strong { color:var(--primary-color); }
.developer-restore-safety li span { color:var(--muted-color); font-size:12px; }
.developer-restore-meta { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.developer-restore-meta span { padding:5px 8px; color:#0D6933; background:#eaf5ee; border-radius:4px; font-size:11px; font-weight:800; }
.developer-select-all { display:flex; align-items:center; gap:12px; margin-bottom:12px; padding:13px; background:#edf8f1; border:1px solid #cbe8d5; border-radius:6px; cursor:pointer; }
.developer-select-all input,.developer-component-option input { inline-size:18px; block-size:18px; accent-color:var(--primary-color); }
.developer-select-all span,.developer-select-all strong,.developer-select-all small,.developer-component-option span,.developer-component-option strong,.developer-component-option small,.developer-component-option em { display:block; }
.developer-select-all small,.developer-component-option small { margin-top:2px; color:var(--muted-color); }
.developer-component-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.developer-component-option { display:grid; grid-template-columns:22px 1fr; align-items:start; gap:10px; min-height:108px; padding:13px; border:1px solid var(--border-color); border-radius:6px; cursor:pointer; transition:border-color .2s ease,background .2s ease; }
.developer-component-option:has(input:checked) { background:#f4fbf6; border-color:#8ac8a2; }
.developer-component-option.disabled { opacity:.48; cursor:not-allowed; }
.developer-component-option em { margin-top:8px; color:#0D6933; font-size:11px; font-style:normal; font-weight:800; }
.developer-restore-warning { margin:14px 0; }
.developer-restore-confirm { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding-top:14px; border-top:1px solid var(--border-color); }
.developer-restore-confirm label { display:grid; gap:7px; font-weight:800; }
.developer-restore-submit { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:16px; padding:14px; background:#f7f9f8; border:1px solid var(--border-color); border-radius:6px; }
.developer-restore-submit strong,.developer-restore-submit small { display:block; }
.developer-restore-submit small { margin-top:3px; color:var(--muted-color); }
.developer-config-note { display: grid; gap: 6px; margin-top: 14px; padding: 12px; background: #f5f8f7; border: 1px solid var(--border-color); border-radius: 6px; }
.developer-config-note code { direction: ltr; padding: 7px; overflow-x: auto; color: #0D6933; background: #fff; border: 1px solid #dce6e1; }
.developer-log { max-height: 360px; overflow: auto; direction: ltr; padding: 10px; background: #111b17; border-radius: 6px; }
.developer-log code { display: block; padding: 7px 4px; color: #d6e8df; border-bottom: 1px solid rgba(255,255,255,.07); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }

.maintenance-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: #edf5f1;
}

.maintenance-shell {
    width: min(760px, 100%);
    padding: 28px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(17,140,68,.16);
    border-top: 5px solid #118C44;
    border-radius: 8px;
    box-shadow: 0 28px 70px rgba(13,105,51,.13);
}

.maintenance-brand { display: flex; align-items: center; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--border-color); }
.maintenance-brand img { width: 62px; height: 62px; object-fit: contain; }
.maintenance-brand strong, .maintenance-brand span { display: block; }
.maintenance-brand strong { color: #0D6933; font-family: var(--font-heading); font-size: 21px; }
.maintenance-brand span { margin-top: 3px; color: var(--muted-color); }
.maintenance-status { padding: 34px 0 24px; text-align: center; }
.maintenance-status > span { display: inline-block; width: 11px; height: 11px; background: #FCDB06; border-radius: 50%; box-shadow: 0 0 0 7px rgba(252,219,6,.18); }
.maintenance-status strong { display: block; margin-top: 18px; color: #18372a; font-family: var(--font-heading); font-size: 30px; }
.maintenance-status p { margin: 7px 0 0; color: var(--muted-color); }
.maintenance-slider { position: relative; min-height: 165px; overflow: hidden; background: #f5f9f7; border: 1px solid #dbe8e1; border-radius: 7px; }
.maintenance-slider article { position: absolute; inset: 0; display: grid; align-content: center; padding: 25px; opacity: 0; transform: translateX(-18px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; }
.maintenance-slider article.active { opacity: 1; transform: translateX(0); pointer-events: auto; }
.maintenance-slider span { color: #118C44; font-size: 12px; font-weight: 800; }
.maintenance-slider h2 { margin: 5px 0 8px; font-size: 21px; }
.maintenance-slider p { margin: 0; color: #53655c; line-height: 1.9; }
.maintenance-dots { display: flex; justify-content: center; gap: 7px; margin: 14px 0 20px; }
.maintenance-dots button { width: 8px; height: 8px; padding: 0; border: 0; background: #cbd9d2; border-radius: 50%; cursor: pointer; }
.maintenance-dots button.active { width: 24px; background: #118C44; border-radius: 4px; }
.maintenance-shell footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted-color); font-size: 12px; }
.maintenance-shell footer a { color: #0D6933; font-weight: 800; }

@media (max-width: 900px) {
    .developer-grid, .developer-checks-grid, .developer-restore-layout, .developer-component-grid, .developer-restore-confirm, .developer-reset-scope { grid-template-columns: 1fr; }
    .developer-hero { align-items: flex-start; flex-direction: column; }
    .developer-restore-hero,.developer-restore-submit { align-items:flex-start; flex-direction:column; }
}

/* Financial year closing */
.year-closing-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-inline-start: 4px solid var(--primary-color);
}

.year-closing-callout h2,
.year-closing-heading h1 {
    margin: 3px 0 6px;
}

.year-closing-callout p,
.year-closing-heading p {
    margin: 0;
}

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

.year-closing-stats .stat-card {
    min-height: 118px;
}

.year-closing-stats .stat-warning {
    border-top-color: var(--secondary-color);
}

.year-closing-stats .stat-danger {
    border-top-color: var(--danger-color);
}

.year-closing-stats .stat-success {
    border-top-color: var(--success-color);
}

.year-closing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
    gap: 18px;
    align-items: start;
}

.year-closing-layout .form-span-2 {
    grid-column: 1 / -1;
}

.closing-confirmation {
    padding: 14px;
    background: #fffaf0;
    border: 1px solid #f3dea0;
    border-radius: var(--radius-sm);
}

.closing-confirmation small {
    color: var(--muted-color);
}

.closing-accounts-list {
    display: grid;
    max-height: 520px;
    overflow: auto;
}

.closing-accounts-list > div:not(.empty-state) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px solid var(--border-color);
}

.closing-accounts-list > div:last-child {
    border-bottom: 0;
}

.closing-accounts-list span {
    color: var(--text-color);
    font-size: 13px;
}

.closing-accounts-list strong {
    white-space: nowrap;
    color: var(--primary-color);
    font-size: 13px;
}

@media (max-width: 1200px) {
    .year-closing-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .year-closing-callout,
    .year-closing-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .year-closing-layout,
    .year-closing-stats {
        grid-template-columns: 1fr;
    }
}
