:root {
    --ink: #1f2933;
    --muted: #667085;
    --line: #e6e9ef;
    --surface: #ffffff;
    --soft: #f6f7fb;
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --accent: #10b981;
}

@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/Inter-Regular.ttf") format("truetype");
}

@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/Inter-Bold.ttf") format("truetype");
}

@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/Inter-ExtraBold.ttf") format("truetype");
}

* { box-sizing: border-box; }

html {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--soft);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
    max-width: 100vw;
    align-items: stretch;
    background: linear-gradient(90deg, #111827 0 260px, var(--soft) 260px 100%);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    align-self: start;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    padding: 24px 18px;
    background: #111827;
    color: #fff;
}

.brand {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 20px;
    background: #111827;
}

.brand-mark {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-weight: 800;
    overflow: hidden;
    flex: 0 0 auto;
}

.brand-mark span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: #10b981;
    color: #fff;
}

.brand small {
    display: block;
    color: #b6c0d2;
    font-size: .78rem;
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 8px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.main {
    min-width: 0;
    grid-column: 2;
    padding: 112px 26px 26px;
}

.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 22px 26px 18px;
    background: rgba(246, 247, 251, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.topbar h1 {
    font-size: 1.7rem;
    margin: 0;
    font-weight: 760;
}

.topbar p {
    color: var(--muted);
    margin: 4px 0 0;
}

.floating-alerts {
    position: fixed;
    top: 96px;
    right: 26px;
    z-index: 1080;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.floating-alert {
    margin: 0;
    box-shadow: 0 16px 36px rgba(17, 24, 39, .16);
    pointer-events: auto;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 12px;
    white-space: nowrap;
}

.user-chip a { color: var(--muted); }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(17,24,39,.04);
    min-width: 0;
}

.panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-body { padding: 20px; }

.list-search {
    width: 280px;
}

.metric {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    min-height: 116px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 8px;
}

.metric strong {
    font-size: 1.65rem;
    line-height: 1.1;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr) minmax(240px, .8fr);
    gap: 16px;
}

.chart-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}

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

.chart-head span {
    color: var(--muted);
    font-size: .86rem;
    min-width: 0;
}

.chart-head strong {
    color: var(--ink);
    font-size: .92rem;
    line-height: 1.15;
    text-align: right;
    white-space: nowrap;
    flex: 0 0 auto;
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(58px, 1fr));
    align-items: end;
    gap: 18px;
    min-height: 210px;
}

.bar-item {
    display: grid;
    grid-template-rows: 150px auto auto;
    gap: 6px;
    min-width: 0;
    text-align: center;
}

.bar-track {
    display: flex;
    align-items: end;
    justify-content: center;
    height: 150px;
    width: 54px;
    margin: 0 auto;
    border-radius: 8px;
    background: #f1f5f9;
    overflow: hidden;
}

.bar-track span {
    display: block;
    width: 100%;
    border-radius: 8px 8px 0 0;
    background: #0f4176;
}

.bar-item small,
.bar-item em {
    display: block;
    color: var(--muted);
    font-size: .7rem;
    font-style: normal;
    white-space: nowrap;
}

.bar-item em {
    color: var(--ink);
    font-weight: 700;
}

.donut-chart {
    width: 172px;
    aspect-ratio: 1;
    margin: 8px auto 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#0f4176 0 var(--capital-share), #10b981 var(--capital-share) 100%);
}

.donut-chart > div {
    width: 104px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background: #fff;
}

.donut-chart strong,
.donut-chart span {
    display: block;
}

.donut-chart span,
.chart-legend span,
.horizontal-bars span {
    color: var(--muted);
    font-size: .82rem;
}

.chart-legend {
    display: grid;
    gap: 8px;
}

.chart-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 7px;
}

