.admin-body {
    background: var(--bg);
}

.status-informed {
    color: #2454d6;
    background: rgba(36, 84, 214, 0.12);
}

.status-enrolled {
    color: #15803d;
    background: rgba(21, 128, 61, 0.12);
}

.payment-steps {
    display: grid;
    gap: 0.75rem;
}

.payment-student-card,
.payment-step,
.payment-total {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    background: var(--surface-soft);
}

.payment-student-card {
    display: grid;
    gap: 0.2rem;
}

.payment-student-card span {
    color: var(--muted);
    font-size: 0.82rem;
}

.payment-step,
.payment-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.payment-step span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.payment-step.is-paid {
    color: var(--success);
}

.payment-step.is-due,
.penalty-step {
    color: var(--coral);
}

/* Next-payment inline badges ------------------------------------------------ */
.next-payment-tag,
.due-date-tag,
.blocked-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}

.next-payment-tag {
    color: #fff;
    background: var(--coral);
}

.due-date-tag {
    color: var(--primary);
    background: rgba(7, 20, 90, 0.08);
    border: 1px solid rgba(7, 20, 90, 0.18);
}

[data-theme="dark"] .due-date-tag {
    color: #8fa8ff;
    background: rgba(143, 168, 255, 0.1);
    border-color: rgba(143, 168, 255, 0.22);
}

.blocked-tag {
    color: var(--muted);
    background: rgba(96, 112, 132, 0.1);
    border: 1px solid rgba(96, 112, 132, 0.2);
}

.penalty-included-tag {
    color: #92400e;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .penalty-included-tag {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
}

.payment-step.is-pending {
    color: var(--muted);
    opacity: 0.7;
}

/* Penalty breakdown info row — softer than the full is-due style */
.penalty-breakdown {
    color: var(--muted);
    font-size: 0.88rem;
    border-style: dashed;
    opacity: 0.85;
}

.breakdown-note {
    font-size: 0.74rem;
    font-weight: 600;
    opacity: 0.75;
}
/* --------------------------------------------------------------------------- */

.payment-total {
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

[data-theme="light"] .admin-body {
    background: var(--bg);
}

[data-theme="dark"] .admin-body {
    background: var(--bg);
}

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

.admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    gap: 1.4rem;
    padding: 1.2rem;
    border-right: 1px solid var(--border);
    background: var(--surface);
}

[data-theme="light"] .admin-sidebar {
    background: var(--surface);
    box-shadow: none;
}

[data-theme="dark"] .admin-sidebar {
    background: var(--surface);
}

.admin-brand {
    padding: 0.4rem;
}

.admin-brand .brand-logo-wrap {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-nav a,
.sidebar-dropdown-toggle {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.95rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    color: var(--muted);
    font-weight: 800;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.admin-nav a:hover,
.sidebar-dropdown-toggle:hover {
    color: var(--primary);
    background: var(--surface-soft);
    transform: translateX(4px);
    text-decoration: none;
}

.admin-nav a.active,
.sidebar-dropdown-toggle.active {
    color: var(--primary);
    background: var(--surface-soft);
    box-shadow: inset 3px 0 0 var(--teal);
}

[data-theme="light"] .admin-nav a.active,
[data-theme="light"] .sidebar-dropdown-toggle.active {
    color: #07145a;
    background: var(--surface-soft);
    box-shadow: inset 3px 0 0 #008ea1;
}

.admin-nav i,
.sidebar-dropdown-toggle i {
    width: 22px;
}

/* Sidebar Dropdown Menu Styling */
.sidebar-dropdown {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.sidebar-dropdown-toggle .dropdown-arrow {
    margin-left: auto;
    width: auto !important;
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.sidebar-dropdown-toggle:not(.collapsed) .dropdown-arrow {
    transform: rotate(180deg);
}

.sidebar-dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.25rem 0 0.25rem 1.15rem;
    margin-left: 0.95rem;
    border-left: 1px dashed var(--border);
}

.sidebar-dropdown-menu a {
    padding: 0.65rem 0.8rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.sidebar-dropdown-menu a.active {
    box-shadow: inset 2px 0 0 var(--teal);
}

[data-theme="light"] .sidebar-dropdown-menu a.active {
    box-shadow: inset 2px 0 0 #008ea1;
}

.sidebar-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    margin-left: auto;
    padding: 0 0.45rem;
    border: 2px solid var(--surface);
    border-radius: 999px;
    color: #fff;
    background: #dc2626;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.28);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.sidebar-security {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    background: var(--surface-soft);
    font-weight: 800;
}

[data-theme="light"] .sidebar-security {
    background: #f8fbfe;
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

[data-theme="light"] .admin-topbar {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .admin-topbar {
    background: rgba(12, 17, 24, 0.86);
}

.sidebar-toggle {
    display: none;
}

.topbar-search {
    position: relative;
    flex: 1;
    max-width: 520px;
}

.topbar-search i,
.filter-search i {
    position: absolute;
    top: 50%;
    left: 1rem;
    color: var(--muted);
    transform: translateY(-50%);
}

.topbar-search input,
.filter-search input {
    width: 100%;
    min-height: 46px;
    padding: 0.75rem 1rem 0.75rem 2.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--field);
}

[data-theme="light"] .topbar-search input,
[data-theme="light"] .filter-search input,
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.topbar-search input:focus,
.filter-search input:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(143, 168, 255, 0.14);
}

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

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 42px;
    padding: 0.35rem 0.7rem 0.35rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--field);
    font-weight: 800;
}

.admin-user span,
.profile-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: var(--radius);
    color: #fff;
    background: var(--primary);
}

.admin-content {
    padding: 1.5rem;
}

.admin-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-page-heading h1 {
    margin: 0.2rem 0 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
}

.dashboard-cards,
.dashboard-grid,
.profile-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.dashboard-card,
.records-summary article,
.admin-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(18, 32, 47, 0.08);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-card:hover,
.records-summary article:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(18, 32, 47, 0.12);
}

[data-theme="dark"] .dashboard-card:hover,
[data-theme="dark"] .records-summary article:hover {
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

[data-theme="light"] .dashboard-card,
[data-theme="light"] .records-summary article,
[data-theme="light"] .admin-panel {
    background: #ffffff;
    border-color: #dce5ef;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .records-summary article,
[data-theme="dark"] .admin-panel {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.dashboard-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
}

.dashboard-card > span {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: var(--radius);
    color: #fff;
    background: var(--primary);
}

.dashboard-card strong {
    display: block;
    font-size: 1.85rem;
    line-height: 1;
    font-weight: 800;
}

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

.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.admin-panel {
    padding: 1.2rem;
}

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

.panel-heading h2,
.detail-panel h2,
.profile-summary h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.panel-heading a {
    color: var(--primary);
    font-weight: 800;
}

.admin-table {
    --bs-table-color: var(--text);
    --bs-table-bg: var(--table-row);
    --bs-table-border-color: var(--border);
    --bs-table-hover-color: var(--text);
    --bs-table-hover-bg: var(--table-row-hover);
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    vertical-align: middle;
}

.admin-table > :not(caption) > * > * {
    padding: 0.95rem 0.75rem;
    box-shadow: none;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0;
    background: var(--field-muted);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .admin-table th {
    color: #6b7d94;
    background: #f7fafd;
}

.admin-table td {
    color: var(--text);
    background: var(--table-row);
    border-color: var(--border);
}

[data-theme="light"] .admin-table td {
    color: #172334;
    background: #ffffff;
}

[data-theme="light"] .admin-table tbody tr:hover td {
    background: #f6faff;
}

.admin-table tbody tr + tr td {
    border-top: 1px solid var(--border);
}

.admin-table tbody tr {
    background: var(--table-row);
    transition: background 0.18s ease;
}

.admin-table tbody tr:hover td {
    background: var(--table-row-hover);
}

.admin-table a {
    color: var(--text);
    font-weight: 800;
}

.admin-table a:hover {
    color: var(--primary);
}

.admin-table td small {
    display: block;
    color: var(--muted);
}

.table-responsive {
    border-radius: var(--radius);
    background: var(--surface);
}

[data-theme="light"] .table-responsive {
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .table-responsive {
    background: var(--table-row);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    background: var(--surface-soft);
}

.status-new {
    color: var(--warning);
    background: rgba(180, 83, 9, 0.06);
    border: 1px solid rgba(180, 83, 9, 0.22);
}

.status-reviewed {
    color: var(--primary);
    background: rgba(7, 31, 59, 0.05);
    border: 1px solid rgba(7, 31, 59, 0.2);
}

[data-theme="dark"] .status-reviewed {
    background: rgba(96, 165, 250, 0.06);
    border: 1px solid rgba(96, 165, 250, 0.22);
}

.status-accepted {
    color: var(--success);
    background: rgba(21, 128, 61, 0.06);
    border: 1px solid rgba(21, 128, 61, 0.22);
}

.status-enrolled {
    color: var(--success);
    background: rgba(21, 128, 61, 0.08);
    border: 1px solid rgba(21, 128, 61, 0.24);
}

.status-paid,
.status-advance_paid {
    color: var(--success);
    background: rgba(21, 128, 61, 0.08);
    border: 1px solid rgba(21, 128, 61, 0.24);
}

.status-partial {
    color: var(--primary);
    background: rgba(36, 84, 214, 0.08);
    border: 1px solid rgba(36, 84, 214, 0.22);
}

.status-overdue {
    color: var(--danger);
    background: rgba(185, 28, 28, 0.08);
    border: 1px solid rgba(185, 28, 28, 0.24);
}

.status-pending {
    color: var(--muted);
    background: rgba(96, 112, 132, 0.1);
    border: 1px solid rgba(96, 112, 132, 0.22);
}

.complaint-message {
    max-width: 440px;
    color: var(--text);
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.complaint-inbox-panel {
    overflow: hidden;
}

.complaint-inbox-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: -1.2rem -1.2rem 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(7, 31, 59, 0.06), rgba(31, 136, 152, 0.08)),
        var(--surface);
}

.complaint-inbox-header h2 {
    margin: 0.15rem 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 900;
}

.complaint-inbox-header p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.complaint-inbox-status,
.complaint-active-filters,
.complaint-action-set {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.complaint-inbox-toolbar {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.complaint-filter-bar {
    grid-template-columns: minmax(280px, 1fr) minmax(160px, 190px) minmax(180px, 230px) auto auto;
    margin-bottom: 0;
}

.complaint-active-filters {
    justify-content: flex-start;
}

.complaint-active-filters span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 30px;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: var(--field-muted);
    font-size: 0.76rem;
    font-weight: 900;
}

.complaint-inbox-table th,
.complaint-inbox-table td {
    white-space: nowrap;
}

.complaint-inbox-table td:nth-child(2) {
    white-space: normal;
    min-width: 260px;
}

.complaint-date-cell,
.complaint-student-cell {
    display: grid;
    gap: 0.18rem;
}

.complaint-date-cell strong,
.complaint-student-cell a {
    color: var(--text);
    font-weight: 900;
}

.complaint-date-cell small,
.complaint-date-cell span,
.complaint-student-cell small {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.complaint-type-pill,
.complaint-count-pill,
.complaint-read-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 32px;
    padding: 0.28rem 0.68rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
    white-space: nowrap;
}

.complaint-type-pill {
    color: #155e75;
    border: 1px solid rgba(21, 94, 117, 0.24);
    background: rgba(21, 94, 117, 0.1);
}

.complaint-count-pill {
    color: var(--primary);
    border: 1px solid rgba(7, 31, 59, 0.2);
    background: rgba(7, 31, 59, 0.06);
}

.complaint-count-pill.is-empty {
    color: var(--muted);
    border-color: rgba(96, 112, 132, 0.2);
    background: rgba(96, 112, 132, 0.08);
}

.complaint-read-state.is-read {
    color: var(--success);
    border: 1px solid rgba(21, 128, 61, 0.22);
    background: rgba(21, 128, 61, 0.08);
}

.complaint-read-state.is-unread {
    color: var(--danger);
    border: 1px solid rgba(185, 28, 28, 0.24);
    background: rgba(185, 28, 28, 0.08);
}

.complaint-eye-button {
    width: 36px;
    height: 32px;
    padding: 0;
    display: inline-grid;
    place-items: center;
}

.complaint-case-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(7, 31, 59, 0.92), rgba(31, 136, 152, 0.78)),
        var(--primary);
    box-shadow: 0 18px 42px rgba(7, 31, 59, 0.16);
}

.complaint-case-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.complaint-case-title .eyebrow,
.complaint-case-title h2,
.complaint-case-title p {
    color: #ffffff;
}

.complaint-case-title h2 {
    margin: 0.2rem 0 0.2rem;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    font-weight: 900;
    overflow-wrap: anywhere;
}

.complaint-case-title p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.complaint-case-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.4rem;
}

.complaint-case-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.complaint-case-badges .complaint-count-pill,
.complaint-case-badges .complaint-read-state {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
}

.complaint-case-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 1rem;
    align-items: start;
}

