@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

:root {
    --tm-purple: #6657ff;
    --tm-teal: #11c5b4;
    --tm-green: #34c759;
    --tm-orange: #f5a85c;
    --tm-blue: #4f63ff;
    --tm-bg: #f4f7fb;
    --tm-white: #ffffff;
    --tm-text: #111827;
    --tm-muted: #6b7280;
    --tm-border: #e5eaf2;
    --tm-soft-blue: #eef0ff;
    --tm-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    --tm-radius: 8px;
    --tm-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --tm-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html {
    height: 100%;
    scroll-padding-top: 92px;
}

body {
    margin: 0;
    background: var(--tm-bg);
    color: var(--tm-text);
    font-family: var(--tm-font-sans);
    font-size: 14px;
    line-height: 1.45;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

a {
    text-decoration: none;
    transition: var(--tm-transition);
}

.app-shell {
    display: block;
    min-height: 100vh;
    padding-top: 76px;
    padding-left: 260px;
    background: var(--tm-bg);
}

.topbar {
    background: var(--tm-white);
    border-bottom: 1px solid var(--tm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 76px;
    z-index: 1020;
}

.topbar,
.sidebar,
.content {
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

.topbar-brand, .topbar-user, .brand-link {
    display: flex;
    align-items: center;
}

.brand-link {
    gap: 12px;
    color: var(--tm-purple);
    font-weight: 700;
    font-size: 22px;
}

.brand-link img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.brand-icon {
    font-size: 22px;
}

.icon-btn {
    border: 0;
    background: transparent;
    color: var(--tm-muted);
    width: 38px;
    height: 38px;
    border-radius: var(--tm-radius);
    margin-right: 10px;
    transition: var(--tm-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #f3f4f6;
    color: var(--tm-text);
}

.topbar-user {
    gap: 12px;
}

.user-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    transition: var(--tm-transition);
}

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

.user-profile-link:hover .user-copy strong {
    color: var(--tm-purple);
}

.user-copy {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.user-copy strong {
    font-size: 13px;
    color: #0f172a;
    font-weight: 700;
}

.user-copy span {
    font-size: 13px;
    color: var(--tm-muted);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f2f4ff;
    border: 1px solid var(--tm-border);
    display: grid;
    place-items: center;
    color: var(--tm-purple);
    overflow: hidden;
    flex: 0 0 auto;
    transition: var(--tm-transition);
}

.user-profile-link:hover .user-avatar {
    border-color: var(--tm-purple);
    box-shadow: 0 0 0 3px rgba(102, 87, 255, 0.15);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logout-link {
    color: var(--tm-muted);
    padding: 8px;
    transition: var(--tm-transition);
}

.logout-link:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.sidebar {
    background: var(--tm-white);
    border-right: 1px solid var(--tm-border);
    padding: 16px;
    position: fixed;
    top: 76px;
    left: 0;
    bottom: 0;
    width: 260px;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1010;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cfd7e6 transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cfd7e6;
    border-radius: 999px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: visible;
}

.nav-link {
    height: 50px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    border-radius: 6px;
    color: #5f6b7a;
    font-size: 15px;
    font-weight: 500;
    transition: var(--tm-transition);
}

.nav-link:hover {
    background: #f8fafc;
    color: var(--tm-purple);
    transform: translateX(4px);
}

.nav-link:hover i {
    color: var(--tm-purple);
}

.nav-link span:first-of-type {
    flex: 1 1 auto;
    min-width: 0;
}

.nav-link i {
    width: 18px;
    color: #74808e;
}

.nav-badge {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 87, 255, .12);
    color: var(--tm-purple);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.nav-link.active {
    background: var(--tm-soft-blue);
    color: var(--tm-purple);
    font-weight: 700;
}

.nav-link.active i {
    color: var(--tm-purple);
}

.nav-group {
    display: grid;
    gap: 4px;
}

.nav-link-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.nav-caret {
    width: 14px !important;
    margin-left: auto;
    font-size: 12px;
    transition: transform .18s ease;
}

.nav-group.is-open .nav-caret,
.nav-submenu.is-open + .nav-caret {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    padding: 0 0 4px 44px;
    gap: 4px;
}

.nav-submenu.is-open {
    display: grid;
}

.nav-sublink {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 8px;
    color: #667284;
    font-size: 14px;
    font-weight: 500;
}

.nav-sublink i {
    width: 16px;
    color: #8b94a3;
    font-size: 13px;
}

.nav-sublink.active {
    background: #f4f3ff;
    color: var(--tm-purple);
    font-weight: 700;
}

.nav-sublink.active i {
    color: var(--tm-purple);
}

.nav-section {
    margin: 26px 8px 10px;
    color: #3f4652;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.content {
    position: relative;
    padding: 24px;
    min-width: 0;
    width: 100%;
    min-height: calc(100vh - 76px);
    overflow: visible;
}

.panel-footer {
    padding: 16px 18px;
    border-top: 1px solid var(--tm-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
    gap: 16px;
}

.profile-photo-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--tm-border);
    border-radius: 12px;
    background: #fbfcff;
}

.profile-photo-preview {
    width: 94px;
    height: 94px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: linear-gradient(135deg, var(--tm-purple), var(--tm-teal));
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 34px;
    box-shadow: 0 14px 28px rgba(102, 87, 255, .2);
    overflow: hidden;
    flex: 0 0 auto;
}

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

.profile-name {
    color: #101827;
    font-size: 18px;
    font-weight: 800;
}

.profile-meta {
    color: var(--tm-muted);
    font-size: 13px;
    font-weight: 600;
}

.profile-upload-status {
    min-height: 18px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
}

.pending-approval-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pending-approval-banner strong {
    display: block;
    margin-bottom: 4px;
    color: #172033;
    font-size: 15px;
}

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: -24px -24px 16px;
    padding: 24px 24px 12px;
    position: sticky;
    top: 76px;
    z-index: 30;
    background: var(--tm-bg);
    border-bottom: 1px solid rgba(229, 234, 242, .72);
}

.page-title-row > div:last-child {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.page-title-row .btn {
    white-space: nowrap;
}

.page-title h1 {
    font-size: 25px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.page-title p {
    margin: 3px 0 0;
    color: var(--tm-muted);
    font-size: 13px;
}

.btn {
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 14px;
    transition: var(--tm-transition);
}

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

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

.btn-primary {
    background: var(--tm-purple);
    border-color: var(--tm-purple);
}

.btn-primary:hover {
    background: #5043e5;
    border-color: #5043e5;
    box-shadow: 0 4px 12px rgba(102, 87, 255, 0.25);
}

.btn-light-action {
    background: #f4f6ff;
    border: 1px solid #dfe4ff;
    color: var(--tm-purple);
}

.btn-light-action:hover {
    background: var(--tm-soft-blue);
    border-color: #cdd4ff;
    color: #5043e5;
    box-shadow: 0 4px 12px rgba(102, 87, 255, 0.12);
}

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

.kpi-card {
    min-height: 140px;
    color: #fff;
    border-radius: 12px;
    padding: 20px 18px;
    box-shadow: var(--tm-shadow);
    position: relative;
    overflow: hidden;
}

.kpi-card.purple { background: linear-gradient(135deg, #6b5cff, #5142d9); }
.kpi-card.teal { background: linear-gradient(135deg, #10c7b4, #04aa9f); }
.kpi-card.green { background: linear-gradient(135deg, #34c759, #18a84b); }
.kpi-card.orange { background: linear-gradient(135deg, #f9b765, #ef8654); }

.kpi-card:after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -28px;
    width: 110px;
    height: 110px;
    border: 8px solid rgba(255,255,255,.16);
    border-radius: 22px;
    transform: rotate(-16deg);
}

.kpi-card label {
    display: block;
    color: rgba(255,255,255,.68);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
}

.kpi-card strong {
    display: block;
    font-size: 30px;
    font-weight: 800;
}

.kpi-card span {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 9px;
    border-radius: 6px;
    background: rgba(255,255,255,.22);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.panel {
    background: var(--tm-white);
    border: 1px solid var(--tm-border);
    border-radius: 12px;
    box-shadow: var(--tm-shadow);
}

.accounting-hero,
.accounting-two-grid,
.accounting-three-grid,
.compact-kpi-grid,
.accounting-section-stack {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.accounting-hero {
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
}

.hero-card,
.insight-card,
.compact-kpi {
    border-radius: 18px;
    padding: 22px;
    color: #fff;
    box-shadow: var(--tm-shadow);
    overflow: hidden;
    position: relative;
}

.hero-card {
    background: linear-gradient(135deg, #5346e8 0%, #1cbbb0 100%);
}

.hero-card::after,
.compact-kpi::after {
    content: "";
    position: absolute;
    right: -18px;
    bottom: -28px;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    transform: rotate(18deg);
}

.insight-card {
    background: linear-gradient(180deg, #0f172a 0%, #16243b 100%);
}

.hero-card h2,
.insight-card h3,
.compact-kpi strong,
.compact-kpi label,
.compact-kpi span {
    position: relative;
    z-index: 1;
}

.hero-card h2,
.insight-card h3 {
    margin: 0 0 10px;
}

.hero-card h2 {
    font-size: 30px;
    line-height: 1.12;
}

.hero-card p,
.insight-card .account-line span,
.insight-card .account-line strong {
    color: rgba(255, 255, 255, 0.92);
}

.hero-card p {
    max-width: 70ch;
    margin: 0;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 12px;
    font-weight: 700;
}

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

.compact-kpi {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.compact-kpi label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 800;
}

.compact-kpi strong {
    display: block;
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1.04;
    margin-bottom: 12px;
}

.compact-kpi span {
    display: inline-flex;
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    font-size: 11px;
    font-weight: 700;
}

.accent-purple { background: linear-gradient(135deg, #6657ff 0%, #4f63ff 100%); }
.accent-orange { background: linear-gradient(135deg, #f5a85c 0%, #f38f49 100%); }
.accent-green { background: linear-gradient(135deg, #34c759 0%, #21a547 100%); }
.accent-teal { background: linear-gradient(135deg, #11c5b4 0%, #16a7d9 100%); }

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

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

.panel-header {
    padding: 18px 18px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.panel-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}

.panel-header-copy {
    display: grid;
    gap: 4px;
}

.panel-subtitle {
    margin: 0;
    color: var(--tm-muted);
    font-size: 12px;
}

.panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.panel-body {
    padding: 18px;
}

.panel-body-soft {
    display: grid;
    gap: 14px;
}

.empty-state {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px dashed #d7def0;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfcff 0%, #f6f8fd 100%);
}

.empty-state strong {
    font-size: 14px;
    color: #172033;
}

.empty-state p {
    margin: 0;
    color: var(--tm-muted);
    line-height: 1.55;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-box {
    min-height: 315px;
}

.table {
    margin-bottom: 0;
    color: #111827;
}

.table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cfd7e6 transparent;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #cfd7e6;
    border-radius: 999px;
}

.accounting-table-wrap {
    border-top: 1px solid var(--tm-border);
}

.accounting-table-wrap .table {
    min-width: 760px;
}

.table thead th {
    color: #4b5563;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    background: #f8fafc;
    border-bottom: 2px solid var(--tm-border);
    padding: 14px 16px;
}

.table tbody tr {
    transition: var(--tm-transition);
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table tbody td {
    padding: 15px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--tm-border);
    font-size: 14px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-width: 66px;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 700;
}

.status-paid { background: #dcfce7; color: #15803d; }
.status-partial { background: #fef3c7; color: #b45309; }
.status-pending { background: #e0f2fe; color: #0369a1; }
.status-active { background: #eef2ff; color: var(--tm-purple); }
.status-inactive { background: #f3f4f6; color: #4b5563; }
.status-closed { background: #f3f4f6; color: #4b5563; }
.status-rejected { background: #fee2e2; color: #b91c1c; }
.status-unpaid { background: #fee2e2; color: #b91c1c; }
.status-cancelled { background: #f3f4f6; color: #4b5563; }

.student-photo-col {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    text-align: center;
}

.student-avatar-thumb {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    display: inline-block !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    border: 1px solid #dfe4ff;
    background: #f7f8ff;
    box-shadow: 0 4px 10px rgba(79, 99, 255, .12);
}

.student-avatar-box {
    width: 42px !important;
    height: 42px !important;
    display: inline-grid !important;
    place-items: center !important;
    overflow: hidden !important;
    border-radius: 50% !important;
}

.student-avatar-box img {
    width: 42px !important;
    height: 42px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.student-avatar-fallback {
    width: 42px !important;
    height: 42px !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 50% !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #6657ff 0%, #11c5b4 100%) !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 0 1px #dfe4ff, 0 6px 14px rgba(102, 87, 255, .22) !important;
    font-size: 16px !important;
}

.student-avatar-preview,
.student-profile-photo img {
    object-fit: cover;
    border: 1px solid #dfe4ff;
    background: #f7f8ff;
}

.student-avatar-empty {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, #6b5cff, #11c5b4);
    border: 3px solid #ffffff;
    box-shadow: 0 6px 14px rgba(102, 87, 255, .22), 0 0 0 1px #dfe4ff;
    font-size: 15px;
}

.student-avatar-empty.large,
.student-avatar-preview {
    width: 82px;
    height: 82px;
    border-radius: 12px;
}

.student-profile-photo {
    display: flex;
    justify-content: center;
}

.student-profile-photo img,
.student-profile-photo span {
    width: 120px;
    height: 120px;
    border-radius: 16px;
}

.student-profile-photo span {
    display: grid;
    place-items: center;
    color: var(--tm-purple);
    background: #eef0ff;
    border: 1px solid #dfe4ff;
    font-size: 42px;
}

.action-icons {
    display: flex;
    gap: 7px;
}

.action-icons a, .action-icons button {
    width: 34px;
    height: 32px;
    border-radius: 7px;
    border: 1px solid #dfe4ff;
    background: #fff;
    color: var(--tm-purple);
    display: grid;
    place-items: center;
}

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

.toolbar form {
    flex: 1;
    max-width: 420px;
}

.search-panel {
    margin-bottom: 16px;
}

.search-panel .panel-body {
    padding: 18px;
}

.search-bar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.search-form {
    flex: 1 1 auto;
    max-width: 520px;
}

.search-input-wrap {
    position: relative;
}

.search-input-wrap > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b94a5;
    font-size: 13px;
    pointer-events: none;
}

.search-input-wrap .form-control {
    padding-left: 40px;
}

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

.table-entity {
    display: grid;
    gap: 2px;
    min-width: 170px;
}

.table-entity strong,
.table-entity .text-primary {
    font-weight: 700;
}

.table-entity-meta {
    color: var(--tm-muted);
    font-size: 12px;
    line-height: 1.45;
}

.table-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
}

.ledger-print-surface {
    display: grid;
    gap: 16px;
}

.ledger-print-meta {
    display: none;
}

.ledger-print-card {
    border: 1px solid var(--tm-border);
    border-radius: 12px;
    background: #f8fbff;
    padding: 14px 16px;
}

.ledger-print-card span {
    display: block;
    color: var(--tm-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.ledger-print-card strong {
    color: #172033;
    font-size: 14px;
    font-weight: 800;
}

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

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

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

.filter-note {
    margin-top: 12px;
    color: var(--tm-muted);
    font-size: 13px;
    font-weight: 600;
}

.form-control, .form-select {
    border-color: #dbe2ee;
    border-radius: 7px;
    font-size: 14px;
    min-height: 40px;
    transition: var(--tm-transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--tm-purple);
    box-shadow: 0 0 0 3px rgba(102, 87, 255, 0.15);
    outline: 0;
}

.form-label {
    font-size: 13px;
    color: #4b5563;
    font-weight: 700;
}

.quick-actions {
    display: grid;
    gap: 10px;
}

.quick-actions a {
    background: #f7f8ff;
    color: #4f46e5;
    border: 1px solid #e1e6ff;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(17, 197, 180, .18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(102, 87, 255, .2), transparent 38%),
        linear-gradient(135deg, #eef4fb 0%, #f8fbff 46%, #edf3ff 100%);
}

.login-shell {
    width: min(1120px, 100%);
}

.login-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
    background: rgba(255, 255, 255, .84);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(61, 87, 145, .18);
    border: 1px solid rgba(255, 255, 255, .7);
    backdrop-filter: blur(14px);
}

.brand-mark {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.08));
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 30px;
    margin-bottom: 22px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

.login-showcase {
    position: relative;
    overflow: hidden;
    padding: 56px 52px;
    background:
        linear-gradient(160deg, #16345d 0%, #1d5f85 52%, #1ea38a 100%);
    color: #ffffff;
}

.login-showcase::before,
.login-showcase::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.login-showcase::before {
    width: 320px;
    height: 320px;
    background: rgba(255, 255, 255, .08);
    top: -110px;
    right: -80px;
}

.login-showcase::after {
    width: 240px;
    height: 240px;
    border: 1px solid rgba(255, 255, 255, .14);
    bottom: -110px;
    left: -70px;
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .9);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.login-showcase h1 {
    font-size: 42px;
    font-weight: 800;
    margin: 0;
    line-height: 1.06;
    max-width: 420px;
}

.login-showcase p {
    margin: 18px 0 0;
    max-width: 480px;
    color: rgba(255, 255, 255, .86);
    font-size: 16px;
    line-height: 1.7;
}

.login-showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 34px;
}

.login-showcase-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .12);
}

.login-showcase-card span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}

.login-showcase-card strong {
    display: block;
    font-size: 18px;
    line-height: 1.4;
}

.login-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.login-trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(14, 23, 40, .16);
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 600;
}

.login-form-panel {
    padding: 42px 42px 36px;
    background: rgba(255, 255, 255, .78);
}

.login-form-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.login-form-header h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    color: #182033;
}

.login-form-header .login-kicker {
    margin-bottom: 10px;
    background: #eaf0ff;
    color: #3954c6;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #dbe5ff;
    background: #f8faff;
    color: #576279;
    font-size: 12px;
    font-weight: 700;
}

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

.login-field .form-label {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.login-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-label-row span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #8090aa;
    font-size: 14px;
}

.login-input-wrap .form-control {
    min-height: 54px;
    border-radius: 14px;
    border: 1px solid #dbe4f2;
    background: rgba(248, 250, 255, .92);
    padding-left: 44px;
    font-size: 15px;
    box-shadow: none;
}

.login-input-wrap .form-control:focus {
    border-color: #7b89ff;
    box-shadow: 0 0 0 4px rgba(102, 87, 255, .12);
    background: #ffffff;
}

.login-form-panel .form-text {
    color: #728097;
    font-size: 12px;
    line-height: 1.55;
}

.login-submit-btn {
    min-height: 54px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #3c63ea 0%, #6b54ff 100%);
    box-shadow: 0 18px 36px rgba(91, 97, 236, .24);
    font-size: 16px;
    font-weight: 700;
}

.login-submit-btn:hover,
.login-submit-btn:focus {
    background: linear-gradient(135deg, #3558d2 0%, #5a45eb 100%);
}

.login-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff8e7;
    color: #9a6700;
    font-size: 12px;
    font-weight: 700;
}

.login-hint {
    margin-top: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 980px) {
    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-showcase,
    .login-form-panel {
        padding: 34px 24px;
    }

    .login-showcase h1 {
        font-size: 34px;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .login-page {
        padding: 16px;
    }

    .login-showcase-grid {
        grid-template-columns: 1fr;
    }

    .login-form-header {
        flex-direction: column;
    }

    .login-badge {
        min-width: 0;
    }

    .login-form-header h2 {
        font-size: 26px;
    }
}

.flash-message {
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 2040;
    box-shadow: var(--tm-shadow);
    border-radius: 8px;
    padding: 14px 20px;
    border: 0;
    animation: slideInUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideInUp {
    0% {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-backdrop {
    z-index: 1050;
}

.modal {
    z-index: 1060;
}

.modal-dialog {
    margin-top: 92px;
}

.modal-content {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--tm-border);
    padding: 18px 24px;
    background: #f8fafc;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--tm-border);
    padding: 16px 24px;
    background: #f8fafc;
}

.btn-close {
    transition: var(--tm-transition);
}

.btn-close:hover {
    transform: rotate(90deg);
}

body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

.pagination .page-link {
    color: var(--tm-purple);
    border-color: #dfe4ff;
    font-size: 13px;
}

.pagination .active .page-link {
    background: var(--tm-purple);
    border-color: var(--tm-purple);
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 16px;
}

.student-pagination-footer {
    border-top: 1px solid #eef2f7;
    margin-top: 4px;
    padding: 18px 0 2px;
}

.table-count {
    color: var(--tm-muted);
    font-size: 13px;
    font-weight: 600;
}

.student-count-pill {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e5eaf2;
    color: #596579;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}

.student-count-pill i,
.student-count-pill strong {
    color: var(--tm-purple);
}

.smart-pagination {
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
    padding: 8px;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.smart-pagination .page-link {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 10px;
    border: 0;
    background: #f8faff;
    color: var(--tm-purple);
    font-weight: 700;
    font-size: 13px;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.smart-pagination .page-link:hover {
    background: #eef0ff;
    box-shadow: 0 5px 12px rgba(79, 99, 255, .13);
}

.smart-pagination .page-link.page-text {
    min-width: 64px;
    padding: 0 14px;
}

.smart-pagination .page-item.disabled .page-link {
    color: #a3acba;
    background: #f4f6fb;
    cursor: not-allowed;
}

.smart-pagination .page-item.active .page-link {
    background: var(--tm-purple);
    color: #fff;
    box-shadow: 0 8px 16px rgba(102, 87, 255, .28);
}

@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .filter-grid.filter-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .accounting-hero,
    .accounting-two-grid,
    .accounting-three-grid,
    .compact-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    html {
        scroll-padding-top: 78px;
    }
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }
    .app-shell {
        min-height: 100vh;
        padding-top: 68px;
        padding-left: 0;
    }
    .topbar {
        height: 68px;
        padding: 0 16px;
    }
    .brand-link { font-size: 18px; }
    .sidebar {
        display: none;
        position: fixed;
        top: 68px;
        left: auto;
        right: 12px;
        bottom: auto;
        width: min(280px, calc(100vw - 24px));
        max-height: calc(100vh - 86px);
        overflow-x: hidden;
        overflow-y: auto;
        border: 1px solid var(--tm-border);
        border-radius: 12px;
        box-shadow: 0 20px 46px rgba(15, 23, 42, .18);
        z-index: 1030;
    }
    .sidebar.open { display: block; }
    .content {
        position: static;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        padding: 16px;
        min-height: calc(100vh - 68px);
        overflow: visible;
    }
    .kpi-grid { grid-template-columns: 1fr; }
    .page-title-row {
        margin: 0 0 16px;
        padding: 0;
        position: static;
        top: auto;
        z-index: auto;
        background: transparent;
        border-bottom: 0;
        flex-direction: column;
        align-items: stretch;
    }
    .page-title-row > div:last-child {
        justify-content: flex-start;
        width: 100%;
    }
    .page-title-row .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-photo-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .modal-dialog {
        margin: 78px 12px 16px;
    }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-bar-row {
        align-items: stretch;
        flex-direction: column;
    }
    .search-form {
        max-width: none;
        width: 100%;
    }
    .search-actions,
    .filter-actions {
        justify-content: flex-start;
        width: 100%;
    }
    .search-actions .btn,
    .filter-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
    .filter-grid,
    .filter-grid.filter-grid-wide {
        grid-template-columns: 1fr;
    }
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .panel-toolbar,
    .hero-meta {
        width: 100%;
        justify-content: flex-start;
    }
    .accounting-hero,
    .accounting-two-grid,
    .accounting-three-grid,
    .compact-kpi-grid {
        grid-template-columns: 1fr;
    }
    .hero-card,
    .insight-card,
    .compact-kpi {
        padding: 18px;
        border-radius: 16px;
    }
    .hero-card h2 {
        font-size: 24px;
    }
    .compact-kpi {
        min-height: 0;
    }
    .accounting-table-wrap .table {
        min-width: 640px;
    }
    .table-footer { flex-direction: column; align-items: flex-start; }
    .smart-pagination { justify-content: flex-start; }
    .pending-approval-banner { flex-direction: column; align-items: flex-start; }
    .user-copy { display: none; }
}

@media print {
    /* Smart print visibility controls */
    body:has(.ledger-print-surface) * {
        visibility: hidden;
    }
    body:has(.ledger-print-surface) .ledger-print-surface,
    body:has(.ledger-print-surface) .ledger-print-surface * {
        visibility: visible;
    }
    body:has(.ledger-print-surface) .ledger-print-surface {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: #fff !important;
        gap: 10mm;
    }

    /* Generic Print Formatting - Apply to all pages */
    body {
        background: #fff !important;
        color: #000 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
    }

    .topbar,
    .sidebar,
    .page-actions,
    .no-print,
    .ledger-no-print,
    button,
    .btn,
    form:not(.print-include),
    .dashboard-filter-grid,
    .dashboard-presets,
    .panel-footer,
    nav,
    .pagination,
    .favorite-toggle-btn,
    .logout-link,
    .user-profile-link,
    .sidebar-toggle {
        display: none !important;
    }

    .app-shell {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        min-height: 0 !important;
    }

    .panel {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: #fff !important;
        margin-bottom: 5mm !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .panel-header,
    .panel-body {
        padding: 4mm 5mm !important;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .table th,
    .table td {
        border: 1px solid #ddd !important;
        padding: 2mm 3mm !important;
        vertical-align: top !important;
        color: #000 !important;
        background: transparent !important;
    }

    .status-badge {
        border: 1px solid #999 !important;
        background: transparent !important;
        color: #000 !important;
    }

    .ledger-print-meta {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4mm;
    }

    .compact-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 4mm !important;
    }
}
