:root {
    --sidebar-width: 274px;
    --brand: #0f766e;
    --brand-deep: #0b3d3a;
    --brand-soft: #d8f2ef;
    --gold: #c9a227;
    --bg-orb-1: rgba(201, 162, 39, 0.08);
    --bg-orb-2: rgba(15, 118, 110, 0.1);
    --sidebar-orb: rgba(201, 162, 39, 0.16);
    --sidebar-start: rgba(11, 61, 58, 0.98);
    --sidebar-end: rgba(15, 118, 110, 0.95);
    --hero-orb: rgba(201, 162, 39, 0.18);
    --hero-start: rgba(11, 61, 58, 0.98);
    --hero-end: rgba(15, 118, 110, 0.92);
    --ink: #0f172a;
    --muted: #475569;
    --bg: #edf4f3;
    --surface: #ffffff;
    --surface-2: rgba(247, 252, 251, 0.95);
    --surface-soft: #f8fcfb;
    --glass: rgba(255, 255, 255, 0.78);
    --line: rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 30px 55px rgba(15, 23, 42, 0.16);
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background:
        radial-gradient(circle at 10% 10%, var(--bg-orb-1), transparent 30%),
        radial-gradient(circle at 90% 20%, var(--bg-orb-2), transparent 40%),
        var(--bg);
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    display: block;
    height: auto;
    max-width: 100%;
}

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

h1,
h2,
h3,
.sidebar-brand-title,
.portal-hero-title,
.stat-value {
    font-family: "Sora", "Manrope", sans-serif;
    letter-spacing: -0.03em;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    background:
        radial-gradient(circle at top, var(--sidebar-orb), transparent 36%),
        linear-gradient(180deg, var(--sidebar-start), var(--sidebar-end));
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.12);
    color: #fff;
    min-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.4rem 1rem;
    position: sticky;
    top: 0;
    width: var(--sidebar-width);
    z-index: 1040;
}

.sidebar-backdrop {
    background: rgba(15, 23, 42, 0.38);
    border: 0;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.2s ease;
    z-index: 1035;
}

.sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.sidebar-brand-link {
    align-items: center;
    display: flex;
    gap: 0.9rem;
}

.sidebar-logo {
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
    height: 52px;
    object-fit: cover;
    width: 52px;
}

.sidebar-brand-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-brand-subtitle {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.84rem;
    margin-top: 0.18rem;
}

.sidebar-nav {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
}

.sidebar-group {
    display: grid;
    gap: 0.45rem;
}

.sidebar-group + .sidebar-group {
    margin-top: 1rem;
}

.sidebar-group-label {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding-inline: 0.35rem;
    text-transform: uppercase;
}

.sidebar-link {
    border: 1px solid transparent;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    display: grid;
    gap: 0.18rem;
    padding: 0.82rem 1rem 0.86rem;
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-link-label {
    font-size: 0.93rem;
    font-weight: 800;
}

.sidebar-link-note {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.76rem;
    line-height: 1.35;
}

.sidebar-link.active .sidebar-link-note,
.sidebar-link:hover .sidebar-link-note {
    color: rgba(255, 255, 255, 0.82);
}

.sidebar-support {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.1rem;
    margin-top: 1.25rem;
    padding: 1rem;
}

.sidebar-support-label {
    color: #fff;
    font-size: 0.86rem;
    font-weight: 800;
}

.sidebar-support-text {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 0.45rem 0 0.9rem;
}

.app-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
    min-height: 82px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar h1 {
    color: var(--ink);
}

.topbar-heading {
    flex: 1 1 280px;
    min-width: 0;
}

.topbar-title {
    line-height: 1.15;
}

.topbar-meta {
    line-height: 1.5;
}

.topbar-tools {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.topbar-mobile-panel {
    display: none;
}

.topbar-mobile-switcher {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
}

.topbar-mobile-switcher::-webkit-scrollbar {
    display: none;
}

.topbar-mobile-switcher .portal-switch-chip {
    flex: 0 0 auto;
}

.topbar-mobile-quick-nav {
    width: 100%;
}

.quick-nav-wrap {
    min-width: 210px;
}

.topbar-quick-select {
    background: rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    font-size: 0.88rem;
    min-height: 44px;
    min-width: 210px;
}

.workspace-brief {
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(216, 242, 239, 0.62));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.1rem;
}

.workspace-brief-main {
    min-width: 0;
}

.workspace-brief-kicker {
    color: var(--brand-deep);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.workspace-brief-text {
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 760px;
}

.workspace-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.workspace-chip {
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 999px;
    color: var(--brand-deep);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.38rem 0.72rem;
}

.workspace-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.card,
.login-panel,
.invoice-card,
.table-wrap {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.section-card,
.stat-card {
    backdrop-filter: blur(12px);
    border-radius: 1.25rem;
    overflow: hidden;
}

.stat-card {
    border: 0;
}

.stat-card .card-body {
    padding: 1.35rem;
}

.stat-card-highlight {
    background:
        radial-gradient(circle at top right, rgba(201, 162, 39, 0.16), transparent 30%),
        linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.96));
}

.stat-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.35rem;
}