.legend-capital { background: #0f4176; }
.legend-interest { background: #10b981; }

.horizontal-bars {
    display: grid;
    gap: 18px;
    padding-top: 8px;
}

.horizontal-bars div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    align-items: center;
}

.horizontal-bars strong {
    font-size: .95rem;
}

.horizontal-bars em {
    grid-column: 1 / -1;
    height: 12px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
}

.horizontal-bars i {
    display: block;
    height: 100%;
    min-width: 6px;
    border-radius: inherit;
    background: #0f4176;
}

.horizontal-bars div:nth-child(2) i {
    background: #10b981;
}

.consultas-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.consultas-menu {
    overflow: hidden;
}

.consultas-menu .panel-header {
    padding: 10px 14px;
}

.consultas-menu .panel-header h2 {
    font-size: .95rem;
}

.consultas-menu .list-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
}

.consultas-menu .list-group-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 10px;
    color: var(--ink);
    font-size: .84rem;
    font-weight: 650;
    line-height: 1.1;
}

.consultas-menu .list-group-item i {
    font-size: .95rem;
}

.consultas-menu .list-group-item.active {
    background: #0f4176;
    border-color: #0f4176;
    color: #fff;
}

.metric.mini {
    min-height: 86px;
    padding: 14px 16px;
}

.metric.mini strong {
    font-size: 1.35rem;
}

.receipt-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.receipt-card {
    width: min(100%, 520px);
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(17, 24, 39, .08);
    overflow: hidden;
}

.receipt-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 24px;
    color: #fff;
    background: #105e3a;
}

.account-summary-card {
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(17, 24, 39, .08);
    overflow: hidden;
}

.account-summary-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    color: #fff;
    background: #105e3a;
}

.account-summary-head strong,
.account-summary-head b {
    display: block;
    font-size: 1.35rem;
}

.account-summary-head span,
.account-summary-head small {
    color: rgba(255, 255, 255, .82);
}

.account-summary-head small {
    display: block;
    width: 118px;
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: #dc2626;
    font-weight: 700;
    text-align: center;
}

.account-summary-head b {
    width: 118px;
    margin-left: auto;
    text-align: center;
}

.account-summary-card .table {
    font-size: .86rem;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 0;
}

.account-summary-card .table > :not(caption) > * > * {
    border-bottom-width: 0;
    box-shadow: none;
}

.account-summary-card thead th {
    color: #fff;
    background: #0f4176;
    border: 0;
    padding: 4px 8px;
    line-height: 1;
    vertical-align: middle;
}

.account-summary-card thead tr:first-child th {
    border-bottom: 0;
}

.account-summary-card thead tr:nth-child(2) th {
    border-top: 0;
}

.account-summary-card tbody td {
    background: #fff;
    border: 0;
    padding: 3px 8px;
    line-height: 1.1;
    vertical-align: middle;
}

.account-summary-card tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.receipt-head strong,
.receipt-head b {
    display: block;
    font-size: 1.45rem;
}

.receipt-head span,
.receipt-head small {
    color: rgba(255, 255, 255, .82);
}

.receipt-head small {
    display: block;
    width: 72px;
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: #dc2626;
    font-weight: 700;
    text-align: center;
}

.receipt-head b {
    width: 72px;
    margin-left: auto;
    text-align: center;
}

.receipt-grid {
    display: grid;
    grid-template-columns: .8fr 1.5fr;
    gap: 12px;
    padding: 20px 24px 16px;
}

.receipt-grid span,
.receipt-date span,
.receipt-total span,
.receipt-original span,
.receipt-summary span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
}

.receipt-grid strong,
.receipt-date strong {
    display: block;
    margin-top: 4px;
    font-size: 1.05rem;
}

.receipt-date {
    margin: 0 72px 22px;
    text-align: center;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.receipt-date span {
    padding: 8px;
    color: #fff;
    background: #105e3a;
    font-weight: 700;
}

.receipt-date strong {
    padding: 12px;
    background: #f1f5f9;
}

.receipt-amounts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    align-items: center;
    gap: 22px;
    padding: 0 24px 22px;
}

.receipt-total {
    padding: 0;
    text-align: left;
}

.receipt-total strong {
    display: block;
    font-size: 3.6rem;
    line-height: 1;
}

.receipt-original {
    min-width: 0;
    padding: 20px 24px;
    background: #f1f5f9;
    text-align: right;
}

.receipt-original strong {
    display: block;
    margin-top: 4px;
    color: var(--ink);
    font-size: 1.5rem;
    line-height: 1.15;
}

