:root {
    --bg: #edf3f8;
    --panel: #fff;
    --text: #1d2e4f;
    --muted: #8ea1b7;
    --primary: #2b63d9;
    --primary2: #1f52c8;
    --border: #dde7f0;
    --shadow: 0 12px 26px rgba(59, 80, 120, .08);
}

/* Shared prefix layout for currency and other grouped form inputs. */
.input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid #dbe3ec;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    white-space: nowrap;
}

.input-group input {
    min-width: 0;
    flex: 1;
    border-radius: 0 8px 8px 0 !important;
}

.input-currency {
    min-width: 0;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid #dbe3ec;
    border-radius: 0 8px 8px 0 !important;
    background: #fff;
    color: #1e293b;
    font-size: 13px;
}

.input-currency:focus {
    outline: none;
    border-color: #8fb4f4;
    box-shadow: 0 0 0 3px rgba(45, 91, 215, .1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #edf3f8;
    color: #33415c;
    font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Keep legacy pages and Bootstrap controls on the same dashboard font. */
body,
body * {
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

body {
    font-size: 14px;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6, p, span, a, div, td, th,
input, button, select, textarea, label, table {
    font-family: inherit !important;
}

/* Normalize every table structure, including tables rendered by Bootstrap. */
table,
thead,
tbody,
tfoot,
tr,
th,
td {
    font-family: inherit !important;
}

/* Preserve the icon font used by Bootstrap Icons. */
.bi,
[class^="bi-"],
[class*=" bi-"] {
    font-family: "bootstrap-icons" !important;
}

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

.app-shell {
    display: flex;
    min-height: 100vh;
    background: #edf3f8;
}

.sidebar {
    width: 280px;
    background: #f5f7fb;
    border-right: 1px solid #dde7f0;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.2rem);
    font-weight: 800;
    color: #1b3f7f;
    padding: 0 8px 28px;
}

.brand img {
    flex-shrink: 0;
    max-width: min(42vw, 120px);
    max-height: 28px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #1f5ed8;
    color: #fff;
    font-weight: 800;
    font-size: .88rem;
    flex-shrink: 0;
}

.menu-title {
    font-size: 10px;
    letter-spacing: 1.2px;
    color: #a0aec5;
    margin: 0 8px 12px;
    text-transform: uppercase;
}

.sidebar nav {
    display: grid;
    gap: 4px;
}

.sidebar nav a {
    padding: 11px 10px;
    border-radius: 7px;
    color: #4e617d;
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: .95rem;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #e8f0ff;
    color: #1d4fc4;
    font-weight: 700;
}

.sidebar-bottom {
    margin-top: auto;
}

.user-mini {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px 6px;
    border-top: 1px solid var(--border);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #dce4ff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.user-mini strong,
.user-mini small {
    display: block;
}

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

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.year-chip,
.date-chip {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.year-chip {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 8px 14px;
    color: #166534;
    font-size: .875rem;
    font-weight: 700;
}

.top-user-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.top-user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-user-profile .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1f2937;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .9rem;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-meta strong {
    color: #1f2937;
    font-size: .95rem;
    font-weight: 700;
}

.user-meta small {
    color: #6b7280;
    font-size: .68rem;
}

.header-logout-form {
    margin: 0;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    color: #374151;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.logout-btn:hover {
    color: #111827;
}

.logout-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.logout-icon path {
    stroke: currentColor;
}

.main {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 18px 18px 40px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 18px;
}

.eyebrow {
    margin-bottom: 0;
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #99a9bc;
}

.topbar h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    color: #1f3d73;
    margin: 0;
}

.date-chip {
    background: rgba(255, 255, 255, .7);
    border: 1px solid #e1e8f1;
    border-radius: 8px;
    padding: 8px 12px;
    color: #667a91;
    font-size: .8rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 17px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: var(--shadow);
}

.stat-card strong {
    display: block;
    font-size: 22px;
    color: #28467e;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 20px;
}

.blue {
    background: #e1e7fb;
    color: #4b62c5;
}

.cyan {
    background: #def7fb;
    color: #29a9bd;
}

.yellow {
    background: #fff1cb;
    color: #d99b00;
}

.pink {
    background: #ffe0e6;
    color: #dd5f7d;
}

.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 17px 0;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-form label {
    color: #73829d;
}

.inline-form input {
    width: 100px;
}

.balance-card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 9px 14px;
    border-radius: 8px;
    color: #75839d;
}

.balance-card strong {
    color: #29457c;
    margin-left: 8px;
}

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

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.panel.large {
    min-height: 390px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.panel h3,
.panel h4,
.panel h5,
.card-title {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #29457c;
}

.panel p,
.muted {
    color: var(--muted);
    margin: 0;
}

.mini {
    min-height: 130px;
}

.money {
    display: block;
    font-size: 22px;
    color: #29457c;
    margin: 12px 0;
}

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

.search {
    display: flex;
    gap: 7px;
}

.search input {
    width: 270px;
    min-width: 0;
    max-width: 100%;
}

.btn,
.btn.primary,
.btn.secondary,
.btn.danger,
.btn.warning,
.btn.btn-primary,
.btn.btn-secondary,
.btn.btn-danger,
.btn.btn-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    min-height: 38px;
    min-width: 110px;
    cursor: pointer;
    font-weight: 700;
    font-size: .82rem;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    box-sizing: border-box;
}

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

.btn.primary:hover,
.btn.btn-primary:hover {
    background: var(--primary2);
}

.btn.secondary,
.btn.btn-secondary {
    background: #eef2fa;
    color: #526481;
}

.btn.danger,
.btn.btn-danger {
    background: #ffe5e8;
    color: #bf4054;
}

.btn.warning,
.btn.btn-warning {
    background: #fff3cd;
    color: #8a6d1c;
}

.btn.full {
    width: 100%;
    margin-top: 16px;
}

.btn-sm,
.btn.btn-sm {
    min-height: 32px;
    min-width: 88px;
    padding: .42rem .75rem;
    font-size: .78rem;
}

input,
select,
textarea {
    font: inherit;
    border: 1px solid #dfe6f1;
    border-radius: 7px;
    background: #fff;
    color: #34445f;
    padding: .5rem .7rem;
    outline: none;
    font-size: .875rem;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #91a4e8;
    box-shadow: 0 0 0 3px #edf1ff;
}

.form-control-sm,
.form-select-sm {
    min-height: 32px;
    padding: .35rem .6rem;
    font-size: .8rem;
}

.form-label {
    font-size: .75rem;
}

.label,
label {
    display: grid;
    gap: 6px;
    color: #687894;
    font-weight: 600;
}

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

.table-panel {
    overflow: auto;
}

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

th {
    text-align: left;
    color: #8b99b1;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    background: #fafbfd;
}

th,
td {
    padding: 10px 11px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table-sm th,
.table-sm td {
    padding: .5rem .6rem;
}

.td small,
td small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.actions form {
    margin: 0;
}

.actions button,
.link-btn {
    border: 0;
    background: none;
    color: #d05b69;
    cursor: pointer;
    padding: 0;
}

.link,
.actions a {
    color: #4661c6;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2fa;
    color: #64738e;
    font-size: 10px;
    font-weight: 800;
}

.badge.green {
    background: #e4f8ef;
    color: #23835d;
}

.badge.red {
    background: #ffe8eb;
    color: #bf4054;
}

.badge.gray {
    background: #edf0f4;
    color: #788397;
}

.empty {
    text-align: center;
    color: #9aa8bc;
    padding: 35px;
}

.pagination {
    padding-top: 14px;
}

.global-per-page-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin: 0 auto 16px 0;
    color: #46618e;
    font-size: .9rem;
}

.global-per-page-filter label {
    margin: 0;
    font-weight: 500;
}

.global-per-page-filter .per-page-select {
    width: 82px;
}

.global-data-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 340px;
    max-width: 100%;
    flex: 0 0 340px;
    margin: 0 0 14px;
}

.global-data-search .global-search-input {
    min-width: 0;
    width: 260px;
    max-width: 260px;
    flex: 0 0 260px;
    height: 38px;
    border: 1px solid #d8e2f1;
    border-radius: 8px;
    padding: 0 12px;
    color: #334155;
    background: #fff;
    outline: none;
}

.global-data-search .global-search-input:focus {
    border-color: #5b8def;
    box-shadow: 0 0 0 3px rgba(91, 141, 239, .12);
}

.global-data-search .global-search-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 38px;
    border: 1px solid #2d5bd7;
    border-radius: 8px;
    padding: 0 16px;
    background: #2d5bd7;
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.global-data-search .global-search-button:hover {
    border-color: #244db8;
    background: #244db8;
    transform: translateY(-1px);
}

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

.page-actions .global-data-search {
    flex: 0 1 280px;
    width: 280px;
    max-width: 100%;
    margin: 0;
    gap: 10px;
}

.page-actions .global-data-search .global-search-input {
    width: 270px;
    max-width: 100%;
    flex: 1 1 auto;
    height: clamp(38px, 2vw, 44px);
    font-size: clamp(0.82rem, 0.76rem + 0.2vw, 0.96rem);
}

.page-actions .global-data-search .global-search-button,
.page-actions > .btn.primary {
    height: clamp(38px, 2vw, 44px);
    padding: 0 18px;
    font-size: clamp(0.82rem, 0.76rem + 0.2vw, 0.96rem);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .global-data-search {
        width: 100%;
        flex-basis: 100%;
    }

    .global-data-search .global-search-input {
        width: auto;
        max-width: none;
        flex: 1 1 auto;
    }

    .page-actions .global-data-search {
        flex-basis: 100%;
        width: 100%;
    }
}

.form-panel {
    max-width: 1100px;
}

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

.payment-proof-field {
    min-width: 0;
}

.payment-reference-field,
.payment-proof-field {
    align-content: start;
    min-width: 0;
}

.payment-reference-field input,
.payment-proof-field input[type="file"] {
    width: 100%;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    padding: .38rem .55rem;
    font-size: .82rem;
    line-height: 1.4;
}

.payment-reference-field input {
    padding: .5rem .7rem;
}

.payment-proof-field small {
    display: block;
    margin-top: -1px;
    color: #687894;
    font-size: .75rem;
    font-weight: 400;
    line-height: 1.35;
}

.span-2 {
    grid-column: span 2;
}

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

.section-title {
    margin: 26px 0 12px;
    color: #29457c;
}

/* Penyesuaian Journal & Item Row */
div.item-row,
.journal-row {
    display: grid;
    grid-template-columns: 1.2fr 2fr .65fr 1fr .8fr 30px;
    gap: 7px;
    margin-bottom: 8px;
}

.journal-row {
    grid-template-columns: 1.6fr 1fr 1fr 1.6fr 30px;
}

/* Memastikan elemen tr tetap mempertahankan model tabel browser */
tr.item-row {
    display: table-row !important;
}

tr.item-row td {
    display: table-cell !important;
}

.danger-link {
    border: 0;
    background: none;
    color: #c85162;
    font-size: 20px;
    cursor: pointer;
}

.invoice-total {
    margin: 18px 0;
    padding: 14px;
    background: #f7f9fd;
    border-radius: 8px;
    text-align: right;
}

.invoice-total strong {
    font-size: 20px;
    color: #29457c;
    margin-left: 15px;
}

totals-row {
    display: flex;
    justify-content: flex-end;
    gap: 25px;
    padding: 15px 0;
    color: #50617e;
}

.invoice-paper {
    max-width: 1000px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 18px;
}

.invoice-header h2 {
    margin: 2px 0;
    color: #29457c;
}

.two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.two-col strong,
.two-col small {
    display: block;
}

.two-col small {
    color: #9aa8bc;
    margin-top: 5px;
}

.invoice-summary {
    margin: 18px 0 0 auto;
    max-width: 330px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.invoice-summary strong {
    text-align: right;
    color: #29457c;
}

.tabs {
    display: flex;
    gap: 5px;
}

.tabs a {
    padding: 8px 13px;
    border-radius: 7px;
    color: #74829b;
}

.tabs a.active {
    background: #fff;
    color: #4661c6;
    font-weight: 700;
    border: 1px solid var(--border);
}

.alert {
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: .3s;
}

.alert.success {
    background: #e7f8f0;
    color: #267b59;
}

.alert.danger {
    background: #ffe9ec;
    color: #b33f52;
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}

.error-text {
    color: #c34f5d;
}

.info-banner {
    padding: 13px 15px;
    background: #eaf0ff;
    border: 1px solid #dbe4ff;
    border-radius: 8px;
    color: #53688e;
    margin-bottom: 15px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #edf2ff, #f7f9fd);
}

.login-card {
    width: min(410px, 92vw);
    background: #fff;
    padding: 34px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(46, 68, 110, .12);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2e4b8e;
    font-size: 20px;
}

.login-card form {
    display: grid;
    gap: 8px;
    margin-top: 24px;
}

.login-card label {
    margin-top: 8px;
}

.check {
    display: flex;
    align-items: center;
    grid-template-columns: auto 1fr;
    display: flex !important;
    gap: 8px !important;
    font-weight: 500 !important;
}

.login-hint {
    text-align: center;
    color: #a0abc0;
    font-size: 12px;
    margin-top: 20px;
}

@media(max-width: 1000px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .sidebar {
        width: 75px;
    }

    .sidebar .brand span:not(.brand-mark),
    .sidebar .menu-title,
    .sidebar nav a span,
    .sidebar-bottom .user-mini div:not(.avatar),
    .logout-btn {
        display: none;
    }

    .main {
        margin-left: 75px;
        width: calc(100% - 75px);
    }
}

@media(max-width: 650px) {
    .main {
        padding: 16px;
    }

    .stats-grid,
    .grid-3,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .page-actions,
    .filter-row {
        align-items: stretch;
        flex-direction: column;
    }

    .search input {
        min-width: 0;
        width: 100%;
    }

    div.item-row,
    .journal-row {
        grid-template-columns: 1fr 1fr;
    }

    .top-actions {
        display: none;
    }
}

@media print {
    .sidebar,
    .topbar,
    .form-actions {
        display: none !important;
    }

    /* Shared responsive rules for phones, tablets, and compact laptop/tablet widths. */
    @media (max-width: 1024px) {
        .main {
            min-width: 0;
            overflow-x: hidden;
        }

        .page-actions,
        .filter-row,
        .panel-head,
        .table-toolbar {
            gap: 12px;
            flex-wrap: wrap;
        }

        .table-panel {
            overflow-x: auto;
        }

        .table-panel table {
            min-width: 720px;
        }

        .form-grid,
        .grid-2,
        .grid-3 {
            gap: 14px;
        }
    }

    @media (max-width: 767px) {
        .main {
            padding: 14px 12px 28px;
        }

        .topbar {
            align-items: flex-start;
            flex-wrap: wrap;
            gap: 12px;
        }

        .topbar h1 {
            font-size: 1.45rem;
        }

        .top-actions {
            width: 100%;
            justify-content: flex-start;
            gap: 8px;
        }

        .date-chip,
        .year-chip {
            font-size: .72rem;
            padding: 6px 9px;
        }

        .page-actions,
        .filter-row,
        .panel-head {
            align-items: stretch;
            flex-direction: column;
        }

        .page-actions > *,
        .filter-row > *,
        .panel-head > * {
            max-width: 100%;
        }

        .search,
        .transaction-search {
            width: 100%;
            max-width: none;
        }

        .search input,
        .transaction-search input {
            flex: 1 1 auto;
            width: auto;
        }

        .page-actions .btn,
        .page-actions button,
        .filter-row .btn {
            width: 100%;
        }

        .panel {
            border-radius: 10px;
        }

        .panel,
        .card-body {
            padding-left: 14px;
            padding-right: 14px;
        }

        .pagination {
            justify-content: center;
            gap: 6px;
        }

        .pagination .page-nav {
            min-width: 70px;
        }

        input.form-control,
        select.form-select,
        textarea.form-control {
            max-width: 100%;
        }
    }

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

        .top-actions {
            flex-wrap: wrap;
        }

        .top-user-block,
        .profile-trigger {
            max-width: 100%;
        }

        .table-panel table {
            min-width: 640px;
        }

        .pagination .page-nav span:not([aria-hidden]),
        .pagination .page-number {
            font-size: .75rem;
        }
    }

    .main {
        margin: 0;
        width: 100%;
        padding: 0;
    }

    .panel {
        border: 0;
        box-shadow: none;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.pagination .page-nav,
.pagination .page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 42px;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 700;
    transition: all .2s ease;
    padding: 0 12px;
    line-height: 1;
    border: 1px solid #d8e2f1;
    background: #fff;
    color: #93a4bc;
    box-shadow: none;
}

.pagination .page-nav {
    min-width: 104px;
    padding: 0 20px;
    gap: 6px;
    font-size: .85rem;
}

.pagination .page-nav:hover,
.pagination .page-number:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(45, 91, 215, .12);
    border-color: #b9ccea;
    color: #466bc1;
}

.pagination .page-nav.disabled {
    border-color: #d8e2f1;
    background: #fff;
    color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

.pagination .page-number {
    min-width: 42px;
    width: 42px;
    padding: 0;
    font-size: .95rem;
}

.pagination .page-number.active {
    border-color: #3568dc;
    background: #3568dc;
    color: #fff;
    box-shadow: 0 10px 22px rgba(53, 104, 220, .24);
}

.pagination .page-number.active:hover {
    transform: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    padding: .35rem .75rem;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .02em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.status-badge.status-paid {
    background: #e8f7ee;
    color: #198754;
    border-color: #cfe9d9;
    padding: .42rem .9rem;
    font-size: .86rem;
    font-weight: 700;
}

.status-badge.status-partially-paid {
    background: #fff4d9;
    color: #d97706;
    border-color: #f6e0ab;
}

.status-badge.status-open {
    background: #eaf2ff;
    color: #2563eb;
    border-color: #cfe0ff;
}

.status-badge.status-issued {
    background: #f1f3f5;
    color: #6c757d;
    border-color: #e2e6ea;
}

.status-badge.status-cancelled {
    background: #fdecef;
    color: #dc3545;
    border-color: #f7c7ce;
}

.status-badge.status-default {
    background: #f4f6f8;
    color: #495057;
    border-color: #dde2e8;
}

.bank-page.compact-layout .panel {
    padding: 1rem;
}

.bank-page.compact-layout .card-title {
    margin: 0 0 .75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #29457c;
}

.bank-page.compact-layout .form-grid {
    gap: .5rem;
}

.bank-page.compact-layout .form-grid .mb-2 {
    margin-bottom: .5rem !important;
}

.bank-page.compact-layout .form-label {
    font-size: .75rem;
}

.bank-page.compact-layout .form-control-sm,
.bank-page.compact-layout .form-select-sm {
    padding-top: .35rem;
    padding-bottom: .35rem;
}

.bank-page.compact-layout .bank-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bank-page.compact-layout .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bank-page.compact-layout .table th,
.bank-page.compact-layout .table td {
    padding: .5rem .6rem;
}

.bank-page.compact-layout .table-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.bank-page.compact-layout .btn,
.bank-page.compact-layout .btn-sm {
    min-height: 32px;
    padding: .45rem .8rem;
    font-size: .78rem;
    border-radius: 7px;
}

.bank-page.compact-layout .btn-primary,
.bank-page.compact-layout .btn-danger,
.bank-page.compact-layout .btn-warning,
.bank-page.compact-layout .btn-secondary {
    min-width: 90px;
}

.bank-page.compact-layout .modal-header,
.bank-page.compact-layout .modal-footer {
    padding: .75rem 1rem;
}

.bank-page.compact-layout .modal-body {
    padding: 1rem;
}

.bank-page.compact-layout .modal-title {
    font-size: 1rem;
}

.bank-page.compact-layout .mt-3 {
    margin-top: 0.75rem !important;
}

@media(max-width: 760px) {
    .bank-page.compact-layout .bank-form-actions,
    .bank-page.compact-layout .table-action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .bank-page.compact-layout .btn,
    .bank-page.compact-layout .btn-sm {
        width: 100%;
        min-width: 0;
    }

    .bank-page.compact-layout .form-grid {
        grid-template-columns: 1fr;
    }

    .bank-page.compact-layout .panel-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

        :root {
            --sidebar-width: 280px;
            --bg-color: #f2f7ff;
            --app-padding-x: clamp(16px, 2vw, 30px);
            --app-padding-y: clamp(18px, 2.2vw, 30px);
            --font-sm: clamp(0.75rem, 0.6rem + 0.35vw, 0.875rem);
            --font-md: clamp(0.88rem, 0.76rem + 0.35vw, 0.97rem);
            --font-lg: clamp(1rem, 0.9rem + 0.4vw, 1.15rem);
            --font-xl: clamp(1.4rem, 1.1rem + 0.9vw, 1.8rem);
            --menu-gap: clamp(4px, 0.45vw, 8px);
            --menu-item-pad-y: clamp(9px, 0.75vw, 12px);
            --menu-item-pad-x: clamp(10px, 1vw, 16px);
        }

        html {
            font-size: 16px;
        }

        body {
            background-color: var(--bg-color);
            font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            margin: 0;
            padding: 0;
            min-width: 320px;
        }

        .app-shell {
            display: flex;
            min-height: 100vh;
            width: 100%;
        }

        /* Sidebar Styling */
        .sidebar {
            width: var(--sidebar-width);
            background: #ffffff;
            border-right: 1px solid #e5e7eb;
            display: flex;
            flex-direction: column;
            padding: clamp(18px, 1.6vw, 24px) clamp(12px, 1vw, 16px);
            flex-shrink: 0;
            overflow-y: auto;
            overflow-x: hidden;
            transition: transform 0.3s ease-in-out;
        }

        .sidebar .brand {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
            font-size: clamp(1rem, 0.88rem + 0.42vw, 1.28rem);
            font-weight: 700;
            color: #2563eb;
            margin-bottom: clamp(18px, 2vw, 28px);
            padding-left: 12px;
        }

        .sidebar-brand-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            min-width: 0;
        }

        .sidebar-close {
            display: none;
            border: 0;
            background: transparent;
            color: #64748b;
            font-size: 1.6rem;
            line-height: 1;
            padding: 2px 6px;
            cursor: pointer;
        }

        .sidebar .brand img {
            flex-shrink: 0;
            max-width: min(42vw, 120px);
            max-height: 28px;
            width: auto;
            height: auto;
            object-fit: contain;
        }

        .sidebar .brand span:last-child {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
        }

        .sidebar .brand-mark {
            background: #2563eb;
            color: #ffffff;
            border-radius: 8px;
            padding: 4px 10px;
            font-size: 1rem;
            flex-shrink: 0;
        }

        .sidebar .menu-title {
            font-size: 0.74rem;
            font-weight: 700;
            color: #9ca3af;
            letter-spacing: 0.05em;
            margin-bottom: 12px;
            padding-left: 12px;
        }

        .sidebar nav {
            display: flex;
            flex-direction: column;
            gap: var(--menu-gap);
        }

        .sidebar nav a {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: var(--menu-item-pad-y) var(--menu-item-pad-x);
            color: #4b5563;
            text-decoration: none;
            border-radius: 8px;
            font-size: var(--font-md);
            font-weight: 500;
            transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
            position: relative;
            margin: 4px 12px;
            padding: 10px 16px;
            border-radius: 10px;
        }

        .sidebar nav a:hover {
            background-color: #f3f4f6;
            color: #111827;
            transform: translateX(2px);
        }

        .sidebar nav a.active {
            background-color: #435ebe;
            color: #ffffff;
            font-weight: 600;
            box-shadow: 0 8px 18px rgba(67, 94, 190, 0.22);
        }

        .nav-group {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .nav-dropdown {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .nav-dropdown-row {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .nav-main-link {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
            padding: var(--menu-item-pad-y) var(--menu-item-pad-x);
            color: #4b5563;
            text-decoration: none;
            border-radius: 8px;
            font-size: var(--font-md);
            font-weight: 500;
            transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
            position: relative;
            margin: 0;
            padding: 10px 16px;
            border-radius: 10px;
        }

        .sidebar nav a .nav-icon,
        .nav-main-link .nav-icon {
            width: 22px;
            height: 22px;
            text-align: center;
            flex-shrink: 0;
        }

        .nav-main-link:hover {
            background-color: #f3f4f6;
            color: #111827;
            transform: translateX(2px);
        }

        .nav-main-link.active {
            background-color: #435ebe;
            color: #ffffff;
            font-weight: 600;
            box-shadow: 0 8px 18px rgba(67, 94, 190, 0.22);
        }

        .nav-dropdown-toggle {
            width: 32px;
            height: 32px;
            border: 1px solid #e5e7eb;
            background: #ffffff;
            color: #4b5563;
            border-radius: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
            flex-shrink: 0;
            margin-left: auto;
        }

        .nav-dropdown-toggle:hover {
            background: #f3f4f6;
            transform: scale(1.04);
        }

        .nav-dropdown-toggle i {
            transition: transform 0.25s ease;
        }

        .nav-dropdown.open .nav-dropdown-toggle {
            background: #eef2ff;
            border-color: #c7d2fe;
            color: #243b8f;
            box-shadow: 0 6px 14px rgba(67, 94, 190, 0.12);
        }

        .nav-dropdown.open .nav-dropdown-toggle i {
            transform: rotate(180deg);
        }

        .nav-submenu {
            display: grid;
            grid-template-rows: 0fr;
            margin-left: 8px;
            padding-left: 12px;
            border-left: 1px solid #e5e7eb;
            overflow: hidden;
            transition: grid-template-rows 0.28s ease, opacity 0.2s ease, margin-top 0.2s ease, padding-top 0.2s ease;
            opacity: 0;
        }

        .nav-submenu > div {
            min-height: 0;
            overflow: hidden;
        }

        .nav-dropdown.open .nav-submenu {
            grid-template-rows: 1fr;
            opacity: 1;
            margin-top: 4px;
            padding-top: 4px;
        }

        .nav-submenu a {
            display: block;
            padding: 8px 12px;
            font-size: 0.85rem;
            border-radius: 6px;
            color: #5b6475;
            text-decoration: none;
            transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
            position: relative;
        }

        .nav-submenu a:hover {
            background: #f3f4f6;
            color: #111827;
            transform: translateX(2px);
        }

        .nav-submenu a.active {
            background-color: #eef2ff;
            color: #253a86;
            font-weight: 700;
            padding-left: 14px;
        }

        .nav-icon {
            width: 18px;
            height: 18px;
            object-fit: contain;
            display: inline-block;
            flex-shrink: 0;
        }

        /* Main Content */
        .main {
            flex: 1;
            padding: var(--app-padding-y) var(--app-padding-x);
            min-width: 0;
        }

        .mobile-menu-toggle {
            display: none;
            border: 1px solid #dbe3ef;
            background: #ffffff;
            color: #1f3d73;
            border-radius: 9px;
            width: 40px;
            height: 40px;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }

        .tablet-navbar {
            display: none;
            align-items: center;
            gap: 12px;
            min-height: 48px;
            margin-bottom: 14px;
            padding: 8px 10px;
            background: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
        }

        .tablet-navbar > strong {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: #2563eb;
        }

        .tablet-navbar-user {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: auto;
            min-width: 0;
            color: #4b5563;
            font-size: .8rem;
        }

        .tablet-navbar-user > span:last-child {
            max-width: 140px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .sidebar-backdrop {
            display: none;
        }

        .topbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: clamp(18px, 2vw, 28px);
        }

        .topbar .eyebrow {
            font-size: 0.76rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #9ca3af;
            font-weight: 600;
        }

        .topbar h1 {
            font-size: var(--font-xl);
            font-weight: 700;
            color: #111827;
            margin: 0;
        }

        .top-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .date-chip {
            background: #ffffff;
            border: 1px solid #e5e7eb;
            padding: 8px 14px;
            border-radius: 20px;
            font-size: 0.875rem;
            color: #6b7280;
        }

        .year-chip {
            background: #dcfce7;
            border-color: #bbf7d0;
            color: #166534;
            padding: 8px 14px;
            border-radius: 20px;
            font-size: .875rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .search {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .search input {
            min-width: 300px;
        }

        .search button,
        .btn {
            border: none;
            border-radius: 10px;
            padding: 10px 16px;
            font-weight: 700;
            transition: all 0.2s ease;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
        }

        .search button,
        .btn.primary {
            background: linear-gradient(135deg, #2d5bd7 0%, #4d7ef7 100%);
            color: #ffffff;
            box-shadow: 0 8px 18px rgba(45, 91, 215, 0.22);
        }

        .per-page-select {
            width: 10%;
            min-width: 72px;
            height: 36px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            padding: 0 10px;
            background: #fff;
            color: #111827;
            outline: none;
        }

        .search button:hover,
        .btn.primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 10px 20px rgba(45, 91, 215, 0.25);
        }

        .top-user-wrapper {
            position: relative;
        }

        .profile-trigger {
            display: flex;
            align-items: center;
            gap: 10px;
            background: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 30px;
            padding: 8px 14px 8px 10px;
            cursor: pointer;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
        }

        .profile-trigger .avatar {
            width: 32px;
            height: 32px;
            background: linear-gradient(135deg, #0f172a, #475569);
            color: #ffffff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.875rem;
            flex-shrink: 0;
        }

        .profile-trigger .profile-name {
            font-size: 0.95rem;
            font-weight: 600;
            color: #1f2937;
        }

        .profile-trigger .profile-caret {
            font-size: 0.8rem;
            color: #6b7280;
            margin-left: 2px;
        }

        .profile-dropdown {
            position: absolute;
            top: calc(100% + 10px);
            right: 0;
            width: 220px;
            background: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 14px;
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
            padding: 8px 0;
            display: none;
            z-index: 20;
        }

        .top-user-wrapper.open .profile-dropdown {
            display: block;
        }

        .profile-dropdown-item {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            border: none;
            background: transparent;
            color: #1f2937;
            padding: 10px 16px;
            font-size: 0.95rem;
            text-align: left;
            cursor: pointer;
            transition: background 0.2s ease;
        }

        .profile-dropdown-item:hover {
            background: #f3f4f6;
        }

        .profile-dropdown-item i,
        .profile-dropdown-item svg {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }

        .profile-dropdown-divider {
            height: 1px;
            background: #e5e7eb;
            margin: 6px 0;
        }

        .profile-dropdown-item.logout {
            color: #374151;
        }

        .profile-dropdown-item.logout:hover {
            background: #fef2f2;
            color: #b91c1c;
        }

        /* Mazer Stats Icon helper */
        .stats-icon {
            width: 3rem;
            height: 3rem;
            border-radius: 0.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .stats-icon.purple { background-color: #9694ff; }
        .stats-icon.blue { background-color: #57caeb; }
        .stats-icon.green { background-color: #5ddab4; }
        .stats-icon.red { background-color: #ff7976; }

        @media (max-width: 1280px) {
            :root {
                --sidebar-width: 260px;
                --app-padding-x: 20px;
            }

            .sidebar {
                padding: 18px 12px;
            }

            .sidebar .brand {
                margin-bottom: 18px;
            }

            .sidebar nav {
                gap: 4px;
            }

            .sidebar nav a,
            .nav-main-link {
                padding: 9px 10px;
            }

            .nav-submenu a {
                padding: 7px 10px;
                font-size: 0.8rem;
            }

            .topbar {
                flex-direction: column;
                align-items: flex-start;
                gap: 14px;
            }

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

        @media (max-width: 1199px) and (min-width: 768px) {
            :root {
                --sidebar-width: 84px;
                --app-padding-x: 18px;
                --app-padding-y: 18px;
            }

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

            .sidebar {
                width: var(--sidebar-width);
                padding: 16px 8px 12px;
            }

            .sidebar .brand {
                justify-content: center;
                padding-left: 0;
                margin-bottom: 18px;
            }

            .sidebar .brand span:last-child,
            .sidebar .menu-title {
                display: none;
            }

            .sidebar nav {
                gap: 8px;
            }

            .sidebar nav a,
            .nav-main-link {
                justify-content: center;
                padding: 12px 8px;
                min-width: 0;
                flex: none;
                position: relative;
            }

            .sidebar nav a span,
            .nav-main-link span,
            .nav-submenu {
                display: none;
            }

            .nav-dropdown {
                position: relative;
            }

            .nav-dropdown-row {
                justify-content: center;
            }

            .nav-dropdown-toggle {
                width: 28px;
                height: 28px;
                font-size: 0.8rem;
                display: inline-flex;
            }

            .nav-dropdown.open .nav-submenu {
                display: block;
                position: absolute;
                left: calc(100% + 8px);
                top: 0;
                width: 140px;
                background: #ffffff;
                border: 1px solid #e5e7eb;
                border-radius: 10px;
                box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
                padding: 8px 6px;
                margin: 0;
                border-left: 1px solid #e5e7eb;
                opacity: 1;
                z-index: 20;
            }

            .nav-dropdown.open .nav-submenu > div {
                display: flex;
                flex-direction: column;
                gap: 4px;
            }

            .nav-submenu a {
                display: flex;
                align-items: center;
                padding: 8px 10px;
                font-size: 0.78rem;
                border-radius: 7px;
                position: relative;
            }

            .topbar {
                margin-bottom: 18px;
            }

            .main {
                padding: var(--app-padding-y) var(--app-padding-x);
            }

            .top-actions {
                flex-wrap: wrap;
                gap: 12px;
            }

            .profile-trigger {
                width: auto;
                justify-content: center;
            }

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

        @media (max-width: 834px) {
            :root {
                --sidebar-width: 80px;
                --app-padding-x: 14px;
                --app-padding-y: 16px;
            }

            @media (max-width: 991px) {
                .sidebar {
                    position: fixed;
                    inset: 0 auto 0 0;
                    z-index: 1040;
                    width: min(280px, 82vw);
                    transform: translateX(-105%);
                    transition: transform .25s ease;
                    box-shadow: 12px 0 30px rgba(15, 23, 42, .14);
                }

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

                .sidebar.mobile-open ~ .sidebar-backdrop {
                    display: block;
                    position: fixed;
                    inset: 0;
                    z-index: 1030;
                    background: rgba(15, 23, 42, .35);
                }

                .main {
                    width: 100%;
                    margin-left: 0;
                }

                .mobile-menu-toggle {
                    display: inline-flex;
                }

                .sidebar .brand span:not(.brand-mark),
                .sidebar .menu-title,
                .sidebar nav a span,
                .sidebar-bottom .user-mini div:not(.avatar),
                .logout-btn {
                    display: block;
                }

                .sidebar nav a,
                .nav-main-link {
                    justify-content: flex-start;
                }
            }

            .sidebar {
                padding-left: 8px;
                padding-right: 8px;
            }

            .topbar {
                margin-bottom: 14px;
            }

            .topbar h1 {
                font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
            }

            .top-actions {
                gap: 10px;
            }

            .date-chip {
                padding: 7px 10px;
                font-size: 0.75rem;
            }

            .profile-trigger {
                padding: 7px 10px 7px 8px;
            }

            .profile-name {
                display: none;
            }
        }

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

            .mini form {
                display: grid;
                gap: 10px;
            }

            .mini form input,
            .mini form button {
                width: 100%;
            }
        }

        @media (max-width: 576px) {
            :root {
                --sidebar-width: 64px;
                --app-padding-x: 12px;
                --app-padding-y: 14px;
            }

            .sidebar {
                padding-left: 5px;
                padding-right: 5px;
            }

            .sidebar .brand {
                justify-content: center;
                padding-left: 0;
                padding-right: 0;
            }

            .sidebar nav a,
            .nav-main-link {
                justify-content: center;
                padding-left: 8px;
                padding-right: 8px;
            }

            .nav-dropdown-row {
                gap: 2px;
            }

            .nav-dropdown-toggle {
                width: 24px;
                height: 24px;
            }

            .topbar {
                align-items: flex-start;
                flex-wrap: wrap;
                gap: 10px;
            }

            .top-actions {
                width: 100%;
                justify-content: flex-start;
            }
        }

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

            .sidebar {
                position: fixed;
                top: 0;
                left: 0;
                bottom: 0;
                width: min(280px, 85vw);
                height: 100vh;
                z-index: 1050;
                padding: 18px 10px;
                transform: translateX(-105%);
                background: #ffffff;
                box-shadow: 14px 0 32px rgba(15, 23, 42, .18);
            }

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

            .sidebar-brand-header {
                padding: 0 6px 10px;
                border-bottom: 1px solid #eef2f7;
            }

            .sidebar .brand {
                justify-content: flex-start;
                padding: 0;
                margin-bottom: 0;
            }

            .sidebar-close {
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }

            .sidebar .menu-title {
                display: block;
                padding-left: 12px;
                margin-top: 16px;
            }

            .sidebar nav a,
            .nav-main-link {
                justify-content: flex-start;
                margin: 4px 2px;
                padding: 10px 16px;
            }

            .sidebar nav a span,
            .sidebar .brand span:not(.brand-mark) {
                display: block;
            }

            .nav-dropdown-row {
                gap: 4px;
            }

            .nav-dropdown-toggle {
                margin-right: 2px;
            }

            .sidebar-backdrop {
                display: none;
                position: fixed;
                inset: 0;
                z-index: 1040;
                background: rgba(0, 0, 0, .5);
            }

            .sidebar.mobile-open ~ .sidebar-backdrop {
                display: block;
            }
        }

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

            .sidebar {
                position: fixed;
                top: 0;
                left: 0;
                bottom: 0;
                width: min(280px, 85vw);
                height: 100vh;
                z-index: 1050;
                overflow-y: auto;
                transform: translateX(-105%);
                transition: transform 0.3s ease-in-out;
                box-shadow: 14px 0 32px rgba(15, 23, 42, .18);
            }

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

            .sidebar-brand-header {
                padding: 0 6px 10px;
                border-bottom: 1px solid #eef2f7;
            }

            .sidebar .brand {
                justify-content: flex-start;
                padding: 0;
                margin-bottom: 0;
            }

            .sidebar-close {
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }

            .sidebar .menu-title,
            .sidebar nav a span,
            .sidebar .brand span:not(.brand-mark),
            .sidebar-bottom .user-mini div:not(.avatar),
            .logout-btn {
                display: block;
            }

            .sidebar nav a,
            .nav-main-link {
                justify-content: flex-start;
                margin: 4px 2px;
                padding: 10px 16px;
            }

            .sidebar-backdrop {
                display: none;
                position: fixed;
                inset: 0;
                z-index: 1040;
                background: rgba(0, 0, 0, .5);
            }

            .sidebar.mobile-open ~ .sidebar-backdrop {
                display: block;
            }

            .main {
                width: 100%;
                margin-left: 0;
            }

            .tablet-navbar {
                display: flex;
            }

            .topbar .mobile-menu-toggle {
                display: none;
            }
        }

        @media (min-width: 1200px) {
            .tablet-navbar {
                display: none;
            }
        }

        /* iPad Pro 11 landscape (CSS viewport around 1194 x 834). */
        @media (min-width: 1000px) and (max-width: 1439px)
            and (orientation: landscape) {
            :root {
                --sidebar-width: 280px;
                --app-padding-x: 18px;
                --app-padding-y: 16px;
                --menu-item-pad-y: 9px;
                --menu-item-pad-x: 12px;
            }

            .sidebar {
                position: relative;
                inset: auto;
                width: var(--sidebar-width);
                height: auto;
                min-height: 100vh;
                padding: 18px 10px;
                transform: none;
                box-shadow: none;
            }

            .sidebar-brand-header {
                padding: 0 4px 12px;
            }

            .sidebar-close,
            .sidebar-backdrop,
            .tablet-navbar {
                display: none !important;
            }

            .sidebar .brand {
                justify-content: flex-start;
                padding: 0 4px;
                margin-bottom: 18px;
            }

            .sidebar .brand span:last-child,
            .sidebar .menu-title,
            .sidebar nav a span,
            .sidebar .brand span:not(.brand-mark),
            .sidebar-bottom .user-mini div:not(.avatar),
            .logout-btn {
                display: block;
            }

            .sidebar nav {
                gap: 4px;
            }

            .sidebar nav a,
            .nav-main-link {
                justify-content: flex-start;
                min-width: 0;
                margin: 2px 0;
                padding: var(--menu-item-pad-y) var(--menu-item-pad-x);
                font-size: .88rem;
            }

            .sidebar nav a span,
            .nav-main-link span {
                min-width: 0;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .nav-submenu {
                margin-left: 8px;
            }

            .nav-submenu a {
                padding: 7px 10px;
                font-size: .78rem;
            }

            .main {
                width: calc(100% - var(--sidebar-width));
                min-width: 0;
                margin-left: 0;
                padding: var(--app-padding-y) var(--app-padding-x) 28px;
            }

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

            .topbar h1 {
                font-size: clamp(1.65rem, 2.4vw, 2rem);
            }

            .top-actions {
                gap: 8px;
            }

            .profile-trigger {
                max-width: 220px;
            }
        }

        /* Galaxy Fold 2 unfolded portrait (CSS viewport around 884 x 1104). */
        @media (min-width: 768px) and (max-width: 999px)
            and (orientation: portrait) {
            :root {
                --sidebar-width: 280px;
                --app-padding-x: 18px;
                --app-padding-y: 16px;
            }

            body.sidebar-open {
                overflow: hidden;
            }

            .sidebar {
                position: fixed;
                inset: 0 auto 0 0;
                z-index: 1050;
                width: min(var(--sidebar-width), 82vw);
                height: 100vh;
                padding: 18px 12px;
                transform: translateX(-105%);
                transition: transform .25s ease;
                box-shadow: 14px 0 32px rgba(15, 23, 42, .18);
            }

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

            .sidebar-brand-header {
                padding: 0 6px 12px;
            }

            .sidebar-close {
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }

            .sidebar .brand {
                justify-content: flex-start;
                padding: 0;
                margin-bottom: 18px;
            }

            .sidebar .menu-title,
            .sidebar nav a span,
            .sidebar .brand span:not(.brand-mark),
            .sidebar-bottom .user-mini div:not(.avatar),
            .logout-btn {
                display: block;
            }

            .sidebar nav {
                gap: 5px;
            }

            .sidebar nav a,
            .nav-main-link {
                justify-content: flex-start;
                margin: 2px 0;
                padding: 11px 14px;
                font-size: .92rem;
            }

            .sidebar nav {
                overflow: visible;
            }

            .nav-dropdown {
                position: relative;
                overflow: visible;
            }

            .nav-dropdown.open .nav-submenu {
                display: grid !important;
                position: static;
                width: auto;
                max-height: none;
                overflow: visible;
                opacity: 1;
                z-index: auto;
            }

            .nav-dropdown.open .nav-submenu > div {
                overflow: visible;
            }

            .sidebar-backdrop {
                display: none;
                position: fixed;
                inset: 0;
                z-index: 1040;
                background: rgba(15, 23, 42, .38);
            }

            .sidebar.mobile-open ~ .sidebar-backdrop {
                display: block;
            }

            .main {
                width: 100%;
                min-width: 0;
                margin-left: 0;
                padding: var(--app-padding-y) var(--app-padding-x) 28px;
            }

            .tablet-navbar {
                display: flex;
                min-height: 46px;
                margin-bottom: 12px;
            }

            .tablet-navbar .mobile-menu-toggle,
            .topbar .mobile-menu-toggle {
                display: inline-flex;
                flex: 0 0 auto;
            }

            .topbar {
                align-items: flex-start;
                gap: 12px;
                margin-bottom: 16px;
            }

            .topbar h1 {
                font-size: clamp(1.45rem, 3.5vw, 1.9rem);
            }

            .top-actions {
                width: 100%;
                flex-wrap: wrap;
                gap: 8px;
            }

            .profile-trigger {
                max-width: 100%;
            }
        }

        /* Huawei MatePad 11.5 landscape and similar tablet viewports. */
        @media (min-width: 1440px) and (max-width: 2600px)
            and (orientation: landscape) {
            :root {
                --sidebar-width: 280px;
                --app-padding-x: clamp(18px, 1.35vw, 32px);
                --app-padding-y: clamp(16px, 1.25vw, 28px);
                --menu-item-pad-y: clamp(9px, .55vw, 12px);
                --menu-item-pad-x: clamp(10px, .7vw, 14px);
            }

            .sidebar {
                width: var(--sidebar-width);
                padding: 20px 12px;
            }

            .sidebar nav {
                gap: var(--menu-gap);
            }

            .sidebar nav a,
            .nav-main-link {
                min-width: 0;
                padding: var(--menu-item-pad-y) var(--menu-item-pad-x);
                font-size: clamp(.86rem, .72rem + .18vw, .98rem);
                gap: 10px;
            }

            .sidebar nav a span,
            .nav-main-link span {
                min-width: 0;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .nav-submenu {
                margin-left: 8px;
            }

            .nav-submenu a {
                padding: 8px 12px;
                font-size: clamp(.78rem, .68rem + .12vw, .88rem);
            }

            .main {
                width: calc(100% - var(--sidebar-width));
                min-width: 0;
                margin-left: var(--sidebar-width);
                padding: var(--app-padding-y) var(--app-padding-x) 32px;
            }

            .topbar {
                gap: 18px;
                margin-bottom: clamp(16px, 1.25vw, 24px);
            }

            .topbar h1 {
                font-size: clamp(1.8rem, 1.7rem + .45vw, 2.35rem);
            }

            .panel,
            .table-panel {
                min-width: 0;
            }
        }