.stat-note {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 0.5rem;
}

.form-label {
    color: var(--ink);
    font-weight: 700;
}

.form-control,
.form-select {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 0.95rem;
    font-size: 1rem;
    min-height: 48px;
    padding: 0.72rem 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.5);
    box-shadow: 0 0 0 0.25rem rgba(15, 118, 110, 0.14);
}

.form-control[readonly] {
    background: rgba(15, 118, 110, 0.05);
    color: var(--brand-deep);
    font-weight: 700;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    background: rgba(15, 118, 110, 0.08);
    border-bottom-width: 1px;
    color: var(--brand-deep);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.table-responsive {
    border-radius: 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table {
    min-width: 680px;
}

.compact-report-table .table {
    min-width: 0;
    width: 100%;
}

.compact-report-table td,
.compact-report-table th {
    white-space: normal;
}

.table tbody tr:hover {
    --bs-table-accent-bg: rgba(15, 118, 110, 0.04);
}

.student-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.student-meta-stack {
    display: grid;
    gap: 0.14rem;
}

.data-stack {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
}

.data-title {
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
}

.data-line {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.data-line strong {
    color: var(--ink);
    font-weight: 700;
}

.report-action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.score-chip {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.38rem 0.62rem;
}

.score-chip-good {
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand-deep);
}

.score-chip-warn {
    background: rgba(201, 162, 39, 0.18);
    color: #7c5b00;
}

.score-chip-alert {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.student-directory-table .table {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

.student-directory-table td,
.student-directory-table th {
    white-space: normal;
}

.student-actions-column {
    min-width: 210px;
    width: 210px;
}

.users-account-form {
    align-content: start;
}

.allocation-panel {
    margin-top: 0.15rem;
}

.allocation-list {
    display: grid;
    gap: 0.95rem;
}

.allocation-row {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 251, 0.92));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.15rem;
    box-shadow: var(--shadow-soft);
    padding: 1rem;
}

.allocation-grid {
    align-items: end;
    display: grid;
    gap: 0.85rem 1rem;
    grid-template-columns: minmax(0, 1.45fr) minmax(100px, 0.7fr) minmax(0, 1.3fr) minmax(170px, 0.95fr);
}

.allocation-field {
    min-width: 0;
}

.allocation-field-toggle {
    align-self: stretch;
}

.allocation-check {
    align-items: center;
    background: rgba(15, 118, 110, 0.05);
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 1rem;
    display: flex;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.72rem 0.85rem;
}

.allocation-check .form-check-input {
    float: none;
    margin: 0;
}

.allocation-check .form-check-label {
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
}

.allocation-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.allocation-actions .btn {
    white-space: nowrap;
}

.btn {
    border-radius: 999px;
    font-weight: 700;
    padding-inline: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-color: transparent;
    filter: brightness(0.97);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: rgba(15, 118, 110, 0.24);
    color: var(--brand-deep);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(15, 118, 110, 0.1);
    border-color: rgba(15, 118, 110, 0.3);
    color: var(--brand-deep);
}

.btn-outline-secondary {
    border-color: rgba(15, 23, 42, 0.14);
    color: var(--ink);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.18);
    color: var(--ink);
}

.btn-outline-danger {
    border-color: rgba(185, 28, 28, 0.2);
    color: #991b1b;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: rgba(185, 28, 28, 0.08);
    border-color: rgba(185, 28, 28, 0.24);
    color: #7f1d1d;
}

.page-link {
    border-radius: 999px !important;
    color: var(--brand-deep);
    margin-right: 0.35rem;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-color: transparent;
}

.login-page {
    align-items: center;
    background:
        radial-gradient(circle at 10% 10%, var(--bg-orb-1), transparent 28%),
        radial-gradient(circle at 88% 16%, var(--bg-orb-2), transparent 32%),
        var(--bg);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-shell {
    align-items: stretch;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 460px);
    width: min(1100px, 100%);
}

.login-side {
    background:
        radial-gradient(circle at top right, var(--hero-orb), transparent 30%),
        linear-gradient(145deg, var(--hero-start), var(--hero-end));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-strong);
    color: #fff;
    padding: 2rem;
}