.complaint-case-main,
.complaint-case-side {
    display: grid;
    gap: 1rem;
}

.complaint-case-side {
    position: sticky;
    top: 92px;
}

.complaint-statement-panel {
    border-top: 4px solid var(--teal);
}

.complaint-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.complaint-detail-grid > div {
    min-width: 0;
    padding: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field-muted);
}

.complaint-detail-grid strong,
.complaint-detail-grid span {
    display: block;
    overflow-wrap: anywhere;
}

.complaint-detail-grid strong {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 800;
}

.complaint-detail-wide {
    grid-column: 1 / -1;
}

.complaint-detail-message {
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface);
    font-weight: 700;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.complaint-detail-list {
    display: grid;
    gap: 0.65rem;
}

.complaint-detail-list > div {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field-muted);
}

.complaint-detail-list strong,
.complaint-detail-list span {
    display: block;
    overflow-wrap: anywhere;
}

.complaint-detail-list strong {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.35;
}

.complaint-attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.complaint-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    max-width: 100%;
    min-height: 34px;
    padding: 0.38rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: var(--field-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.complaint-attachment-link span {
    overflow-wrap: anywhere;
}

.complaint-attachment-link small {
    color: var(--muted);
    font-size: 0.7rem;
}

.complaint-attachment-link:hover,
.complaint-attachment-link:focus {
    color: var(--primary);
    border-color: rgba(7, 31, 59, 0.25);
    background: var(--surface);
}

.complaint-preview-list {
    display: grid;
    gap: 1rem;
}

.complaint-preview-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field-muted);
}

.complaint-preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.complaint-preview-heading strong,
.complaint-preview-heading small {
    display: block;
    overflow-wrap: anywhere;
}

.complaint-attachment-preview-image {
    display: block;
    max-width: 100%;
    max-height: 620px;
    margin: 0 auto;
    object-fit: contain;
    background: #ffffff;
}

.complaint-attachment-frame {
    display: block;
    width: 100%;
    min-height: 680px;
    border: 0;
    background: #ffffff;
}

.complaint-preview-fallback {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: var(--muted);
    font-weight: 800;
}

.complaint-preview-fallback i {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: var(--primary);
}

@media (max-width: 991.98px) {
    .complaint-inbox-header,
    .complaint-case-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .complaint-inbox-status,
    .complaint-case-badges {
        justify-content: flex-start;
    }

    .complaint-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .complaint-case-layout {
        grid-template-columns: 1fr;
    }

    .complaint-case-side {
        position: static;
    }

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

    .complaint-attachment-frame {
        min-height: 520px;
    }
}