.receipt-card h2 {
    margin: 16px 24px 10px;
    font-size: 1rem;
}

.receipt-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.receipt-summary div {
    padding: 12px 8px;
    text-align: center;
    background: #fffde7;
}

.receipt-summary div:first-child,
.receipt-summary div:nth-child(2),
.receipt-summary div:nth-child(3),
.receipt-summary div:nth-child(4) {
    border-left: 1px solid var(--line);
}

.receipt-summary div:first-child {
    border-left: 0;
}

.receipt-summary span {
    color: #fff;
    margin: -12px -8px 10px;
    padding: 8px 4px;
    background: #0f4176;
    font-weight: 700;
}

.receipt-summary strong {
    font-size: 1.15rem;
}

.receipt-table {
    width: calc(100% - 48px);
    margin: 0 24px 20px;
    border-collapse: collapse;
    font-size: .92rem;
}

.receipt-table th {
    color: #fff;
    background: #0f4176;
    padding: 9px;
    text-align: right;
}

.receipt-table th:first-child,
.receipt-table td:first-child {
    text-align: left;
}

.receipt-table td {
    padding: 9px;
    text-align: right;
    background: #f1f5f9;
    border-bottom: 1px solid #dbe3ef;
}

.receipt-table tbody tr:last-child td {
    color: #fff;
    background: #1f2937;
    font-weight: 700;
}

.receipt-lines {
    margin: 0 24px 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.receipt-lines div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.receipt-lines div:last-child {
    border-bottom: 0;
}

.receipt-lines span {
    color: var(--ink);
}

.receipt-lines strong {
    white-space: nowrap;
}

.receipt-notes {
    margin: 0 24px 22px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.receipt-notes strong,
.receipt-notes span {
    display: block;
}

.receipt-notes span {
    color: var(--muted);
    font-size: .9rem;
    margin-top: 4px;
}

.pending-principal-row td {
    background: #e0f2fe;
    font-weight: 700;
}

.pending-payment-amount {
    width: 92px;
    min-width: 92px;
    margin-left: auto;
    margin-right: auto;
}

.pending-documents-table {
    font-size: .82rem;
}

.pending-documents-panel .table-responsive {
    max-height: none;
    overflow-y: visible;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.main .form-label,
.login-page .form-label {
    font-size: .875rem;
}

.main .form-control,
.main .form-select,
.login-page .form-control,
.login-page .form-select {
    min-height: calc(1.5em + .5rem + 2px);
    padding: .25rem .5rem;
    font-size: .875rem;
    line-height: 1.5;
}

.main .form-select,
.login-page .form-select {
    padding-right: 2rem;
    background-position: right .5rem center;
    background-size: 16px 12px;
}

.main .input-group-text,
.login-page .input-group-text {
    min-height: calc(1.5em + .5rem + 2px);
    padding: .25rem .5rem;
    font-size: .875rem;
}

.main form .btn,
.main .table .btn,
.main .panel-header .btn,
.main .payment-box .btn,
.main .receipt-actions .btn,
.login-page form .btn {
    --bs-btn-padding-y: .25rem;
    --bs-btn-padding-x: .5rem;
    --bs-btn-font-size: .875rem;
    --bs-btn-border-radius: .25rem;
}

.main .table,
.receipt-table {
    font-size: .875rem;
}

.main .table > :not(caption) > * > * {
    padding: .3rem .5rem;
}

.receipt-table th,
.receipt-table td {
    padding: .3rem .5rem;
}

.table thead th {
    background: #111827;
    color: #ffffff;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: 0;
    border-bottom-color: #111827;
}

.main .table-responsive {
    max-height: calc(100vh - 260px);
    overflow: auto;
}

.main .table thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    box-shadow: 0 1px 0 #111827;
}

.main .table thead tr:nth-child(2) th {
    top: 32px;
    z-index: 7;
}

.main .account-summary-card .table thead th,
.main .account-summary-card .table thead tr:nth-child(2) th {
    position: static;
    top: auto;
    z-index: auto;
    box-shadow: none;
}

.main .consulta-linea-table .table thead th,
.main .consulta-linea-table .table thead tr:nth-child(2) th {
    position: static;
    top: auto;
    z-index: auto;
    box-shadow: none;
}

.recuperacion-table .table {
    font-size: .78rem;
}

.recuperacion-table .table > :not(caption) > * > * {
    padding: .2rem .35rem;
}

.recuperacion-table thead th {
    text-align: center;
}

.recuperacion-table .cliente-nombre {
    white-space: nowrap;
}

.recuperacion-anual-table .table {
    font-size: .74rem;
}

.recuperacion-anual-table .table > :not(caption) > * > * {
    padding: .18rem .3rem;
    white-space: nowrap;
}

.recuperacion-anual-table thead th {
    text-align: center;
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: .78rem;
    font-weight: 650;
}

.status.pending { background: #fff7ed; color: #b45309; }
.status.done { background: #ecfdf3; color: #047857; }
.status.inactive { background: #f2f4f7; color: #667085; }

.loan-new-period > td {
    background: #f0fdf4;
    box-shadow: inset 3px 0 0 #10b981;
}

.loan-new-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #047857;
    font-size: .72rem;
    font-weight: 700;
    vertical-align: middle;
}

.compact-form .form-label {
    color: #344054;
    font-weight: 650;
    margin-bottom: 6px;
}

.compact-form .form-control,
.compact-form .form-select {
    border-color: #d7dce5;
    border-radius: 8px;
}

.balance-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 18px;
}

.balance-card span {
    color: var(--muted);
    font-size: .86rem;
}

.balance-card strong {
    display: block;
    font-size: 1.8rem;
    margin: 4px 0 14px;
}

.balance-card div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    margin-top: 10px;
}

.balance-card em {
    font-style: normal;
    font-weight: 700;
}

.payment-box {
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}

.empty-state {
    min-height: 360px;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 32px;
}

.login-page {
    min-height: 100vh;
    height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 18%, rgba(16, 185, 129, .12), transparent 32%),
        linear-gradient(135deg, #eef4f8, #f7fafc);
}

.login-card {
    width: min(1020px, 100%);
    height: min(620px, calc(100vh - 36px));
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(17,24,39,.18);
}

.login-cover {
    position: relative;
    min-height: 0;
    background:
        linear-gradient(180deg, rgba(17, 24, 39, .22), rgba(17, 24, 39, .78)),
        linear-gradient(135deg, rgba(16, 94, 58, .54), rgba(15, 65, 118, .32)),
        url("../img/imagen.jpg") center / cover no-repeat;
}

.login-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(17, 24, 39, .08), rgba(17, 24, 39, .28));
    pointer-events: none;
}