.login-side-brand {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.login-side-logo {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 1.2rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    height: 80px;
    object-fit: contain;
    padding: 0.5rem;
    width: 80px;
}

.login-side-grid {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.login-feature-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.2rem;
    padding: 1rem 1.05rem;
}

.login-feature-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 0.65rem;
}

.login-feature-list {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
    padding-left: 1.1rem;
}

.login-panel {
    backdrop-filter: blur(16px);
    border-radius: 1.4rem;
    max-width: 460px;
    padding: 2rem;
    width: 100%;
}

.login-card-panel {
    align-self: center;
    max-width: none;
}

.login-brand {
    background:
        radial-gradient(circle at top right, var(--hero-orb), transparent 35%),
        linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-radius: 1.2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    padding: 1.3rem;
}

.summary-strip {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(201, 162, 39, 0.08));
    border: 1px solid rgba(15, 118, 110, 0.08);
    border-radius: 1.2rem;
    padding: 1rem;
}

.task-step-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.task-step-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 251, 0.94));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.2rem;
    box-shadow: var(--shadow-soft);
    padding: 1rem 1.05rem;
}

.task-step-number {
    align-items: center;
    background: rgba(15, 118, 110, 0.12);
    border-radius: 999px;
    color: var(--brand-deep);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.7rem;
}

.task-step-title {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
    margin: 0.8rem 0 0.35rem;
}

.task-step-text {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0;
}

.plain-note-box {
    background: rgba(255, 255, 255, 0.92);
    border: 1px dashed rgba(15, 118, 110, 0.24);
    border-radius: 1rem;
    color: var(--ink);
    padding: 0.95rem 1rem;
}

.plain-note-box strong {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.25rem;
}

.form-hint-box {
    background: rgba(15, 118, 110, 0.06);
    border: 1px dashed rgba(15, 118, 110, 0.18);
    border-radius: 1rem;
    color: var(--ink);
    padding: 0.95rem 1rem;
}

.form-hint-box strong {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.25rem;
}

.amount-helper-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.amount-helper-btn {
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 999px;
    color: var(--brand-deep);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.45rem 0.78rem;
}

.amount-helper-btn:hover {
    background: rgba(15, 118, 110, 0.12);
}

.finder-list {
    display: grid;
    gap: 0.85rem;
}

.finder-item {
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.95rem 1rem;
}

.finder-item > :first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.finder-item.active {
    background: linear-gradient(135deg, rgba(216, 242, 239, 0.72), rgba(255, 255, 255, 0.95));
    border-color: rgba(15, 118, 110, 0.4);
}

.finder-meta {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
    margin-top: 0.2rem;
}

.finder-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: flex-end;
}

.finder-balance {
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}

.value-tile-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.value-tile {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    min-height: 112px;
    padding: 0.95rem 1rem;
}

.value-tile-label {
    color: var(--muted);
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.value-tile-value {
    color: var(--ink);
    display: block;
    font-family: "Sora", "Manrope", sans-serif;
    font-size: 1.08rem;
    font-weight: 800;
}

.value-tile-note {
    color: var(--muted);
    display: block;
    font-size: 0.82rem;
    line-height: 1.4;
    margin-top: 0.3rem;
}

.filter-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.6rem 0.9rem;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.filter-chip:hover,
.filter-chip.active {
    background: rgba(15, 118, 110, 0.1);
    border-color: rgba(15, 118, 110, 0.24);
    color: var(--brand-deep);
    transform: translateY(-1px);
}

.glance-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.glance-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 251, 0.92));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.2rem;
    box-shadow: var(--shadow-soft);
    padding: 1rem 1.05rem;
}

.glance-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.glance-value {
    color: var(--ink);
    font-family: "Sora", "Manrope", sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    margin-top: 0.28rem;
}

.glance-note {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.invoice-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 1.25rem;
    margin: 1.5rem auto;
    max-width: 860px;
    padding: 2rem;
}