@media (max-width: 575.98px) {
    .complaint-filter-bar {
        grid-template-columns: 1fr;
    }

    .complaint-action-set {
        justify-content: flex-start;
    }

    .complaint-case-title {
        align-items: flex-start;
    }

    .complaint-detail-grid {
        grid-template-columns: 1fr;
    }

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

.status-rejected {
    color: var(--danger);
    background: rgba(185, 28, 28, 0.06);
    border: 1px solid rgba(185, 28, 28, 0.22);
}

.activity-type-pill {
    color: var(--primary);
    border: 1px solid rgba(7, 31, 59, 0.18);
    background: rgba(7, 31, 59, 0.05);
}

[data-theme="dark"] .activity-type-pill {
    color: #8fa8ff;
    border-color: rgba(143, 168, 255, 0.24);
    background: rgba(143, 168, 255, 0.08);
}

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

.activity-item {
    display: flex;
    gap: 0.8rem;
}

.activity-item i {
    margin-top: 0.35rem;
    color: var(--teal);
    font-size: 0.55rem;
}

.activity-item span,
.activity-item small {
    display: block;
    color: var(--muted);
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 280px auto auto;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.filter-search {
    position: relative;
}

.export-form {
    margin: 0;
}

.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

.table-actions form {
    margin: 0;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    background: var(--surface-soft);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-button:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .icon-button:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.icon-button.danger:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(185, 28, 28, 0.06);
}

.pagination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    color: var(--muted);
    font-weight: 700;
}

.page-link {
    color: var(--text);
    border-color: var(--border);
    background: var(--field);
}

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

.profile-grid {
    grid-template-columns: 320px minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
}

.profile-summary {
    display: grid;
    justify-items: center;
    gap: 0.8rem;
    text-align: center;
}

.profile-avatar {
    width: 78px;
    height: 78px;
    font-size: 2rem;
    font-weight: 800;
}

.profile-summary p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.detail-panel {
    min-height: 100%;
}

.detail-list {
    display: grid;
    gap: 0.85rem;
    margin: 1rem 0 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.detail-list dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-list dd {
    margin: 0;
    font-weight: 700;
    word-break: break-word;
}

.detail-list div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.admin-edit-form {
    max-width: 1120px;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 1.1fr 0.9fr;
    background:
        url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=1600&q=80") center/cover;
    box-shadow: inset 0 0 0 9999px rgba(4, 10, 32, 0.68);
}

.login-visual {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(2rem, 6vw, 5rem);
    color: #fff;
}

.login-visual .brand-copy strong,
.login-visual .brand-copy small {
    color: #fff;
}

.login-visual .brand-logo-wrap {
    width: 112px;
    height: 112px;
    flex-basis: 112px;
}

.login-visual h1 {
    max-width: 680px;
    margin: 2rem 0 1rem;
    font-size: clamp(2.3rem, 5.5vw, 4.6rem);
    line-height: 1.04;
    font-weight: 800;
}

.login-visual p {
    max-width: 620px;
    color: rgba(255, 255, 255, 0.8);
}

.login-card {
    align-self: center;
    width: min(460px, calc(100% - 2rem));
    margin: 2rem auto;
    padding: clamp(1.4rem, 4vw, 2.2rem);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.94);
}

[data-theme="dark"] .login-card {
    background: rgba(17, 25, 35, 0.9);
}

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

.dt-container .dt-input {
    color: var(--text);
    border-color: var(--border);
    background: var(--field);
}

.dt-container .dt-orderable-asc .dt-column-order::before,
.dt-container .dt-orderable-desc .dt-column-order::after,
.dt-container .dt-ordering-asc .dt-column-order::before,
.dt-container .dt-ordering-desc .dt-column-order::after {
    color: var(--muted);
    opacity: 0.75;
}

[data-theme="dark"] .dt-container .dt-orderable-asc .dt-column-order::before,
[data-theme="dark"] .dt-container .dt-orderable-desc .dt-column-order::after,
[data-theme="dark"] .dt-container .dt-ordering-asc .dt-column-order::before,
[data-theme="dark"] .dt-container .dt-ordering-desc .dt-column-order::after {
    color: var(--muted);
    opacity: 0.6;
}

.login-card h2 {
    margin: 0.4rem 0 1.2rem;
    font-weight: 800;
}

.login-note {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 1199px) {
    .dashboard-cards,
    .dashboard-grid,
    .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1500;
        width: 290px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

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

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

    .topbar-search {
        display: none;
    }

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

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

    .login-visual {
        min-height: 44vh;
    }
}

@media (max-width: 767px) {
    .admin-topbar,
    .admin-page-heading,
    .pagination-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-cards,
    .dashboard-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .detail-list div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

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

/* Compact professional admin density */
.admin-body {
    font-size: 14px;
}

@media (min-width: 992px) {
    .admin-shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }
    .admin-sidebar {
        overflow: hidden !important; /* Prevent sidebar itself from scrolling on desktop */
    }
    .admin-nav {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 4px; /* Space to prevent scrollbar overlapping active indicator */
    }
}

.admin-sidebar {
    gap: 1rem;
    padding: 0.9rem;
}

.admin-brand .brand-logo-wrap {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
}

.admin-brand .brand-copy strong {
    font-size: 1rem;
}

.admin-brand .brand-copy small {
    font-size: 0.62rem;
}

.admin-nav {
    gap: 0.35rem;
}

.admin-nav a {
    gap: 0.7rem;
    padding: 0.68rem 0.75rem;
    font-size: 0.86rem;
}

.admin-nav i {
    width: 18px;
    font-size: 0.92rem;
}

.sidebar-security {
    gap: 0.6rem;
    padding: 0.8rem;
    font-size: 0.82rem;
}

.admin-topbar {
    padding: 0.72rem 1rem;
}

.topbar-search {
    max-width: 430px;
}

.topbar-search input,
.filter-search input {
    min-height: 40px;
    padding: 0.58rem 0.85rem 0.58rem 2.35rem;
    font-size: 0.88rem;
}

.topbar-search i,
.filter-search i {
    left: 0.85rem;
    font-size: 0.9rem;
}

.topbar-actions {
    gap: 0.55rem;
}

.admin-user {
    min-height: 38px;
    padding: 0.28rem 0.6rem 0.28rem 0.28rem;
    font-size: 0.86rem;
}

.admin-user span,
.profile-avatar {
    width: 30px;
    height: 30px;
}

.admin-content {
    padding: 1rem;
}

.admin-page-heading {
    margin-bottom: 1rem;
}

.admin-page-heading h1 {
    font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.dashboard-cards,
.dashboard-grid,
.profile-grid {
    gap: 0.8rem;
}

.dashboard-card {
    gap: 0.75rem;
    padding: 0.9rem;
}

.dashboard-card > span {
    width: 42px;
    height: 42px;
}

.dashboard-card strong {
    font-size: 1.38rem;
}

.dashboard-card small {
    font-size: 0.76rem;
}

.admin-panel {
    padding: 0.9rem;
}

.panel-heading {
    margin-bottom: 0.8rem;
}

.panel-heading h2,
.detail-panel h2,
.profile-summary h2 {
    font-size: 0.96rem;
}

.filter-bar {
    grid-template-columns: minmax(230px, 1fr) 240px auto auto;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.admin-table {
    font-size: 0.84rem;
}

.admin-table > :not(caption) > * > * {
    padding: 0.64rem 0.55rem;
}

.admin-table th {
    font-size: 0.68rem;
}

.admin-table td small {
    font-size: 0.78rem;
}

.status-pill {
    min-height: 24px;
    padding: 0.12rem 0.48rem;
    font-size: 0.7rem;
}

.table-actions {
    gap: 0.32rem;
}

.table-actions .icon-button {
    width: 34px;
    height: 34px;
    font-size: 0.82rem;
}

.pagination-row {
    margin-top: 0.8rem;
    font-size: 0.82rem;
}

.pagination {
    gap: 4px;
}

.page-item .page-link {
    border-radius: 6px !important;
    color: var(--muted);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0.38rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.page-item .page-link:hover {
    background: var(--surface-soft);
    color: var(--primary);
    border-color: var(--teal);
}

.profile-grid {
    grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1fr);
}

.profile-avatar {
    width: 58px;
    height: 58px;
    font-size: 1.45rem;
}

.detail-list {
    gap: 0.65rem;
}

.detail-list div {
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 0.75rem;
    padding-bottom: 0.55rem;
}

.detail-list dt,
.detail-list dd {
    font-size: 0.84rem;
}

.login-visual {
    padding: clamp(1.6rem, 4vw, 3.6rem);
}

.login-visual .brand-logo-wrap {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
}

.login-visual h1 {
    max-width: 560px;
    margin: 1.4rem 0 0.8rem;
    font-size: clamp(1.9rem, 4vw, 3.35rem);
}

.login-visual p {
    max-width: 520px;
    font-size: 0.92rem;
}

.login-card {
    width: min(410px, calc(100% - 2rem));
    padding: clamp(1.1rem, 3vw, 1.65rem);
}

.login-card h2 {
    font-size: 1.35rem;
}

.login-note {
    font-size: 0.8rem;
}

.dt-container,
.dt-container label,
.dt-container .dt-input {
    font-size: 0.82rem;
}

@media (max-width: 991px) {
    .admin-sidebar {
        width: 260px;
    }

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

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

@media (max-width: 767px) {
    .admin-content {
        padding: 0.8rem;
    }

    .admin-topbar {
        padding: 0.65rem 0.8rem;
    }

    .admin-page-heading h1 {
        font-size: 1.45rem;
    }

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

.login-visual h1,
.login-visual h2,
.login-visual p {
    color: #ffffff;
    text-shadow: 0 2px 18px rgba(3, 9, 43, 0.3);
}

.login-visual .brand-copy strong,
.login-visual .brand-copy small {
    color: #ffffff;
    text-shadow: none;
}

/* Advanced admin workspace polish */
.topbar-context {
    display: grid;
    min-width: 150px;
    line-height: 1.15;
}

.topbar-context strong {
    color: var(--text);
    font-size: 0.88rem;
}

.topbar-context span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.admin-command-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1rem;
    padding: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, #071f3b 0%, #030d1a 100%);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--accent);
}

.admin-command-panel h2 {
    margin: 0.35rem 0 0.3rem;
    color: #ffffff;
    font-size: 1.24rem;
    font-weight: 800;
}

.admin-command-panel p {
    max-width: 640px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
}

.admin-command-panel .eyebrow {
    color: #a9fff8;
}

.command-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

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

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    position: absolute;
    right: -28px;
    bottom: -34px;
    width: 92px;
    height: 92px;
    content: "";
    border-radius: 50%;
    background: rgba(0, 142, 161, 0.08);
}

.metric-card em {
    display: block;
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 700;
}

.metric-blue > span {
    background: #07145a;
}

.metric-teal > span {
    background: #006c7a;
}

.metric-gold > span {
    color: #07145a;
    background: #f0c24b;
}

.metric-green > span {
    background: #0f8a61;
}

.records-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 0.9rem;
}

.records-summary article {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.records-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.records-summary strong {
    display: block;
    margin-top: 0.3rem;
    color: var(--text);
    font-size: 1.28rem;
    line-height: 1;
}

[data-theme="light"] .records-summary article {
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

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

.admin-table tbody tr:hover {
    box-shadow: inset 3px 0 0 var(--teal);
}

/* Admissions office composition pass */
.admin-shell {
    grid-template-columns: 260px minmax(0, 1fr);
}

.admin-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

@media (min-width: 1200px) {
    .modal-dialog.modal-lg {
        width: 90% !important;
        max-width: 1600px !important;
    }
}

.admin-page-heading {
    align-items: flex-end;
}

.admin-command-panel {
    border-left: 4px solid var(--accent);
}

.dashboard-card,
.records-summary article {
    border-left: 3px solid var(--teal);
}

.dashboard-card.metric-gold,
.records-summary article:nth-child(2) {
    border-left-color: #d9a51c;
}

.dashboard-card.metric-green,
.records-summary article:nth-child(4) {
    border-left-color: #0f8a61;
}

.admin-panel {
    border-color: #d8e1ea;
}

[data-theme="dark"] .admin-panel {
    border-color: var(--border);
}

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

@media (max-width: 991px) {
    .topbar-context {
        display: none;
    }

    .admin-command-panel {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

@media (max-width: 575px) {
    .records-summary {
        grid-template-columns: 1fr;
    }
}

/* Human-built institutional admin system: flat and structured */
.admin-body,
[data-theme="light"] .admin-body,
[data-theme="dark"] .admin-body {
    background: var(--bg);
}

.admin-sidebar,
[data-theme="light"] .admin-sidebar,
[data-theme="dark"] .admin-sidebar {
    background: var(--surface);
    box-shadow: none;
}

.admin-nav a.active,
[data-theme="light"] .admin-nav a.active {
    color: var(--primary);
    background: var(--surface-soft);
    box-shadow: inset 3px 0 0 var(--teal);
}

.admin-topbar,
[data-theme="light"] .admin-topbar,
[data-theme="dark"] .admin-topbar {
    background: var(--surface);
    box-shadow: none;
}

.dashboard-card,
.admin-panel,
[data-theme="light"] .dashboard-card,
[data-theme="light"] .admin-panel,
.records-summary article,
[data-theme="light"] .records-summary article {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.dashboard-card > span,
.admin-user span,
.profile-avatar {
    background: var(--primary);
}

.admin-command-panel {
    background: linear-gradient(135deg, #071f3b 0%, #030d1a 100%);
}

.admin-command-panel .eyebrow {
    color: #b7f4f2;
}

.command-actions .btn-light {
    color: #07145a;
    background: #ffffff;
    border-color: #ffffff;
}

.command-actions .btn-outline-light {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.72);
}

.metric-card::after {
    display: none;
}

.metric-blue > span,
.metric-teal > span,
.metric-green > span {
    background: var(--primary);
}

.metric-gold > span {
    color: #07145a;
    background: #f0c24b;
}

.login-shell {
    background:
        url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=1600&q=80") center/cover;
    box-shadow: inset 0 0 0 9999px rgba(4, 10, 32, 0.68);
}

.login-card,
[data-theme="light"] .login-card,
[data-theme="dark"] .login-card {
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.login-card .eyebrow,
.login-card h2,
.login-card .form-label,
.login-note {
    text-shadow: none;
}

.table-responsive,
[data-theme="light"] .table-responsive {
    box-shadow: none;
}

.admin-table tbody tr {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-table tbody tr:hover {
    box-shadow: inset 3px 0 0 var(--teal), 0 4px 12px rgba(15, 23, 42, 0.04);
}

/* Form and UI Polish */
.btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.form-control, .form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(7, 31, 59, 0.12);
}

[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.alert {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    color: var(--success);
    background-color: rgba(21, 128, 61, 0.08);
    border-color: rgba(21, 128, 61, 0.2);
    border-left: 4px solid var(--success);
}

.alert-danger {
    color: var(--danger);
    background-color: rgba(185, 28, 28, 0.08);
    border-color: rgba(185, 28, 28, 0.2);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    color: var(--warning);
    background-color: rgba(180, 83, 9, 0.08);
    border-color: rgba(180, 83, 9, 0.2);
    border-left: 4px solid var(--warning);
}

/* Premium Modal Overrides */
.modal-content {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

[data-theme="dark"] .modal-content {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 1rem 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 0.85rem 1.25rem;
}

.modal-title {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 800;
}

/* ==========================================================================
   PREMIUM DARK NAVY SIDEBAR SYSTEM (Light & Dark Theme Compatible)
   ========================================================================== */
.admin-sidebar,
[data-theme="light"] .admin-sidebar,
[data-theme="dark"] .admin-sidebar {
    background: linear-gradient(180deg, #071f3b 0%, #030d1a 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 4px 0 24px rgba(3, 9, 30, 0.15) !important;
}

.admin-brand {
    padding: 0.8rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    margin-bottom: 0.5rem;
}

.admin-brand .brand-copy strong {
    color: #ffffff !important;
    font-weight: 800;
}

.admin-brand .brand-copy small {
    color: #d7a536 !important; /* Gold Tagline */
    font-weight: 700;
    opacity: 0.9;
}

/* Navigation Links */
.admin-nav a {
    color: rgba(255, 255, 255, 0.72) !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-left: 3px solid transparent !important;
    border-radius: var(--radius) !important;
    padding: 0.72rem 0.95rem !important;
}

.admin-nav a i {
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 1rem !important;
    width: 20px !important;
    transition: color 0.22s ease !important;
}

/* Hover States */
.admin-nav a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
    transform: translateX(4px) !important;
}

.admin-nav a:hover i {
    color: #d7a536 !important; /* Gold on hover */
}

/* Active States override */
.admin-nav a.active,
[data-theme="light"] .admin-nav a.active,
[data-theme="dark"] .admin-nav a.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.09) !important;
    border-left: 3px solid #d7a536 !important; /* Premium gold accent */
    box-shadow: none !important;
}

.admin-nav a.active i,
[data-theme="light"] .admin-nav a.active i,
[data-theme="dark"] .admin-nav a.active i {
    color: #d7a536 !important; /* Gold icon for active link */
}

/* Sidebar Security Section */
.sidebar-security {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: rgba(255, 255, 255, 0.55) !important;
    margin-top: auto;
    font-size: 0.8rem !important;
}

.sidebar-security i {
    color: #d7a536 !important; /* Gold shield */
}

/* Prominent left borders on metrics cards and summaries */
.dashboard-card,
.records-summary article {
    border-left-width: 4px !important;
}

/* ==========================================================================
   ADVANCED DASHBOARD CARDS & PANEL POLISH (Compact-Dense & Premium)
   ========================================================================== */
:root {
    --admin-radius: 14px;
    --admin-shadow: 0 8px 30px -4px rgba(3, 9, 30, 0.04), 0 4px 12px -2px rgba(3, 9, 30, 0.02);
    --admin-shadow-hover: 0 20px 38px -8px rgba(3, 9, 30, 0.08), 0 8px 18px -4px rgba(3, 9, 30, 0.03);
    --admin-shadow-dark: 0 12px 35px -6px rgba(0, 0, 0, 0.35);
    --admin-shadow-dark-hover: 0 24px 48px -8px rgba(0, 0, 0, 0.55);
}

.dashboard-card,
.records-summary article,
.admin-panel,
[data-theme="light"] .dashboard-card,
[data-theme="light"] .admin-panel,
[data-theme="light"] .records-summary article {
    border: 1px solid var(--border) !important;
    border-radius: var(--admin-radius) !important;
    background: var(--surface) !important;
    box-shadow: var(--admin-shadow) !important;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.24s ease !important;
}

[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .admin-panel,
[data-theme="dark"] .records-summary article {
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: var(--admin-shadow-dark) !important;
}

/* Elevate on Hover */
.dashboard-card:hover,
.records-summary article:hover,
[data-theme="light"] .dashboard-card:hover,
[data-theme="light"] .records-summary article:hover {
    transform: translateY(-4px) !important;
    box-shadow: var(--admin-shadow-hover) !important;
    border-color: var(--teal) !important;
}

[data-theme="dark"] .dashboard-card:hover,
[data-theme="dark"] .records-summary article:hover {
    box-shadow: var(--admin-shadow-dark-hover) !important;
    border-color: var(--teal) !important;
}

/* Metrics Cards Design */
.dashboard-card {
    padding: 1.15rem 1rem !important;
    border-left: 4px solid var(--primary) !important;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 90px;
    height: 100%;
    background: radial-gradient(circle at 100% 50%, rgba(0, 142, 161, 0.04) 0%, transparent 80%);
    pointer-events: none;
}

/* Translucent colored icon containers */
.dashboard-card > span {
    width: 46px !important;
    height: 46px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    transition: transform 0.26s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.dashboard-card:hover > span {
    transform: scale(1.12) rotate(4deg) !important;
}

/* Icon variations */
.metric-blue > span {
    background: rgba(7, 31, 59, 0.06) !important;
    color: var(--primary) !important;
}
[data-theme="dark"] .metric-blue > span {
    background: rgba(96, 165, 250, 0.15) !important;
    color: var(--primary) !important;
}

.metric-teal > span {
    background: rgba(37, 111, 143, 0.08) !important;
    color: var(--teal) !important;
}
[data-theme="dark"] .metric-teal > span {
    background: rgba(56, 189, 248, 0.15) !important;
    color: var(--teal) !important;
}

.metric-gold > span {
    background: rgba(215, 165, 54, 0.08) !important;
    color: var(--accent) !important;
}
[data-theme="dark"] .metric-gold > span {
    background: rgba(251, 191, 36, 0.15) !important;
    color: var(--accent) !important;
}

.metric-green > span {
    background: rgba(21, 128, 61, 0.08) !important;
    color: var(--success) !important;
}
[data-theme="dark"] .metric-green > span {
    background: rgba(34, 197, 94, 0.15) !important;
    color: var(--success) !important;
}

/* Card typography */
.dashboard-card strong {
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: var(--text) !important;
    line-height: 1.1 !important;
}

.dashboard-card small {
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    color: var(--muted) !important;
}

.dashboard-card em {
    color: var(--muted) !important;
    opacity: 0.85 !important;
    font-size: 0.7rem !important;
    margin-top: 0.15rem;
}

/* ==========================================================================
   ADVANCED TABLE DESIGN
   ========================================================================== */
.admin-table {
    width: 100% !important;
    border-radius: var(--admin-radius) !important;
    border: none !important;
    overflow: hidden !important;
}

.admin-table th {
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.06em !important;
    color: var(--muted) !important;
    background: var(--surface-soft) !important;
    padding: 0.9rem 0.8rem !important;
    border-bottom: 2px solid var(--border) !important;
}

[data-theme="light"] .admin-table th {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.admin-table td {
    padding: 0.85rem 0.8rem !important;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--surface) !important;
}

[data-theme="light"] .admin-table td {
    background: #ffffff !important;
}

.admin-table tbody tr {
    transition: all 0.22s ease !important;
    border-left: 3px solid transparent !important;
}

/* Hover highlights and left-inset accents */
.admin-table tbody tr:hover td {
    background: var(--surface-soft) !important;
}

[data-theme="light"] .admin-table tbody tr:hover td {
    background: rgba(7, 31, 59, 0.015) !important;
}

.admin-table tbody tr:hover {
    border-left-color: var(--accent) !important; /* Gold side-highlight on hover */
    box-shadow: 0 4px 12px rgba(3, 9, 30, 0.03) !important;
}

/* Table links */
.admin-table a {
    color: var(--text) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

.admin-table a:hover {
    color: var(--teal) !important;
}

/* Premium Table Action Buttons */
.table-actions {
    gap: 0.45rem !important;
}

.table-actions .icon-button {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--muted) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    transition: all 0.2s ease !important;
}

.table-actions .icon-button:hover {
    transform: translateY(-2px) !important;
}

/* Color codes for specific action buttons */
.table-actions .icon-button[aria-label*="View"]:hover,
.table-actions .icon-button[data-bs-title*="View"]:hover {
    color: #256f8f !important;
    background: rgba(37, 111, 143, 0.08) !important;
    border-color: rgba(37, 111, 143, 0.25) !important;
    box-shadow: 0 4px 8px rgba(37, 111, 143, 0.1) !important;
}

.table-actions .icon-button[aria-label*="Edit"]:hover,
.table-actions .icon-button[data-bs-title*="Edit"]:hover {
    color: #d7a536 !important;
    background: rgba(215, 165, 54, 0.08) !important;
    border-color: rgba(215, 165, 54, 0.25) !important;
    box-shadow: 0 4px 8px rgba(215, 165, 54, 0.1) !important;
}

.table-actions .icon-button.danger:hover {
    color: #b91c1c !important;
    background: rgba(185, 28, 28, 0.08) !important;
    border-color: rgba(185, 28, 28, 0.25) !important;
    box-shadow: 0 4px 8px rgba(185, 28, 28, 0.1) !important;
}

/* Course management toggles */
.table-actions button i.fa-toggle-on {
    color: var(--success) !important;
    font-size: 1.25rem !important;
}

.table-actions button i.fa-toggle-off {
    color: var(--muted) !important;
    font-size: 1.25rem !important;
}

/* ==========================================================================
   PANELS & HEADINGS POLISH
   ========================================================================== */
.admin-panel {
    padding: 1.25rem !important;
}

.panel-heading {
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 1.2rem !important;
}

.panel-heading h2 {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
}

.panel-heading h2::before {
    content: "" !important;
    display: inline-block !important;
    width: 4px !important;
    height: 15px !important;
    background: var(--accent) !important; /* Gold accent bar */
    border-radius: 2px !important;
}

/* Filter bar controls polish */
.filter-bar {
    grid-template-columns: minmax(230px, 1fr) 240px auto auto !important;
    gap: 0.75rem !important;
    margin-bottom: 1.20rem !important;
    background: var(--surface-soft) !important;
    padding: 0.9rem !important;
    border-radius: 10px !important;
    border: 1px solid var(--border) !important;
    align-items: center;
}

[data-theme="light"] .filter-bar {
    background: #f8fafc !important;
}

.filter-search input {
    background: var(--field) !important;
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
}

/* ==========================================================================
   MODERN STATUS BADGES OVERHAUL
   ========================================================================== */
.status-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    min-height: 26px !important;
    padding: 0.2rem 0.75rem !important;
    border-radius: 6px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    border: 1px solid transparent !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.status-pill::before {
    content: "" !important;
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: currentColor !important;
    display: inline-block !important;
}

.status-new {
    color: #b45309 !important;
    background: rgba(245, 158, 11, 0.07) !important;
    border-color: rgba(245, 158, 11, 0.22) !important;
}
.status-new::before {
    animation: status-pulse 1.6s infinite ease-in-out !important;
}

.status-reviewed {
    color: var(--primary) !important;
    background: rgba(7, 31, 59, 0.04) !important;
    border-color: rgba(7, 31, 59, 0.16) !important;
}
[data-theme="dark"] .status-reviewed {
    color: #60a5fa !important;
    background: rgba(96, 165, 250, 0.08) !important;
    border-color: rgba(96, 165, 250, 0.22) !important;
}

.status-accepted {
    color: #16a34a !important;
    background: rgba(22, 163, 74, 0.06) !important;
    border-color: rgba(22, 163, 74, 0.2) !important;
}

.status-enrolled {
    color: #15803d !important;
    background: rgba(22, 163, 74, 0.08) !important;
    border-color: rgba(22, 163, 74, 0.24) !important;
}

.status-rejected {
    color: #dc2626 !important;
    background: rgba(220, 38, 38, 0.06) !important;
    border-color: rgba(220, 38, 38, 0.2) !important;
}

@keyframes status-pulse {
    0%, 100% {
        transform: scale(0.9);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.35);
        opacity: 1;
    }
}

/* ==========================================================================
   GLASSMORPHISM TOPBAR & INBOX NOTIFICATIONS
   ========================================================================== */
.admin-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    backdrop-filter: blur(12px) !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
}

[data-theme="dark"] .admin-topbar {
    background: rgba(11, 15, 25, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* ==========================================================================
   STUDENT PROFILE MASTER-DETAIL & VIEW POLISH
   ========================================================================== */
.profile-grid {
    grid-template-columns: 300px 1fr !important;
    gap: 1.5rem !important;
    align-items: start;
}

.profile-summary {
    position: sticky;
    top: 75px;
    padding: 1.75rem 1.25rem !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.profile-avatar {
    width: 72px !important;
    height: 72px !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 10px rgba(7, 31, 59, 0.15);
    background: linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
}

.profile-avatar.profile-image-avatar {
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.9);
}

.profile-summary h2 {
    font-size: 1.25rem !important;
    margin: 0.5rem 0 0.1rem !important;
    color: var(--text);
}

.profile-summary p {
    font-size: 0.82rem !important;
    letter-spacing: 0.02em;
    font-weight: 700 !important;
    color: var(--muted) !important;
    margin-bottom: 0.5rem !important;
}

.detail-panel {
    padding: 1.5rem !important;
}

.detail-panel h2 {
    font-size: 1.05rem !important;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
    margin-bottom: 1.1rem !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-panel h2 i {
    color: var(--teal);
    font-size: 1rem;
}

.detail-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.2rem !important;
    margin: 0 !important;
}

.detail-list div {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    padding-bottom: 0.85rem !important;
    border-bottom: 1px dashed var(--border) !important;
}

.detail-list dt {
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: var(--muted) !important;
    font-weight: 700 !important;
}

.detail-list dd {
    font-size: 0.88rem !important;
    color: var(--text) !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.detail-action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
}

.profile-history-table td small {
    display: block;
    margin-bottom: 0.25rem;
}

@media (max-width: 1199px) {
    .profile-grid {
        grid-template-columns: 1fr !important;
    }
    .profile-summary {
        position: relative;
        top: 0;
    }
}

@media (max-width: 767px) {
    .detail-list {
        grid-template-columns: 1fr !important;
        gap: 0.9rem !important;
    }
}

/* ==========================================================================
   SETTINGS FORM FIELDS AND LABELS POLISH
   ========================================================================== */
.admin-edit-form {
    max-width: 100% !important;
}

.form-label {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border-radius: 8px !important;
    padding: 0.6rem 0.8rem !important;
    font-size: 0.88rem !important;
    background-color: var(--field) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--teal) !important;
    box-shadow: 0 0 0 3px rgba(37, 111, 143, 0.12) !important;
}

[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus {
    border-color: var(--teal) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

.form-text {
    font-size: 0.74rem !important;
    color: var(--muted) !important;
    margin-top: 0.3rem;
}

/* Form Action Buttons Wrapper */
.form-actions, .modal-footer {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
    margin-top: 1.2rem;
}

/* ==========================================================================
   PREMIUM GLASSMORPHIC LOGIN OVERHAUL
   ========================================================================== */
.login-shell {
    grid-template-columns: 1.2fr 0.8fr !important;
    background: radial-gradient(circle at 10% 20%, rgba(3, 9, 30, 0.85) 0%, rgba(7, 31, 59, 0.95) 100%),
                url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=1600&q=80") center/cover !important;
    box-shadow: none !important;
}

.login-visual h1 {
    font-family: var(--font-sans) !important;
    font-size: clamp(2.4rem, 4.5vw, 3.8rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    line-height: 1.05 !important;
}

.login-card {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18) !important;
}

[data-theme="dark"] .login-card {
    background: rgba(17, 25, 40, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45) !important;
}

@media (max-width: 991px) {
    .login-shell {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   GLOBAL ADMIN TYPOGRAPHY & INTEGRATED INPUT GROUPS
   ========================================================================== */
.admin-body h1,
.admin-body h2,
.admin-body h3,
.admin-body h4,
.admin-body h5,
.admin-body h6 {
    font-family: var(--font-sans) !important;
    letter-spacing: -0.02em !important;
}

/* Premium Integrated Input Groups */
.input-group {
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(3, 9, 30, 0.03) !important;
    border: 1px solid var(--border) !important;
    background-color: var(--field) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex !important;
    align-items: stretch !important;
}
.input-group:focus-within {
    border-color: var(--teal) !important;
    box-shadow: 0 0 0 3px rgba(37, 111, 143, 0.12) !important;
}
[data-theme="dark"] .input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}
.input-group > .input-group-text {
    background: var(--field-muted) !important;
    border: none !important;
    color: var(--muted) !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 0.88rem !important;
    border-right: 1px solid var(--border) !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 42px;
}
.input-group > .form-control {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0.6rem 0.85rem !important;
    flex: 1;
}
.input-group > .form-control:focus {
    box-shadow: none !important;
    background: transparent !important;
}

/* ==========================================================================
   REFINED ADMIN LOGIN EXPERIENCE
   ========================================================================== */
.admin-login-page {
    min-height: 100vh;
    background: #071f3b;
}

.admin-login-page .app-loader {
    background: #071f3b;
}

.admin-login-page .scroll-progress {
    display: none;
}

.login-shell {
    position: relative;
    isolation: isolate;
    display: grid !important;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.72fr) !important;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(3, 13, 26, 0.92) 0%, rgba(7, 31, 59, 0.74) 48%, rgba(7, 31, 59, 0.18) 100%),
        url("../images/hero_campus.png") center/cover !important;
    box-shadow: none !important;
}

.login-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(3, 9, 30, 0.05), rgba(3, 9, 30, 0.48));
}

.login-visual {
    position: relative;
    display: flex !important;
    min-height: 100%;
    align-items: center;
    justify-content: center;
    padding: 4.5rem !important;
    color: #ffffff;
}

.login-visual-inner {
    display: flex;
    width: 100%;
    max-width: 760px;
    flex-direction: column;
    gap: 2.2rem;
}

.login-brand {
    width: fit-content;
    color: #ffffff;
}

.login-brand:hover {
    color: #ffffff;
}

.login-brand .brand-logo-wrap {
    width: 120px !important;
    height: 120px !important;
    flex-basis: 120px !important;
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
}

.login-brand .brand-copy strong,
.login-brand .brand-copy small {
    color: #ffffff !important;
    letter-spacing: 0 !important;
}

.login-brand .brand-copy strong {
    font-size: 1.8rem;
}

.login-brand .brand-copy small {
    max-width: 320px;
    opacity: 0.8;
    font-size: 0.9rem;
}

.login-hero-copy {
    max-width: 710px;
}

.login-hero-copy .eyebrow {
    color: #f6ca5f;
    letter-spacing: 0;
    margin-bottom: 1rem;
}

.login-visual h1 {
    max-width: 700px;
    margin: 0 0 1.1rem;
    color: #ffffff;
    font-family: var(--font-sans) !important;
    font-size: 3.15rem !important;
    font-weight: 800 !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
}

.login-visual p {
    max-width: 660px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.72;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    max-width: 700px;
}

.login-feature {
    display: flex;
    min-height: 88px;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
}

.login-feature i {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 8px;
    color: #071f3b;
    background: #f6ca5f;
}

.login-feature span {
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.35;
}

.login-panel {
    display: grid;
    min-height: 100%;
    place-items: center;
    padding: 2rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
}

[data-theme="dark"] .login-panel {
    border-left-color: rgba(255, 255, 255, 0.08);
    background: rgba(11, 15, 25, 0.9);
}

.login-card,
[data-theme="light"] .login-card,
[data-theme="dark"] .login-card {
    width: min(462px, 100%) !important;
    margin: 0 auto !important;
    padding: 2rem !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: var(--surface) !important;
    box-shadow: 0 24px 58px rgba(3, 9, 30, 0.18) !important;
    backdrop-filter: none !important;
}

[data-theme="dark"] .login-card {
    box-shadow: 0 24px 58px rgba(0, 0, 0, 0.45) !important;
}

.login-card-header {
    margin-bottom: 1.5rem;
}

.login-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 30px;
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(37, 111, 143, 0.2);
    border-radius: 8px;
    color: var(--teal);
    background: rgba(37, 111, 143, 0.08);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
}

[data-theme="dark"] .login-status {
    border-color: rgba(56, 189, 248, 0.26);
    background: rgba(56, 189, 248, 0.1);
}

.login-card h2 {
    margin: 0.85rem 0 0.45rem;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

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

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.45;
}

.login-alert i {
    margin-top: 0.15rem;
}

.login-form {
    display: grid;
    gap: 1rem;
}

.login-field {
    display: grid;
    gap: 0.42rem;
}

.login-field .form-label,
.login-label-row .form-label {
    margin: 0;
    color: var(--text);
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}

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

.login-label-row span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.login-form .input-group {
    min-height: 48px;
    overflow: hidden !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: var(--field) !important;
    box-shadow: 0 1px 2px rgba(3, 9, 30, 0.04) !important;
}

.login-form .input-group:focus-within {
    border-color: var(--teal) !important;
    box-shadow: 0 0 0 3px rgba(37, 111, 143, 0.14) !important;
}

[data-theme="dark"] .login-form .input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18) !important;
}

.login-form .input-group-text {
    min-width: 48px !important;
    padding: 0 0.95rem !important;
    border: 0 !important;
    border-right: 1px solid var(--border) !important;
    color: var(--teal) !important;
    background: var(--field-muted) !important;
}

.login-form .form-control {
    min-height: 48px;
    border: 0 !important;
    color: var(--text) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.login-form .form-control::placeholder {
    color: var(--muted);
}

.password-toggle {
    display: inline-grid;
    width: 48px;
    min-height: 48px;
    place-items: center;
    border: 0;
    border-left: 1px solid var(--border);
    color: var(--muted);
    background: transparent;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--teal);
    background: var(--field-muted);
}

.password-toggle:focus-visible {
    outline: 3px solid rgba(37, 111, 143, 0.22);
    outline-offset: -3px;
}

.login-security-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.login-security-row span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.login-security-row i {
    color: var(--success);
}

.login-submit {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 0.2rem;
    border-radius: 8px !important;
    font-weight: 800 !important;
}

.login-submit i {
    transition: transform 0.2s ease;
}

.login-submit:hover i,
.login-submit:focus i {
    transform: translateX(3px);
}

.login-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.login-card-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary);
    font-weight: 800;
}

.login-card-footer a:hover {
    color: var(--teal);
}

@media (max-width: 1199px) {
    .login-shell {
        grid-template-columns: minmax(0, 0.95fr) minmax(400px, 0.8fr) !important;
    }

    .login-visual {
        padding: 3rem !important;
    }

    .login-visual h1 {
        font-size: 2.55rem !important;
    }

    .login-feature-grid {
        grid-template-columns: 1fr;
        max-width: 430px;
    }

    .login-feature {
        min-height: 68px;
    }
}

@media (max-width: 991px) {
    .login-shell {
        grid-template-columns: 1fr !important;
        min-height: 100vh;
    }

    .login-visual {
        min-height: auto !important;
        padding: 2rem 1.25rem !important;
        justify-content: flex-start;
    }

    .login-visual-inner {
        gap: 1.45rem;
        max-width: 680px;
    }

    .login-visual h1 {
        font-size: 2.1rem !important;
    }

    .login-visual p {
        font-size: 0.94rem;
    }

    .login-panel {
        min-height: auto;
        padding: 1.25rem;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.26);
    }

    .login-card,
    [data-theme="light"] .login-card,
    [data-theme="dark"] .login-card {
        padding: 1.35rem !important;
    }
}

@media (max-width: 575px) {
    .login-visual {
        padding: 1.35rem 1rem !important;
    }

    .login-visual-inner {
        gap: 1rem;
    }

    .login-brand .brand-logo-wrap {
        width: 96px !important;
        height: 96px !important;
        flex-basis: 96px !important;
    }

    .login-brand .brand-copy strong {
        font-size: 1.4rem;
    }

    .login-brand .brand-copy small {
        max-width: 240px;
        font-size: 0.75rem;
    }

    .login-visual h1 {
        margin-bottom: 0.75rem;
        font-size: 1.65rem !important;
        line-height: 1.12 !important;
    }

    .login-visual p {
        font-size: 0.9rem;
        line-height: 1.55;
    }

    .login-feature-grid {
        display: none;
    }

    .login-feature {
        align-items: flex-start;
    }

    .login-panel {
        padding: 0.9rem;
    }

    .login-card h2 {
        font-size: 1.45rem;
    }

    .login-label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.1rem;
    }

    .login-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================================================
   ADMIN MOBILE RESPONSIVE SYSTEM
   ========================================================================== */
.admin-main {
    min-width: 0;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

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

.batch-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.batch-export-actions form {
    display: flex;
    margin: 0;
}

@media (max-width: 991px) {
    .admin-shell {
        display: block !important;
        min-height: 100vh;
    }

    .admin-sidebar,
    [data-theme="light"] .admin-sidebar,
    [data-theme="dark"] .admin-sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        z-index: 1600 !important;
        width: min(300px, calc(100vw - 3rem)) !important;
        height: 100dvh !important;
        padding: 1rem !important;
        overflow-y: auto;
        transform: translateX(-105%) !important;
        transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

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

    .admin-sidebar-open {
        overflow: hidden;
    }

    .admin-sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1500;
        background: rgba(3, 9, 30, 0.5);
        backdrop-filter: blur(2px);
    }

    .sidebar-toggle {
        display: inline-grid !important;
        flex: 0 0 auto;
    }

    .admin-topbar,
    [data-theme="light"] .admin-topbar,
    [data-theme="dark"] .admin-topbar {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center !important;
        gap: 0.7rem !important;
        padding: 0.75rem 1rem !important;
    }

    .topbar-context {
        display: grid !important;
        min-width: 0;
    }

    .topbar-context strong,
    .topbar-context span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-search {
        display: none !important;
    }

    .topbar-actions {
        width: auto !important;
        min-width: 0;
        justify-content: flex-end !important;
    }

    .admin-content {
        width: 100% !important;
        padding: 1rem !important;
    }

    .admin-page-heading {
        align-items: flex-start !important;
        flex-direction: column !important;
        gap: 0.85rem !important;
    }

    .admin-page-heading > div,
    .admin-page-heading h1 {
        min-width: 0;
        max-width: 100%;
    }

    .admin-page-heading h1 {
        overflow-wrap: anywhere;
    }

    .admin-page-heading > .btn,
    .admin-page-heading > a.btn,
    .admin-page-heading .btn {
        min-height: 40px;
    }

    .export-actions,
    .heading-actions {
        width: 100%;
        justify-content: flex-start !important;
    }

    .dashboard-cards,
    .dashboard-grid,
    .profile-grid {
        grid-template-columns: 1fr !important;
    }

    .admin-command-panel {
        align-items: flex-start !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .command-actions {
        width: 100%;
        justify-content: flex-start !important;
    }

    .records-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

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

    .filter-bar .btn,
    .filter-bar .form-select,
    .filter-search,
    .filter-search input {
        width: 100% !important;
    }

    .panel-heading {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 0.4rem !important;
    }

    .profile-summary {
        position: static !important;
    }

    .detail-list {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 767px) {
    .admin-body {
        overflow-x: hidden;
    }

    .admin-content {
        padding: 0.85rem !important;
    }

    .admin-topbar,
    [data-theme="light"] .admin-topbar,
    [data-theme="dark"] .admin-topbar {
        gap: 0.55rem !important;
        padding: 0.65rem 0.75rem !important;
    }

    .admin-user {
        gap: 0.45rem !important;
        padding: 0.25rem 0.45rem 0.25rem 0.25rem !important;
    }

    .admin-user strong {
        max-width: 112px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-page-heading {
        margin-bottom: 0.85rem !important;
    }

    .admin-page-heading h1 {
        font-size: 1.55rem !important;
        line-height: 1.18 !important;
    }

    .admin-page-heading .eyebrow,
    .admin-command-panel .eyebrow {
        margin-bottom: 0.45rem;
        font-size: 0.72rem;
    }

    .admin-command-panel {
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    .admin-command-panel h2 {
        font-size: 1.08rem !important;
        line-height: 1.28 !important;
    }

    .admin-command-panel p {
        font-size: 0.88rem;
    }

    .dashboard-card,
    .records-summary article,
    .admin-panel,
    [data-theme="light"] .dashboard-card,
    [data-theme="light"] .admin-panel,
    [data-theme="light"] .records-summary article {
        border-radius: 12px !important;
    }

    .dashboard-card {
        align-items: flex-start !important;
        min-width: 0;
    }

    .dashboard-card > div {
        min-width: 0;
    }

    .dashboard-card small,
    .dashboard-card em {
        overflow-wrap: anywhere;
    }

    .admin-panel {
        padding: 1rem !important;
        min-width: 0;
    }

    .table-responsive {
        overflow: visible !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .admin-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .admin-table colgroup {
        display: none !important;
    }

    .admin-table thead {
        display: none !important;
    }

    .admin-table tbody {
        display: grid !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.8rem !important;
    }

    .admin-table tbody tr {
        display: grid !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.62rem !important;
        padding: 0.9rem !important;
        border: 1px solid var(--border) !important;
        border-left: 4px solid var(--teal) !important;
        border-radius: 12px !important;
        background: var(--surface) !important;
        box-shadow: var(--admin-shadow) !important;
    }

    .admin-table tbody tr:hover {
        transform: none !important;
        border-color: var(--border) !important;
        border-left-color: var(--accent) !important;
        box-shadow: var(--admin-shadow) !important;
    }

    .admin-table td,
    .admin-table > :not(caption) > * > * {
        display: grid !important;
        width: 100% !important;
        max-width: 100% !important;
        grid-template-columns: minmax(7rem, 36%) minmax(0, 1fr);
        align-items: start !important;
        gap: 0.75rem !important;
        min-width: 0;
        padding: 0 !important;
        border: 0 !important;
        color: var(--text) !important;
        background: transparent !important;
        box-shadow: none !important;
        text-align: left !important;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .admin-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0;
        line-height: 1.35;
        text-transform: uppercase;
    }

    .admin-table td[colspan] {
        display: block !important;
        text-align: center !important;
    }

    .admin-table td[colspan]::before,
    .admin-table td:not([data-label])::before {
        display: none;
    }

    .admin-table td small {
        margin-top: 0.12rem;
    }

    .admin-table td > a,
    .admin-table td > small,
    .admin-table td > strong,
    .admin-table td > span {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .admin-table td > .status-pill {
        width: fit-content !important;
    }

    .admin-table td > .badge {
        width: fit-content !important;
        justify-self: start;
    }

    .table-actions,
    .table-actions.justify-content-end {
        justify-content: flex-start !important;
    }

    .pagination-row {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .pagination-row .pagination {
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 0.15rem;
    }

    .profile-summary {
        text-align: left !important;
        align-items: flex-start !important;
    }

    .profile-summary .status-pill {
        align-self: flex-start;
    }

    .profile-quick-meta .d-flex {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .detail-panel {
        padding: 1rem !important;
    }

    .detail-panel h2 {
        align-items: flex-start !important;
        line-height: 1.35;
    }

    .modal-dialog {
        margin: 0.75rem !important;
    }

    .modal-body,
    .modal-header,
    .modal-footer {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }
}

@media (max-width: 575px) {
    .admin-topbar,
    [data-theme="light"] .admin-topbar,
    [data-theme="dark"] .admin-topbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .topbar-context strong {
        font-size: 0.8rem;
    }

    .topbar-context span {
        font-size: 0.66rem;
    }

    .topbar-actions {
        gap: 0.35rem !important;
    }

    .topbar-actions .icon-button,
    .sidebar-toggle {
        width: 36px !important;
        height: 36px !important;
    }

    .admin-user strong {
        display: none;
    }

    .admin-user i {
        font-size: 0.7rem;
    }

    .admin-content {
        padding: 0.75rem !important;
    }

    .admin-page-heading .btn,
    .command-actions .btn,
    .export-actions .btn,
    .heading-actions .btn,
    .form-actions .btn,
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .admin-page-heading > div:not(:first-child) {
        width: 100%;
    }

    .export-actions,
    .heading-actions,
    .command-actions,
    .form-actions,
    .modal-footer {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .export-form {
        width: 100%;
    }

    .heading-actions form {
        width: 100%;
    }

    .batch-export-actions,
    .batch-export-actions form {
        width: 100%;
    }

    .batch-export-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .records-summary {
        grid-template-columns: 1fr !important;
    }

    .records-summary article,
    .dashboard-card {
        padding: 0.9rem !important;
    }

    .admin-table td,
    .admin-table > :not(caption) > * > * {
        grid-template-columns: 1fr;
        gap: 0.18rem !important;
    }

    .admin-table td::before {
        font-size: 0.64rem;
    }

}

/* Premium Record Payment & Payment History Modal Styles */
#paymentModal .modal-content,
#paymentHistoryModal .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16);
    background: var(--surface);
    overflow: hidden;
}

#paymentModal .modal-header,
#paymentHistoryModal .modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 1.75rem;
    background: var(--surface-soft);
}

#paymentModal .modal-title,
#paymentHistoryModal .modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

#paymentModal .modal-body,
#paymentHistoryModal .modal-body {
    padding: 1.75rem;
}

#paymentModal .modal-dialog {
    max-width: min(1160px, calc(100vw - 1.25rem));
}

.payment-modal-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    width: 100%;
    overflow: hidden;
}

.payment-modal-column {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

.payment-modal-details,
.payment-modal-actions {
    display: grid;
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
}

.payment-modal-details {
    z-index: 1;
}

.payment-modal-actions {
    z-index: 2;
    background: var(--surface);
    border-radius: 12px;
}

.payment-modal-details .payment-steps {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.payment-modal-details .payment-student-card,
.payment-modal-details .payment-summary-grid,
.payment-modal-details .payment-total-card {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
}

#paymentModal .payment-modal-details .payment-summary-grid {
    grid-template-columns: 1fr;
    gap: 0.45rem;
}

#paymentModal .payment-modal-details .payment-student-card {
    padding: 0.64rem 0.8rem;
    gap: 0.75rem;
    border-left-width: 4px;
    border-radius: 10px;
}

#paymentModal .payment-modal-details .student-avatar-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 0.92rem;
}

#paymentModal .payment-modal-details .student-details-badge strong {
    font-size: 0.94rem;
}

#paymentModal .payment-modal-details .student-details-badge span {
    font-size: 0.68rem;
    white-space: normal;
}

#paymentModal .payment-modal-details .payment-step {
    min-height: 38px;
    padding: 0.5rem 0.72rem;
    border-radius: 10px;
    gap: 0.55rem;
}

#paymentModal .payment-modal-details .payment-step span {
    font-size: 0.76rem;
    gap: 0.45rem;
}

#paymentModal .payment-modal-details .payment-step span i {
    font-size: 0.8rem;
}