.login-cover-panel {
    position: absolute;
    z-index: 1;
    left: 28px;
    right: 28px;
    bottom: 28px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    color: #fff;
    background: rgba(17,24,39,.54);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
}

.login-cover-panel span {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 6px;
    color: rgba(255,255,255,.78);
}

.login-cover-panel strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
}

.login-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 38px 44px;
    overflow: auto;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.login-brand .login-brand-mark {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(17,24,39,.08);
}

.login-brand-mark span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: #10b981;
    color: #fff;
    font-weight: 800;
}

.login-brand-title {
    display: block;
    font-size: 1.75rem;
    line-height: 1.05;
    margin-bottom: 4px;
}

.login-form .form-label {
    color: #344054;
    font-weight: 650;
    margin-bottom: 7px;
}

.login-input {
    position: relative;
}

.login-input > i,
.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    color: #667085;
    pointer-events: none;
}

.login-input .form-control {
    min-height: calc(1.5em + .5rem + 2px);
    padding-left: 36px;
    border-color: #d7dce5;
    border-radius: 8px;
}

.login-input.input-group .form-control {
    border-radius: 8px 0 0 8px;
}

.login-password-toggle {
    width: 52px;
    border-color: #d7dce5;
    border-radius: 0 8px 8px 0;
}

.login-submit {
    min-height: calc(1.5em + .5rem + 2px);
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 12px 22px rgba(37,99,235,.22);
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
        background: var(--soft);
    }
    .sidebar {
        position: sticky;
        left: auto;
        bottom: auto;
        width: auto;
        top: 0;
        z-index: 40;
        height: auto;
        overflow: visible;
        padding: 12px 14px;
    }
    .brand {
        position: static;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
    .brand-mark {
        width: 44px;
        height: 44px;
        font-size: .9rem;
    }
    .sidebar .nav {
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
        max-width: calc(100vw - 28px);
    }
    .sidebar .nav-link {
        flex: 0 0 auto;
        padding: 9px 11px;
    }
    .main {
        grid-column: auto;
        width: 100%;
        max-width: 100vw;
        padding: 0 14px 18px;
    }
    .topbar {
        position: sticky;
        left: auto;
        right: auto;
        align-items: flex-start;
        flex-direction: column;
        margin: 0 -14px 18px;
        padding: 16px 14px;
    }
    .topbar h1 { font-size: 1.35rem; }
    .topbar p { font-size: .9rem; }
    .user-chip {
        max-width: 100%;
        white-space: normal;
    }
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .panel-header .btn,
    .panel-header form,
    .panel-header select {
        width: 100%;
    }
    .list-search {
        width: 100%;
    }
    .panel-body { padding: 16px; }
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    .bar-chart {
        grid-template-columns: repeat(3, minmax(70px, 1fr));
    }
    .bar-track {
        width: 100%;
    }
    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
    }
    .login-card {
        grid-template-columns: 1fr;
        height: auto;
        max-height: calc(100vh - 36px);
        overflow: auto;
    }
    .login-cover {
        min-height: 260px;
    }
    .login-cover-panel {
        left: 18px;
        right: 18px;
        bottom: 18px;
        padding: 18px;
    }
    .login-cover-panel strong {
        font-size: 1.45rem;
    }
    .login-form {
        padding: 34px;
        overflow: visible;
    }
}