.invoice-header {
    border-bottom: 2px dashed rgba(15, 23, 42, 0.12);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.invoice-brand {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.invoice-logo {
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    height: 68px;
    object-fit: cover;
    width: 68px;
}

.badge-soft {
    background: rgba(15, 118, 110, 0.12);
    border-radius: 999px;
    color: var(--brand-deep);
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.35rem 0.75rem;
}

.portal-hero {
    background:
        radial-gradient(circle at top right, var(--hero-orb), transparent 30%),
        linear-gradient(135deg, var(--hero-start), var(--hero-end));
    border-radius: 1.5rem;
    box-shadow: var(--shadow-strong);
    color: #fff;
    overflow: hidden;
    padding: 2rem;
    position: relative;
}

.portal-hero::after {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 60%);
    content: "";
    height: 240px;
    position: absolute;
    right: -60px;
    top: -100px;
    width: 240px;
}

.portal-hero > * {
    position: relative;
    z-index: 1;
}

.portal-kicker {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.portal-hero-title {
    color: #fff;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.08;
    margin-bottom: 0.8rem;
    max-width: 700px;
}

.portal-hero-text {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    max-width: 720px;
}

.portal-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.quick-link-chip {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.94rem;
    font-weight: 700;
    padding: 0.72rem 1rem;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.quick-link-chip:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.module-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.module-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--surface-2));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.35rem;
    box-shadow: var(--shadow-soft);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-height: 220px;
    padding: 1.15rem;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.module-card:hover {
    border-color: rgba(15, 118, 110, 0.2);
    box-shadow: var(--shadow-strong);
    color: var(--ink);
    transform: translateY(-2px);
}

.module-card-primary {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.98));
}

.module-card-dark {
    background: linear-gradient(135deg, rgba(11, 61, 58, 0.98), rgba(15, 118, 110, 0.9));
    color: #fff;
}

.module-card-dark .module-card-text,
.module-card-dark .module-card-meta {
    color: rgba(255, 255, 255, 0.82);
}

.module-card-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.module-card-tag {
    color: var(--brand-deep);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.module-card-dark .module-card-tag {
    color: rgba(255, 255, 255, 0.76);
}

.module-card-title {
    font-size: 1.18rem;
    margin: 0;
}

.module-card-text {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
}

.module-card-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    font-size: 0.84rem;
    font-weight: 700;
    margin-top: auto;
}

.mobile-dock {
    display: none;
}

.mobile-dock-link {
    align-items: center;
    border-radius: 1rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    font-size: 0.72rem;
    font-weight: 800;
    gap: 0.2rem;
    justify-content: center;
    min-height: 52px;
    padding: 0.35rem 0.2rem;
    text-align: center;
}

.mobile-dock-link strong {
    font-size: 1rem;
    line-height: 1;
}

.mobile-dock-link.active {
    background: rgba(15, 118, 110, 0.1);
    color: var(--brand-deep);
}

.mini-stat-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-top: 1.6rem;
}

.mini-stat {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    padding: 0.95rem 1rem;
}

.mini-stat-label {
    color: rgba(255, 255, 255, 0.72);
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mini-stat-value {
    color: #fff;
    display: block;
    font-family: "Sora", "Manrope", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0.35rem;
}

.section-heading {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-subtext {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.ranking-badge {
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.1);
    border-radius: 999px;
    color: var(--brand-deep);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
}

.table-note {
    color: var(--muted);
    font-size: 0.86rem;
}

.term-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.term-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.38rem 0.62rem;
}

.term-pill-paid {
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand-deep);
}

.term-pill-defaulter {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.term-pill-due-soon {
    background: rgba(201, 162, 39, 0.18);
    color: #7c5b00;
}

.term-pill-upcoming {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.term-pill-pending {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.table-row-alert {
    --bs-table-accent-bg: rgba(220, 38, 38, 0.06);
}

.table-row-warning {
    --bs-table-accent-bg: rgba(201, 162, 39, 0.08);
}

.analytics-hero-grid {
    align-items: end;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
}

.analytics-hero-panel {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 1.25rem;
}

.analytics-chip {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.86);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.34rem 0.7rem;
    text-transform: uppercase;
}

.analytics-hero-score {
    color: #fff;
    font-family: "Sora", "Manrope", sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1;
    margin-top: 0.9rem;
}

.analytics-hero-meta {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.92rem;
    margin-top: 0.45rem;
}

.analytics-key-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.analytics-key {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 0.85rem 0.9rem;
}

.analytics-key-label {
    color: rgba(255, 255, 255, 0.68);
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.analytics-key-value {
    color: #fff;
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.3rem;
}

.analytics-band {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 1.5rem;
}

.analytics-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 251, 0.94));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.35rem;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
}