#paymentModal .payment-modal-details .payment-step strong {
    flex: 0 0 auto;
    font-size: 0.78rem;
    white-space: nowrap;
}

#paymentModal .payment-modal-details .next-payment-tag,
#paymentModal .payment-modal-details .due-date-tag,
#paymentModal .payment-modal-details .blocked-tag,
#paymentModal .payment-modal-details .penalty-included-tag {
    padding: 0.05rem 0.32rem;
    font-size: 0.64rem;
}

#paymentModal .payment-modal-details .payment-total-card {
    padding: 0.7rem 0.85rem;
    border-radius: 11px;
}

#paymentModal .payment-modal-details .payment-total-label span {
    font-size: 0.84rem;
}

#paymentModal .payment-modal-details .payment-total-label i {
    font-size: 0.92rem;
}

#paymentModal .payment-modal-details .payment-total-amount {
    font-size: 0.98rem;
}

.payment-schedule-slot .installment-schedule-preview {
    margin-top: 0;
}

.payment-fields-panel {
    padding: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.payment-fields-panel > .mt-3:first-child {
    margin-top: 0 !important;
}

/* Premium Student Card Badge */
.payment-student-card {
    background: linear-gradient(135deg, rgba(7, 31, 59, 0.03) 0%, rgba(37, 111, 143, 0.03) 100%);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    border-radius: 14px;
    padding: 1.1rem 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.01);
}