@media (max-width: 560px) {
    .brand small { display: none; }
    .brand { gap: 10px; }
    .brand > div:last-child { min-width: 0; }
    .brand strong {
        display: block;
        max-width: calc(100vw - 88px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .sidebar .nav-link span { display: none; }
    .sidebar .nav-link {
        width: 42px;
        height: 40px;
        justify-content: center;
        padding: 0;
    }
    .sidebar .nav-link i { font-size: 1.05rem; }
    .login-page {
        height: auto;
        min-height: 100vh;
        overflow: auto;
        padding: 16px;
    }
    .login-card { grid-template-columns: 1fr; }
    .login-cover { min-height: 190px; }
    .login-cover-panel { display: none; }
    .login-form { padding: 24px; }
    .login-brand-title { font-size: 1.55rem; }
    .login-brand .login-brand-mark {
        width: 58px;
        height: 58px;
    }
    .btn,
    .form-control,
    .form-select,
    .input-group {
        max-width: 100%;
    }
    .pending-payment-amount {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
    }
    .pending-documents-table {
        font-size: .76rem;
    }
    .pending-documents-table > :not(caption) > * > * {
        padding: .22rem .32rem;
    }
    .receipt-card {
        border-radius: 0;
    }
    .receipt-head,
    .receipt-grid,
    .receipt-amounts {
        padding-left: 18px;
        padding-right: 18px;
    }
    .receipt-grid {
        grid-template-columns: 1fr;
    }
    .receipt-amounts {
        grid-template-columns: minmax(0, 1fr) 210px;
        gap: 14px;
    }
    .receipt-date {
        margin-left: 18px;
        margin-right: 18px;
    }
    .receipt-original,
    .receipt-total {
        text-align: left;
    }
    .receipt-total strong {
        font-size: 3rem;
    }
    .receipt-summary {
        grid-template-columns: repeat(2, 1fr);
        margin-left: 18px;
        margin-right: 18px;
    }
    .receipt-table {
        width: calc(100% - 36px);
        margin-left: 18px;
        margin-right: 18px;
    }
    .receipt-notes,
    .receipt-card h2 {
        margin-left: 18px;
        margin-right: 18px;
    }
}

@media (max-width: 430px) {
    .receipt-amounts {
        grid-template-columns: 1fr;
    }
    .receipt-original {
        text-align: left;
    }
}