.analytics-card::after {
    background: radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 46%);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.analytics-card-gold::after {
    background: radial-gradient(circle at top right, rgba(201, 162, 39, 0.14), transparent 46%);
}

.analytics-card-alert::after {
    background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.12), transparent 44%);
}

.analytics-card-body {
    padding: 1.3rem;
    position: relative;
    z-index: 1;
}

.analytics-card-kicker {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.analytics-card-title {
    color: var(--ink);
    font-family: "Sora", "Manrope", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0.5rem 0 0.35rem;
}

.analytics-card-value {
    color: var(--brand-deep);
    font-family: "Sora", "Manrope", sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.05;
}

.analytics-card-text {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0.55rem 0 0;
}

.analytics-subgrid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-top: 1rem;
}

.analytics-subcard {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 0.8rem 0.9rem;
}

.analytics-subcard-label {
    color: var(--muted);
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.analytics-subcard-value {
    color: var(--ink);
    display: block;
    font-size: 1rem;
    font-weight: 800;
    margin-top: 0.28rem;
}

.analytics-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.analytics-list-row {
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 0.85rem 0.95rem;
}

.analytics-list-header {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.analytics-list-title {
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 700;
}

.analytics-list-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

.day-close-sheet {
    background:
        radial-gradient(circle at top right, rgba(201, 162, 39, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 251, 0.94));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-soft);
    padding: 1.4rem;
}

.day-close-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.day-close-kicker {
    color: var(--brand-deep);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.day-close-title {
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    margin: 0.35rem 0 0.4rem;
}

.day-close-meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.day-close-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.day-close-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 132px;
    padding: 1rem;
}

.day-close-card-soft {
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(201, 162, 39, 0.08));
}

.day-close-label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.day-close-value {
    color: var(--ink);
    font-family: "Sora", "Manrope", sans-serif;
    font-size: 1.3rem;
    line-height: 1.15;
}

.day-close-note {
    color: var(--muted);
    font-size: 0.86rem;
}