.student-avatar-badge {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(7, 31, 59, 0.15);
}

.student-details-badge {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.student-details-badge strong {
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.student-details-badge span {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Payment Summary Grid */
.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    min-width: 0;
}

@media (max-width: 768px) {
    .payment-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1099.98px) {
    .payment-modal-layout {
        grid-template-columns: 1fr;
    }
}

.payment-step {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    background: var(--surface);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    overflow: hidden;
}

.payment-step:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
}

.payment-step span {
    font-weight: 700;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    min-width: 0;
    flex: 1 1 9rem;
    flex-wrap: wrap;
    line-height: 1.35;
}

.payment-step span i {
    font-size: 1rem;
}

.payment-step strong {
    font-size: 0.95rem;
    font-weight: 800;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: right;
}

.payment-step .next-payment-tag,
.payment-step .due-date-tag,
.payment-step .blocked-tag,
.payment-step .penalty-included-tag {
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
}

/* Paid & Due status styling */
.payment-step.is-paid {
    background: rgba(21, 128, 61, 0.02);
    border-color: rgba(21, 128, 61, 0.12);
    color: #15803d;
}

.payment-step.is-paid span {
    color: #166534;
}

.payment-step.is-paid strong {
    color: #15803d;
}

.payment-step.is-due {
    background: rgba(36, 84, 214, 0.02);
    border-color: rgba(36, 84, 214, 0.12);
}

.payment-step.is-due strong {
    color: var(--primary);
}

.payment-step.is-pending {
    background: var(--surface-soft);
    border-color: var(--border);
    color: var(--muted);
    opacity: 0.8;
}

.payment-step.is-pending span {
    color: var(--muted);
}

.payment-step.penalty-breakdown {
    grid-column: span 2;
    background: rgba(245, 158, 11, 0.02);
    border-color: rgba(245, 158, 11, 0.12);
    color: #92400e;
    border-style: dashed;
}

.payment-step.penalty-breakdown span {
    color: #92400e;
}

@media (max-width: 768px) {
    .payment-step.penalty-breakdown {
        grid-column: span 1;
    }
}

/* Outstanding Balance Grand Total Card */
.payment-total-card {
    background: linear-gradient(135deg, #071f3b 0%, #0c2b54 100%);
    color: #fff;
    border-radius: 14px;
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    box-shadow: 0 10px 24px rgba(7, 31, 59, 0.2);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease;
    min-width: 0;
}

.payment-total-card:hover {
    transform: translateY(-1px);
}

.installment-schedule-preview {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    min-width: 0;
    overflow: hidden;
}

.installment-schedule-preview--empty {
    min-height: 132px;
    align-content: center;
}

.installment-schedule-preview__header,
.installment-schedule-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.installment-schedule-preview__header strong {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text);
    font-weight: 800;
}

.installment-schedule-preview__header span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.installment-schedule-preview__rows {
    display: grid;
    gap: 0.45rem;
}

.installment-schedule-row {
    display: grid;
    grid-template-columns: minmax(72px, 0.75fr) minmax(118px, 1fr) auto;
    min-height: 38px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field-muted);
    min-width: 0;
}

.installment-schedule-row.is-overdue {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.07);
}

.installment-schedule-row span {
    display: grid;
    gap: 0.05rem;
    color: var(--text);
    font-weight: 800;
}

.installment-schedule-row small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.installment-schedule-row strong {
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.installment-schedule-row__amount {
    display: grid;
    gap: 0.05rem;
    justify-items: end;
    text-align: right;
}

.installment-schedule-row__amount small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.installment-schedule-row__amount .installment-schedule-row__penalty {
    color: #92400e;
}

.installment-status {
    min-width: 92px;
    padding: 0.2rem 0.48rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.installment-status-paid,
.installment-status-advance_paid {
    color: #15803d;
    background: rgba(21, 128, 61, 0.1);
}

.installment-status-partial {
    color: #2454d6;
    background: rgba(36, 84, 214, 0.1);
}

.installment-status-overdue {
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.1);
}

.installment-status-pending {
    color: var(--muted);
    background: rgba(96, 112, 132, 0.12);
}

.payment-total-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.payment-total-label i {
    font-size: 1.4rem;
    color: var(--accent);
}

.payment-total-label span {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.payment-total-amount {
    font-size: 1.45rem;
    font-weight: 800;
    font-family: var(--font-sans);
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: right;
}

/* Form Action layout */
#paymentModal label {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 0.4rem;
    display: inline-block;
}

#paymentModal .form-control,
#paymentModal .form-select {
    border-radius: 10px;
    padding: 0.75rem 1.1rem;
    border: 1px solid var(--border);
    font-weight: 600;
    background-color: var(--surface-soft);
    color: var(--text);
    transition: all 0.2s ease;
}