.progress-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.82rem;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.progress-track {
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.progress-track.progress-track-light {
    background: rgba(255, 255, 255, 0.18);
}

.progress-track.progress-track-compact {
    height: 8px;
}

.progress-fill {
    background: linear-gradient(135deg, var(--brand), var(--gold));
    border-radius: inherit;
    display: block;
    height: 100%;
}

.progress-fill-cool {
    background: linear-gradient(135deg, #34a0a4, #0f766e);
}

.progress-fill-warn {
    background: linear-gradient(135deg, #ef4444, #f59e0b);
}

.progress-fill-gold {
    background: linear-gradient(135deg, #e7c55e, #c9a227);
}

.analytics-signal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.data-pill {
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.1);
    border-radius: 999px;
    color: var(--brand-deep);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.4rem 0.72rem;
}

.data-pill-alert {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.data-pill-gold {
    background: rgba(201, 162, 39, 0.16);
    border-color: rgba(201, 162, 39, 0.18);
    color: #7c5b00;
}

.analytics-statline {
    align-items: baseline;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.analytics-statline strong {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
}

.analytics-statline span {
    color: var(--muted);
    font-size: 0.84rem;
}

.rank-stack {
    display: grid;
    gap: 0.85rem;
}

.rank-card {
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(216, 242, 239, 0.74));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.15rem;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: auto 1fr auto;
    padding: 0.95rem 1rem;
}

.rank-card-number {
    align-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-radius: 1rem;
    color: #fff;
    display: inline-flex;
    font-family: "Sora", "Manrope", sans-serif;
    font-size: 0.96rem;
    font-weight: 800;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.rank-card-title {
    color: var(--ink);
    font-size: 0.96rem;
    font-weight: 800;
    margin: 0;
}

.rank-card-subtitle {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.18rem;
}

.rank-card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.metric-chip {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.4rem 0.68rem;
}

.metric-chip-danger {
    background: rgba(254, 242, 242, 0.96);
    border-color: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.metric-chip-success {
    background: rgba(220, 252, 231, 0.8);
    border-color: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.metric-chip-warning {
    background: rgba(254, 249, 195, 0.85);
    border-color: rgba(202, 138, 4, 0.16);
    color: #854d0e;
}

.analytics-table-metric {
    min-width: 155px;
}

.analytics-table-metric strong {
    color: var(--ink);
    display: block;
    font-size: 0.84rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.analytics-note-box {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(201, 162, 39, 0.12));
    border: 1px solid rgba(15, 118, 110, 0.08);
    border-radius: 1rem;
    color: var(--ink);
    padding: 0.95rem 1rem;
}

.analytics-note-box strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 0.22rem;
}

.chart-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.empty-soft {
    background: rgba(15, 118, 110, 0.05);
    border: 1px dashed rgba(15, 118, 110, 0.18);
    border-radius: 1rem;
    color: var(--muted);
    padding: 1rem;
    text-align: center;
}

.quick-action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.portal-switcher {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.portal-switch-chip {
    align-items: center;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    min-height: 42px;
    padding: 0.45rem 0.78rem;
}

.portal-switch-chip:hover,
.portal-switch-chip.active {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 23, 42, 0.12);
    color: var(--brand-deep);
}

.sidebar-portal-note {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.1rem;
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
}

.sidebar-portal-chip {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 0.7rem;
    padding: 0.35rem 0.68rem;
    text-transform: uppercase;
}

.portal-selector-page {
    background:
        radial-gradient(circle at 0% 0%, rgba(201, 162, 39, 0.12), transparent 24%),
        radial-gradient(circle at 100% 0%, rgba(15, 118, 110, 0.16), transparent 30%),
        radial-gradient(circle at 50% 100%, rgba(15, 118, 110, 0.08), transparent 34%),
        var(--bg);
    color: var(--ink);
    min-height: 100vh;
}

.portal-selector-shell {
    margin: 0 auto;
    max-width: 1280px;
    padding: 2rem 1.25rem 2.5rem;
}

.portal-selector-hero {
    background:
        radial-gradient(circle at top right, var(--hero-orb), transparent 30%),
        linear-gradient(145deg, var(--hero-start), var(--hero-end));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.7rem;
    box-shadow: var(--shadow-strong);
    color: #fff;
    margin-bottom: 1.25rem;
    overflow: hidden;
    padding: 1.35rem 1.35rem 1.55rem;
    position: relative;
}

.portal-selector-hero::after {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 60%);
    content: "";
    height: 240px;
    position: absolute;
    right: -70px;
    top: -110px;
    width: 240px;
}

.portal-selector-hero > * {
    position: relative;
    z-index: 1;
}

.portal-entry-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.portal-entry-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.5rem;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    min-height: 340px;
    padding: 1.25rem;
    position: relative;
}

.portal-entry-card::before {
    background: linear-gradient(135deg, var(--preview-brand), var(--preview-deep));
    border-radius: 999px;
    content: "";
    height: 6px;
    left: 1.25rem;
    position: absolute;
    right: 1.25rem;
    top: 1rem;
}

.portal-entry-top {
    align-items: center;
    display: flex;
    gap: 0.6rem;
    justify-content: space-between;
    margin-top: 0.8rem;
}

.portal-entry-badge {
    background: var(--preview-soft);
    border-radius: 999px;
    color: var(--preview-deep);
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.36rem 0.72rem;
    text-transform: uppercase;
}

.portal-entry-title {
    color: var(--ink);
    font-size: 1.32rem;
    margin: 0;
}

.portal-entry-text {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.58;
    margin: 0;
}

.portal-entry-list {
    color: var(--ink);
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.1rem;
}

.portal-entry-list li {
    line-height: 1.5;
}

.portal-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: auto;
}

.portal-entry-url {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    word-break: break-all;
}

.theme-preview-erp {
    --preview-brand: #0f766e;
    --preview-deep: #0b3d3a;
    --preview-soft: rgba(216, 242, 239, 0.8);
}

.theme-preview-students {
    --preview-brand: #ea580c;
    --preview-deep: #7c2d12;
    --preview-soft: rgba(255, 237, 213, 0.92);
}

.theme-preview-fees {
    --preview-brand: #2563eb;
    --preview-deep: #172554;
    --preview-soft: rgba(219, 234, 254, 0.9);
}

.theme-preview-inventory {
    --preview-brand: #4d7c0f;
    --preview-deep: #365314;
    --preview-soft: rgba(236, 252, 203, 0.95);
}

body.theme-fees {
    --brand: #2563eb;
    --brand-deep: #172554;
    --brand-soft: #dbeafe;
    --gold: #14b8a6;
    --bg: #eef4ff;
    --surface-2: rgba(245, 248, 255, 0.96);
    --bg-orb-1: rgba(20, 184, 166, 0.08);
    --bg-orb-2: rgba(37, 99, 235, 0.14);
    --sidebar-orb: rgba(20, 184, 166, 0.18);
    --sidebar-start: rgba(23, 37, 84, 0.98);
    --sidebar-end: rgba(30, 64, 175, 0.95);
    --hero-orb: rgba(45, 212, 191, 0.18);
    --hero-start: rgba(23, 37, 84, 0.98);
    --hero-end: rgba(37, 99, 235, 0.92);
}

body.theme-students {
    --brand: #ea580c;
    --brand-deep: #7c2d12;
    --brand-soft: #ffedd5;
    --gold: #0891b2;
    --bg: #fff4eb;
    --surface-2: rgba(255, 247, 237, 0.96);
    --bg-orb-1: rgba(251, 146, 60, 0.12);
    --bg-orb-2: rgba(14, 165, 233, 0.12);
    --sidebar-orb: rgba(14, 165, 233, 0.18);
    --sidebar-start: rgba(124, 45, 18, 0.98);
    --sidebar-end: rgba(234, 88, 12, 0.94);
    --hero-orb: rgba(14, 165, 233, 0.16);
    --hero-start: rgba(124, 45, 18, 0.98);
    --hero-end: rgba(234, 88, 12, 0.92);
}

body.theme-inventory {
    --brand: #4d7c0f;
    --brand-deep: #365314;
    --brand-soft: #ecfccb;
    --gold: #f59e0b;
    --bg: #f7fee7;
    --surface-2: rgba(248, 255, 234, 0.96);
    --bg-orb-1: rgba(245, 158, 11, 0.1);
    --bg-orb-2: rgba(132, 204, 22, 0.14);
    --sidebar-orb: rgba(245, 158, 11, 0.16);
    --sidebar-start: rgba(26, 46, 5, 0.98);
    --sidebar-end: rgba(77, 124, 15, 0.94);
    --hero-orb: rgba(245, 158, 11, 0.18);
    --hero-start: rgba(26, 46, 5, 0.98);
    --hero-end: rgba(77, 124, 15, 0.92);
}

body.theme-fees .workspace-brief,
body.theme-fees .summary-strip {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(219, 234, 254, 0.78));
}

body.theme-students .workspace-brief,
body.theme-students .summary-strip {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 237, 213, 0.8));
}