#paymentModal .form-control:focus,
#paymentModal .form-select:focus {
    border-color: var(--primary);
    background-color: var(--surface);
    box-shadow: 0 0 0 4px rgba(36, 84, 214, 0.12);
}

#paymentModal .form-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Payment History Modal Table Design */
#paymentHistoryModal .table-responsive {
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

#paymentHistoryModal table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

#paymentHistoryModal thead th {
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 800;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--border);
    padding: 1.1rem 1.25rem;
}

#paymentHistoryModal tbody td {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

#paymentHistoryModal tbody tr:last-child td {
    border-bottom: none;
}

#paymentHistoryModal tbody tr {
    transition: background 0.15s ease;
}

#paymentHistoryModal tbody tr:hover td {
    background: rgba(36, 84, 214, 0.03);
}

/* Style badges inside history table */
#paymentHistoryModal .badge {
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
}

#paymentHistoryModal .badge.bg-dark {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Prevent body scrolling and background layout scroll when modal is open */
html.modal-open,
body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
}

body.modal-open .admin-shell,
body.modal-open .admin-sidebar,
body.modal-open .admin-main,
body.modal-open .admin-content {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
}

/* ==========================================================================
   EXTRA GLOBAL RESPONSIVENESS AND MOBILE/TABLET REFINEMENTS
   ========================================================================== */