body.theme-inventory .workspace-brief,
body.theme-inventory .summary-strip {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(236, 252, 203, 0.82));
}

body.theme-fees .module-card-primary,
body.theme-fees .rank-card,
body.theme-fees .finder-item.active {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.86), rgba(255, 255, 255, 0.97));
}

body.theme-students .module-card-primary,
body.theme-students .rank-card,
body.theme-students .finder-item.active {
    background: linear-gradient(135deg, rgba(255, 237, 213, 0.92), rgba(255, 255, 255, 0.98));
}

body.theme-inventory .module-card-primary,
body.theme-inventory .rank-card,
body.theme-inventory .finder-item.active {
    background: linear-gradient(135deg, rgba(236, 252, 203, 0.9), rgba(255, 255, 255, 0.98));
}

body.theme-fees .table thead th {
    background: rgba(37, 99, 235, 0.08);
    color: #172554;
}

body.theme-students .table thead th {
    background: rgba(234, 88, 12, 0.08);
    color: #7c2d12;
}

body.theme-inventory .table thead th {
    background: rgba(77, 124, 15, 0.08);
    color: #365314;
}

body.theme-fees .table tbody tr:hover {
    --bs-table-accent-bg: rgba(37, 99, 235, 0.04);
}

body.theme-students .table tbody tr:hover {
    --bs-table-accent-bg: rgba(234, 88, 12, 0.04);
}

body.theme-inventory .table tbody tr:hover {
    --bs-table-accent-bg: rgba(77, 124, 15, 0.04);
}

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

@media (max-width: 991.98px) {
    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        inset: 0 auto 0 0;
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: min(86vw, 320px);
    }

    .app-main {
        width: 100%;
    }

    .topbar {
        min-height: auto;
    }

    .topbar .container-fluid {
        align-items: flex-start;
        gap: 0.85rem;
    }

    .topbar-menu-toggle,
    .topbar-tools .btn {
        min-height: 44px;
    }

    .topbar-mobile-panel {
        display: grid;
        gap: 0.75rem;
        width: 100%;
    }

    .portal-hero {
        padding: 1.5rem;
    }

    .analytics-hero-grid {
        grid-template-columns: 1fr;
    }

    .workspace-brief {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-action-row {
        justify-content: flex-start;
        width: 100%;
    }

    .workspace-action-row .btn {
        width: 100%;
    }

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

    .portal-selector-shell {
        padding-inline: 1rem;
    }

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

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

    .invoice-brand {
        align-items: flex-start;
    }

    .mobile-dock {
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
        bottom: 0;
        display: grid;
        gap: 0.25rem;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        left: 0;
        padding: 0.7rem 0.85rem calc(0.7rem + env(safe-area-inset-bottom));
        position: fixed;
        right: 0;
        z-index: 1080;
    }

    body {
        padding-bottom: 5.65rem;
    }

    .table-responsive .table {
        min-width: 620px;
    }
}

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

    .allocation-actions {
        justify-content: stretch;
    }

    .allocation-actions .btn {
        width: 100%;
    }

    .analytics-key-grid,
    .analytics-subgrid,
    .mini-stat-grid {
        grid-template-columns: 1fr;
    }

    .topbar .container-fluid {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.85rem;
    }

    .topbar-tools {
        justify-content: flex-start;
        width: 100%;
    }

    .topbar-tools .btn,
    .topbar-tools .quick-nav-wrap,
    .topbar-tools .portal-switcher {
        width: 100%;
    }

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

    .topbar-mobile-switcher {
        display: flex;
        grid-template-columns: none;
    }

    .portal-switch-chip {
        justify-content: center;
        text-align: center;
    }

    .topbar-quick-select {
        min-width: 0;
        width: 100%;
    }

    .workspace-brief {
        padding: 0.95rem;
    }

    .workspace-brief-text {
        font-size: 0.9rem;
    }

    .student-table-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .report-action-stack {
        justify-content: flex-start;
    }

    .report-action-stack .btn,
    .report-action-stack form {
        width: 100%;
    }

    .report-action-stack form .btn {
        width: 100%;
    }

    .student-table-actions .btn,
    .student-table-actions form {
        width: 100%;
    }

    .student-table-actions form .btn {
        width: 100%;
    }

    .portal-chip-row {
        flex-direction: column;
        width: 100%;
    }

    .portal-chip-row .quick-link-chip {
        justify-content: center;
        width: 100%;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .badge-soft,
    .workspace-chip,
    .filter-chip,
    .metric-chip,
    .quick-link-chip {
        font-size: 0.76rem;
    }

    .portal-hero {
        padding: 1.25rem;
    }

    .portal-hero-title {
        font-size: clamp(1.45rem, 7vw, 1.9rem);
    }

    .analytics-hero-score {
        font-size: clamp(2rem, 10vw, 2.6rem);
    }

    .module-card,
    .portal-entry-card,
    .glance-card,
    .login-side,
    .login-panel {
        padding: 1rem;
    }

    .section-card .card-body,
    .analytics-card-body {
        padding: 1rem;
    }

    .module-card {
        min-height: 0;
    }

    .portal-entry-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-entry-url {
        font-size: 0.72rem;
    }

    .rank-card {
        grid-template-columns: 1fr;
    }

    .rank-card-metrics {
        justify-content: flex-start;
    }

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

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

    .portal-entry-actions {
        flex-direction: column;
    }

    .portal-entry-actions .btn {
        width: 100%;
    }

    .day-close-header {
        flex-direction: column;
    }

    .finder-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .finder-actions {
        justify-content: flex-start;
    }

    .table-responsive .table {
        font-size: 0.9rem;
        min-width: 520px;
    }

    .student-directory-table .table {
        min-width: 520px;
        table-layout: auto;
    }

    .table td,
    .table th {
        padding: 0.7rem 0.65rem;
    }
}

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .workspace-brief {
        display: none !important;
    }

    .app-main,
    .container-fluid {
        margin: 0;
        max-width: 100%;
        padding: 0 !important;
        width: 100%;
    }

    .day-close-sheet,
    .section-card,
    .glance-card {
        border: 0 !important;
        box-shadow: none !important;
    }

    .day-close-sheet {
        background: #fff;
        border-radius: 0;
        padding: 0 0 1rem;
    }

    .day-close-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    table {
        font-size: 0.88rem;
    }

    .invoice-card {
        border: 0;
        box-shadow: none;
        margin: 0;
        max-width: 100%;
        padding: 0;
    }
}