/* Intermediate screens (min-width: 992px) and (max-width: 1200px) */
@media (max-width: 1200px) and (min-width: 992px) {
    .filter-bar {
        grid-template-columns: 1fr 1fr auto auto !important;
        gap: 0.6rem !important;
        padding: 0.75rem !important;
    }
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Tablets and below (max-width: 991px) */
@media (max-width: 991px) {
    .admin-topbar {
        grid-template-columns: auto minmax(0, 1fr) auto !important;
    }
    .topbar-context {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
    }
}

/* Mobile Screens (max-width: 575px) */
@media (max-width: 575px) {
    /* Topbar adjustments - hide profile text, show only avatar circle */
    .admin-user strong,
    .admin-user i {
        display: none !important;
    }
    .admin-user {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    .admin-user span {
        width: 36px !important;
        height: 36px !important;
        line-height: 36px !important;
        font-size: 0.95rem !important;
        margin: 0 !important;
    }

    /* Modal dialog spacing adjustments */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    .modal-content {
        border-radius: 14px !important;
    }
    .modal-body {
        padding: 1.1rem !important;
    }
    .modal-header {
        padding: 1.1rem !important;
    }
    .modal-footer {
        padding: 1.1rem !important;
        flex-direction: column-reverse;
        gap: 0.5rem;
        align-items: stretch;
    }
    .modal-footer .btn {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Record payment modal visual cards mobile adjustments */
    .payment-student-card {
        padding: 0.85rem 1rem !important;
        gap: 0.85rem !important;
        margin-bottom: 1.1rem !important;
        flex-direction: column;
        align-items: flex-start;
    }
    .student-avatar-badge {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.2rem !important;
    }
    .student-details-badge strong {
        font-size: 1.1rem !important;
    }
    .student-details-badge span {
        font-size: 0.8rem !important;
        white-space: normal;
    }
    .payment-summary-grid {
        gap: 0.65rem !important;
        margin-bottom: 1.1rem !important;
    }
    .payment-step {
        padding: 0.85rem 1rem !important;
        border-radius: 10px !important;
    }
    .payment-step span {
        font-size: 0.86rem !important;
        gap: 0.5rem !important;
    }
    .payment-step strong {
        font-size: 0.86rem !important;
    }
    .payment-total-card {
        padding: 1rem 1.25rem !important;
        margin-bottom: 1.1rem !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .payment-total-amount {
        font-size: 1.25rem !important;
        align-self: flex-end;
    }
    .installment-schedule-row {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }
    .installment-schedule-row__amount {
        justify-items: start;
        text-align: left;
    }
    .installment-status {
        justify-self: start;
    }
    #paymentHistoryModal thead th {
        padding: 0.85rem 1rem !important;
        font-size: 0.72rem !important;
    }
    #paymentHistoryModal tbody td {
        padding: 0.85rem 1rem !important;
        font-size: 0.82rem !important;
    }
}

/* Premium sleek scrollbars for horizontal scroll containers */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: var(--surface-soft);
}
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(7, 31, 59, 0.15);
    border-radius: 99px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(7, 31, 59, 0.35);
}
[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Sleek custom scrollbars for navigation and sidebar */
.admin-nav::-webkit-scrollbar,
.admin-sidebar::-webkit-scrollbar {
    width: 5px;
}

.admin-nav::-webkit-scrollbar-track,
.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-nav::-webkit-scrollbar-thumb,
.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(7, 31, 59, 0.15);
    border-radius: 99px;
}

.admin-nav::-webkit-scrollbar-thumb:hover,
.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(7, 31, 59, 0.3);
}

[data-theme="dark"] .admin-nav::-webkit-scrollbar-thumb,
[data-theme="dark"] .admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .admin-nav::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
