@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-1: #0b1320;
    --bg-2: #14263e;
    --surface-1: rgba(255, 255, 255, 0.95);
    --surface-2: #f7f9fd;
    --surface-3: #e8edf7;
    --text-1: #11203a;
    --text-2: #405170;
    --accent-1: #1ea896;
    --accent-2: #0f7b6c;
    --accent-3: #1f4fa6;
    --danger-1: #dc2626;
    --warning-1: #d97706;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-lg: 0 24px 50px rgba(7, 15, 30, 0.2);
    --shadow-md: 0 12px 28px rgba(13, 24, 44, 0.14);
}

/* Escala base: móvil más compacto */
html {
    font-size: 16px;
}
@media (max-width: 768px) {
    html { font-size: 12px; }
}
@media (max-width: 480px) {
    html { font-size: 11px; }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    line-height: 1.3;
    background:
        radial-gradient(circle at 12% 18%, rgba(30, 168, 150, 0.24), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(31, 79, 166, 0.25), transparent 28%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2));
    color: var(--text-1);
    min-height: 100vh;
}

#root {
    min-height: 100vh;
}


.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 18px 48px;
}

.header {
    background: linear-gradient(125deg, rgba(11, 19, 32, 0.92), rgba(16, 40, 70, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    color: #eef5ff;
    backdrop-filter: blur(7px);
}

.header h1 {
    margin: 0;
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
}

.header p {
    margin: 10px 0 0;
    color: #d2deef;
    font-weight: 500;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.nav-button {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #f4f7fd;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
}

.nav-button.active {
    background: linear-gradient(130deg, #27bea9, #1f4fa6);
    border-color: transparent;
}

.main-container {
    margin-top: 22px;
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    color: var(--text-1);
}

.cards-grid,
.payments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.card,
.payment-card,
.stat-card,
.summary-stat {
    background: linear-gradient(160deg, #ffffff, var(--surface-2));
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.card,
.payment-card {
    padding: 18px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.payment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(12, 31, 58, 0.2);
}

.card-header,
.payment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.card-title,
.payment-card-name {
    margin: 0;
    color: var(--text-1);
    font-size: 1.05rem;
    line-height: 1.2;
}

.card-description {
    margin: 0 0 14px;
    color: var(--text-2);
}

.card-badge,
.payment-badge {
    background: rgba(31, 79, 166, 0.1);
    color: var(--accent-3);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.card-footer,
.payment-card-footer {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.payment-card-body {
    margin: 16px 0;
    padding: 12px 0;
    border-top: 1px solid #deebf7;
    border-bottom: 1px solid #deebf7;
}

.payment-amount {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--accent-1);
    margin-bottom: 8px;
}

.payment-details {
    display: grid;
    gap: 6px;
}

.payment-details p {
    margin: 0;
    color: var(--text-2);
    font-size: 14px;
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 9px 13px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(130deg, #2e6cd6, #1f4fa6);
    color: #fff;
}

.btn-secondary {
    background: #dce5f2;
    color: #22406e;
}

.btn-success {
    background: linear-gradient(130deg, var(--accent-1), var(--accent-2));
    color: #fff;
}

.btn-danger {
    background: linear-gradient(130deg, #ef4444, var(--danger-1));
    color: #fff;
}

.btn-warning {
    background: linear-gradient(130deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(130deg, #d97706, #b45309);
    color: #fff;
}

.abono-form {
    max-width: 760px;
}

.abono-entry-panel {
    border: 1px solid #dfe8f5;
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, #ffffff, #f5f9ff);
    box-shadow: var(--shadow-md);
    padding: 16px;
    display: grid;
    gap: 12px;
}

.abono-entry-header h3 {
    margin: 0;
    color: #123258;
}

.abono-entry-header p {
    margin: 6px 0 0;
    color: #5e7391;
    font-size: 14px;
}

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

.abono-entry-selected {
    margin-top: 10px;
    color: #5d7697;
    font-size: 13px;
    font-weight: 600;
}

.movement-table-wrapper {
    overflow-x: auto;
    border: 1px solid #dfe8f5;
    border-radius: 12px;
    background: #fff;
}

.movement-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}

.movement-table thead th {
    text-align: left;
    background: #f0f5ff;
    color: #1c3156;
    padding: 12px 14px;
    font-size: 13px;
    border-bottom: 1px solid #d9e4f5;
    white-space: nowrap;
}

.movement-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f9;
    color: #344868;
    font-size: 14px;
    vertical-align: middle;
}

.movement-table tbody tr:hover {
    background: #f8fbff;
}

.movement-table tbody tr:last-child td {
    border-bottom: none;
}

.movement-cell-strong {
    font-weight: 700;
    color: #0f2440;
}

.movement-cell-obs {
    color: #7b8da8;
    font-size: 13px;
}

.movement-amount-cell {
    font-weight: 800;
    white-space: nowrap;
}

.movement-actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.form-group--full {
    grid-column: 1 / -1;
}

.abono-modal-content {
    width: min(720px, 100%);
}

.abono-selected-member-chip {
    border: 1px solid rgba(110, 231, 183, 0.45);
    background: rgba(16, 185, 129, 0.16);
    color: #d1fae5;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
}

.abono-balance-panel {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.abono-balance-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.abono-balance-item {
    font-size: 13px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.abono-balance-item--debt    { color: #fca5a5; background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.4); }
.abono-balance-item--ok      { color: #6ee7b7; background: rgba(16, 185, 129, 0.16); border-color: rgba(16, 185, 129, 0.4); }
.abono-balance-item--advance { color: #5eead4; background: rgba(20, 184, 166, 0.18); border-color: rgba(20, 184, 166, 0.45); }
.abono-balance-item--muted   { color: #cbd5e1; background: rgba(100, 116, 139, 0.16); border-color: rgba(100, 116, 139, 0.35); }

.abono-breakdown {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.45;
}

.member-search-results {
    margin-top: 8px;
    border: 1px solid #deebf7;
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    padding: 6px;
}

.member-search-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-1);
}

.member-search-item:hover {
    background: #eef4ff;
}

.member-search-item.selected {
    background: #dff5f1;
    color: #0f7b6c;
    font-weight: 700;
}

.member-search-empty {
    margin: 0;
    padding: 10px;
    color: #7b8da8;
    font-size: 13px;
}

.abonos-table-wrapper {
    overflow-x: auto;
    border: 1px solid #dfe8f5;
    border-radius: 12px;
    background: #fff;
}

.abonos-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.dashboard-panel .abonos-table {
    min-width: 0;
}

.dashboard-panel .abonos-table-wrapper {
    overflow-x: hidden;
}

.abonos-table thead th {
    text-align: left;
    background: #f0f5ff;
    color: #1c3156;
    padding: 12px 14px;
    font-size: 13px;
    border-bottom: 1px solid #d9e4f5;
}

.abonos-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f9;
    color: #344868;
    font-size: 14px;
}

.abonos-table tbody tr:hover {
    background: #f8fbff;
}

.abono-amount-cell {
    font-weight: 800;
    color: var(--accent-1);
}

.payments-filter-panel {
    border: 1px solid #dfe8f5;
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, #ffffff, #f6faff);
    box-shadow: var(--shadow-md);
    padding: 14px;
    margin-bottom: 14px;
}

.payments-filter-panel h3 {
    margin: 0 0 10px;
    color: #143a61;
    font-size: 15px;
}

.payments-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.payments-filter-preview {
    margin: 10px 0 0;
    color: #325983;
    font-size: 13px;
    font-weight: 600;
}

.payments-table-scroll {
    max-height: 560px;
    overflow: auto;
}

.abono-row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.receipt-modal-content {
    width: min(720px, 100%);
}

.receipt-ticket {
    border: 1px solid #d9e6f5;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
    padding: 14px;
    margin-bottom: 12px;
}

.receipt-title {
    margin: 0 0 12px;
    color: #123258;
    font-size: 20px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed #d8e4f4;
}

.receipt-row:last-child {
    border-bottom: none;
}

.receipt-label {
    color: #4f6e93;
    font-weight: 700;
}

.receipt-value {
    color: #10233d;
    font-weight: 800;
    text-align: right;
}

.stats-grid,
.payment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stats-grid {
    display: block;
    background: #ffffff;
    border: 1px solid #e2eaf6;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(13, 24, 44, 0.08);
    overflow: hidden;
    padding: 0;
}

.stats-grid--cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.stats-grid--cols .dashboard-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #e2eaf6;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(13, 24, 44, 0.05);
    padding: 12px 14px;
    position: relative;
}

.stats-grid--cols .stat-info {
    min-width: 0;
}

.stats-grid--cols .stat-label {
    font-size: 11px;
    letter-spacing: 0.03em;
}

.stats-grid--cols .stat-change {
    margin-top: 3px;
    font-size: 11.5px;
    line-height: 1.3;
    color: #8a9bb5;
}

.stats-grid--cols .stat-value {
    margin-top: 0;
    font-size: 1.05rem;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.stats-grid--cols .dashboard-stat:last-child {
    border-bottom: 1px solid #e2eaf6;
}

@media (max-width: 640px) {
    .stats-grid--cols {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stats-grid--cols .dashboard-stat {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 14px;
        gap: 8px;
        background: linear-gradient(135deg, #ffffff 0%, #f4f7fc 100%);
        border-radius: 16px;
        box-shadow: 0 6px 16px rgba(13, 24, 44, 0.08);
        border: 1px solid #e2eaf6;
    }
    .stats-grid--cols .stat-info {
        width: 100%;
    }
    .stats-grid--cols .stat-label {
        font-size: 13px !important;
        font-weight: 600;
        color: #4b5563;
        margin-bottom: 4px;
    }
    .stats-grid--cols .stat-value {
        font-size: 1.35rem !important;
        text-align: left;
    }
}

.stat-card,
.summary-stat {
    padding: 10px 14px;
}

.stat-label {
    color: var(--text-2);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    margin-top: 4px;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-change {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #edf2f9;
    color: #7c8ea8;
    font-size: 12.5px;
    font-weight: 600;
}

.summary-stat p {
    margin: 0;
}

.summary-stat p + p {
    margin-top: 8px;
}

.summary-amount {
    font-size: 1.35rem;
    color: var(--accent-3);
    font-weight: 800;
}

.amount-positive {
    color: #10b981 !important;
}

.amount-negative {
    color: #ef4444 !important;
}

.amount-neutral {
    color: #64748b !important;
}

.amount-alert {
    color: #f59e0b !important;
}

.dashboard-subtitle {
    margin: 0;
    color: #5d7697;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 14px;
    border-bottom: 1px solid #e9eff7;
    background: #ffffff;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: none;
    position: static;
    overflow: visible;
}

.dashboard-stat::before {
    content: none;
    display: none;
}

.dashboard-stat:last-child {
    border-bottom: none;
}

.dashboard-stat .stat-info {
    min-width: 0;
}

.dashboard-stat .stat-change {
    margin-top: 5px;
    padding-top: 0;
    border-top: none;
    font-size: 12px;
    color: #8a9bb5;
    font-weight: 600;
}

.dashboard-stat .stat-value {
    margin-top: 0;
    font-size: 1.05rem;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.dashboard-stat--positive {
    background: #ffffff;
}

.dashboard-stat--positive::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.dashboard-stat--negative {
    background: #ffffff;
}

.dashboard-stat--negative::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.dashboard-stat--alert {
    background: #ffffff;
}

.dashboard-stat--alert::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.dashboard-stat--neutral {
    background: #ffffff;
}

.dashboard-stat--neutral::before {
    background: linear-gradient(90deg, #64748b, #94a3b8);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.dashboard-panel {
    background: linear-gradient(160deg, #ffffff, #f7fbff);
    border: 1px solid #dfe8f5;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 14px;
}

.dashboard-panel h3 {
    margin: 0 0 10px;
    color: #123258;
    font-size: 15px;
}

.dashboard-empty {
    margin: 0;
    color: #7b8da8;
    font-size: 13px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 40px 22px;
    text-align: center;
    border: 1px dashed #bfd0ea;
    border-radius: var(--radius-md);
    background: #f6f9ff;
    color: #5c6f90;
}

.modal-overlay,
.premium-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 22, 0.66);
    backdrop-filter: blur(7px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    animation: fadeIn 0.24s ease;
}

.modal-content,
.premium-modal-content,
.info-modal {
    width: min(560px, 100%);
    max-height: min(90vh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
    min-width: 0;
    background:
        radial-gradient(110% 80% at 12% 0%, rgba(39, 190, 169, 0.15), transparent 45%),
        radial-gradient(110% 90% at 90% 100%, rgba(31, 79, 166, 0.3), transparent 52%),
        linear-gradient(155deg, #0d1c36 0%, #122947 60%, #091524 100%);
    color: #f4f9ff;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 30px 70px rgba(2, 8, 20, 0.55);
    padding: 26px;
    animation: slideUp 0.24s ease;
}

.modal-content > *,
.premium-modal-content > *,
.info-modal > * {
    min-width: 0;
}

.modal-content::-webkit-scrollbar,
.premium-modal-content::-webkit-scrollbar,
.info-modal::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-content::-webkit-scrollbar-thumb,
.premium-modal-content::-webkit-scrollbar-thumb,
.info-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 8px;
}

.modal-content::-webkit-scrollbar-track,
.premium-modal-content::-webkit-scrollbar-track,
.info-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.premium-modal-header,
.modal-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.premium-modal-title,
.modal-title,
.modal-header-info h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #f8fcff;
}

.modal-description {
    color: #d6e7f8;
    line-height: 1.5;
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(255, 200, 200, 0.5);
    margin: 0 auto 14px;
    font-size: 24px;
}

.premium-modal-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.premium-form {
    display: grid;
    gap: 14px;
}

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

.form-group {
    display: grid;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #e9f3ff;
}

.form-input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
    color: #10233d;
    font-family: inherit;
    font-size: 14px;
    padding: 11px 12px;
}

.form-input.error {
    border-color: #f87171;
    background: #fff1f1;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input:focus {
    outline: 2px solid rgba(70, 160, 255, 0.35);
    outline-offset: 1px;
}

.error-message {
    color: #ffc8c8;
    font-size: 12px;
}

.form-actions,
.modal-actions {
    margin-top: 6px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.info-modal-body p {
    margin: 0 0 10px;
    line-height: 1.4;
    color: #ecf5ff;
}


.toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    min-width: 250px;
    max-width: min(360px, calc(100vw - 32px));
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    box-shadow: 0 14px 36px rgba(2, 12, 30, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 1100;
}

.toast-success {
    background: linear-gradient(130deg, #13a06f, #0f8f63);
}

.toast-error {
    background: linear-gradient(130deg, #e34d4d, #be2b2b);
}

.toast-close {
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 999px;
    width: 26px;
    height: 26px;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 880px) {
    .container {
        padding: 18px 12px 26px;
    }

    .header,
    .main-container {
        padding: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 640px) {
    .nav-tabs {
        flex-direction: column;
    }

    .nav-button {
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .card-footer,
    .payment-card-footer,
    .form-actions,
    .modal-actions {
        flex-direction: column;
    }

    .toast {
        left: 12px;
        right: 12px;
        min-width: unset;
    }
}

/* ==========================================
   MEMBERS AMF STYLES
   ========================================== */

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ==============================================
   MEMBERS TABLE VIEW (mtab) — fondo blanco
   ============================================== */

.mtab-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(15, 40, 80, 0.10);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Shared grid — header and rows must use identical template */
.mtab-header-row,
.mtab-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.1fr) minmax(150px, 1.45fr) minmax(128px, 1.1fr) minmax(105px, 1fr) minmax(88px, 0.9fr) minmax(72px, 0.6fr) minmax(72px, 0.6fr) minmax(72px, 0.6fr) minmax(72px, 0.6fr) minmax(108px, 0.95fr) minmax(90px, 0.8fr) minmax(118px, 0.9fr);
    align-items: center;
    min-width: 1040px;
}

/* Grid de 7 columnas para el tab Miembros AMF — scroll horizontal en móvil */
.miembros-amf-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.miembros-amf-table .mtab-header-row,
.miembros-amf-table .mtab-row {
    grid-template-columns: minmax(120px, 1fr) 140px 120px 95px 85px 85px 100px;
    min-width: 760px;
}

.miembros-amf-table .mtab-hcell {
    padding: 10px 8px;
    font-size: 9.5px;
}

.miembros-amf-table .mtab-cell {
    padding: 9px 8px;
    font-size: 11.5px;
}

/* ── Header ── */
.mtab-header-row {
    border-bottom: 1px solid #e2e8f0;
}

.mtab-hcell {
    padding: 12px 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Gradient reflectors sobre blanco — tonos suaves legibles */
.mtab-hcell--id {
    background: linear-gradient(160deg, rgba(100, 116, 139, 0.10), rgba(100, 116, 139, 0.03));
    color: #64748b;
}
.mtab-hcell--name {
    background: linear-gradient(160deg, rgba(59, 130, 246, 0.11), rgba(59, 130, 246, 0.03));
    color: #2563eb;
}
.mtab-hcell--date {
    background: linear-gradient(160deg, rgba(6, 182, 212, 0.11), rgba(6, 182, 212, 0.03));
    color: #0891b2;
}
.mtab-hcell--phone {
    background: linear-gradient(160deg, rgba(2, 132, 199, 0.11), rgba(2, 132, 199, 0.03));
    color: #0369a1;
}
.mtab-hcell--quota {
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.11), rgba(16, 185, 129, 0.03));
    color: #059669;
}
.mtab-hcell--months {
    background: linear-gradient(160deg, rgba(139, 92, 246, 0.11), rgba(139, 92, 246, 0.03));
    color: #7c3aed;
}
.mtab-hcell--paid {
    background: linear-gradient(160deg, rgba(20, 184, 166, 0.11), rgba(20, 184, 166, 0.03));
    color: #0d9488;
}
.mtab-hcell--arrear {
    background: linear-gradient(160deg, rgba(249, 115, 22, 0.11), rgba(239, 68, 68, 0.05));
    color: #ea580c;
}
.mtab-hcell--advance {
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.05));
    color: #059669;
}
.mtab-hcell--total {
    background: linear-gradient(160deg, rgba(245, 158, 11, 0.11), rgba(245, 158, 11, 0.04));
    color: #b45309;
}
.mtab-hcell--status {
    background: linear-gradient(160deg, rgba(100, 116, 139, 0.09), rgba(100, 116, 139, 0.02));
    color: #475569;
}
.mtab-hcell--actions {
    background: linear-gradient(160deg, rgba(99, 102, 241, 0.10), rgba(99, 102, 241, 0.03));
    color: #4f46e5;
    text-align: center;
}

/* ── Body rows ── */
.mtab-body {
    display: flex;
    flex-direction: column;
}

.mtab-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.14s ease;
}
.mtab-row:last-child { border-bottom: none; }
.mtab-row--even { background: #ffffff; }
.mtab-row--odd  { background: #f8fafc; }
.mtab-row:hover { background: #eff6ff; }

/* ── Cells ── */
.mtab-cell {
    padding: 11px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}
.mtab-cell--id {
    color: #4f46e5;
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: visible;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
}
.mtab-cell--name  { color: #1e3a5f; font-weight: 700; font-size: 12px; }
.mtab-cell--phone { color: #0f4c81; font-weight: 700; }
.mtab-cell--date  { color: #0e7490; }
.mtab-cell--quota { color: #047857; }
.mtab-cell--months { color: #6d28d9; text-align: center; }
.mtab-cell--paid   { color: #0f766e; text-align: center; }
.mtab-cell--arrear { color: #64748b; text-align: center; }
.mtab-cell--arrear.mtab-cell--arrear-alert { color: #dc2626; font-weight: 800; }
.mtab-cell--advance { color: #64748b; text-align: center; }
.mtab-cell--advance.mtab-cell--advance-ok { color: #059669; font-weight: 800; }
.mtab-cell--total  { color: #92400e; font-weight: 700; }
.mtab-cell--actions {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* ── Status badge ── */
.mtab-status-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.mtab-status-badge--active {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.30);
}
.mtab-status-badge--inactive {
    background: rgba(100, 116, 139, 0.10);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.22);
}

/* ── Action buttons ── */
.mtab-btn {
    border: none;
    border-radius: 7px;
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.12s ease;
    line-height: 1;
}
.mtab-btn:hover  { opacity: 0.78; transform: scale(1.1); }
.mtab-btn:active { transform: scale(0.96); }
.mtab-btn--edit {
    background: rgba(59, 130, 246, 0.10);
    border: 1px solid rgba(59, 130, 246, 0.28);
}
.mtab-btn--view {
    background: rgba(16, 185, 129, 0.09);
    border: 1px solid rgba(16, 185, 129, 0.28);
}
.mtab-btn--delete {
    background: rgba(239, 68, 68, 0.09);
    border: 1px solid rgba(239, 68, 68, 0.24);
}

/* ── Responsive: mantiene grid con scroll horizontal en ambas tablas ── */
@media (max-width: 940px) {
    /* Gestión de Miembros (12 col) — scroll horizontal, no apila */
    .mtab-card:not(.miembros-amf-table) .mtab-header-row { display: grid; }
    .mtab-card:not(.miembros-amf-table) .mtab-row {
        display: grid;
        flex-wrap: unset;
        gap: 0;
        padding: 0;
        border-radius: 0;
        margin: 0;
        border: none !important;
        min-width: 1040px;
    }
    .mtab-card:not(.miembros-amf-table) .mtab-cell {
        min-width: unset;
        white-space: nowrap;
    }
    .mtab-card:not(.miembros-amf-table) .mtab-cell--name    { min-width: unset; font-size: 11.5px; }
    .mtab-card:not(.miembros-amf-table) .mtab-cell--actions { min-width: unset; justify-content: center; }

    /* Miembros AMF (7 col) — scroll horizontal, no apila */
    .miembros-amf-table .mtab-header-row { display: grid; }
    .miembros-amf-table .mtab-row {
        display: grid;
        flex-wrap: unset;
        gap: 0;
        padding: 0;
        border-radius: 0;
        margin: 0;
        border: none !important;
        min-width: 760px;
    }
    .miembros-amf-table .mtab-cell {
        min-width: unset;
        white-space: nowrap;
    }
    .miembros-amf-table .mtab-cell--name   { min-width: unset; font-size: 11.5px; }
    .miembros-amf-table .mtab-cell--actions { min-width: unset; justify-content: center; }
}



.member-card {
    background: linear-gradient(160deg, #ffffff, #f5f8ff);
    border: 2px solid #deebf7;
    border-left: 6px solid #1ea896;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(12, 31, 58, 0.2);
}

.member-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.member-name {
    margin: 0;
    color: #14335d;
    font-size: 1.1rem;
    font-weight: 700;
}

.member-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.member-card-body {
    margin: 12px 0;
    display: grid;
    gap: 10px;
}

.member-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #fbfdff;
    border-radius: 8px;
    border: 1px solid #dfebf9;
}

.stat-label {
    color: #405170;
    font-size: 13px;
    font-weight: 600;
}

.stat-value {
    color: #14335d;
    font-size: 14px;
    font-weight: 800;
}

.member-stat.arrear {
    background: #fff1f1;
    border-color: #f87171;
}

.arrear-amount {
    color: #dc2626 !important;
    font-size: 16px !important;
}

.member-card-footer {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.member-card-footer .btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 12px;
}

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

.member-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #deebf7;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
}

.member-search input::placeholder {
    color: #9fb3d5;
}

.contribution-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.contribution-list h3 {
    margin: 0 0 12px;
    color: #14335d;
    font-size: 16px;
}

.contributions-items {
    display: grid;
    gap: 10px;
}

.contribution-item {
    background: #fbfdff;
    border: 1px solid #dfebf9;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
}

.contribution-item p {
    margin: 0 0 6px;
    color: #405170;
}

.contribution-item p:last-child {
    margin-bottom: 0;
}

.contribution-item strong {
    color: #14335d;
}

.empty-contributions {
    text-align: center;
    color: #9fb3d5;
    padding: 20px;
}

/* ============================================
   NUEVOS ESTILOS - INFORMACIÓN DE PAGO
   ============================================ */

/* Sección de información de período de pago en MemberModal */
.payment-info-section {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f3ff 100%);
    border: 1px solid #c7dff0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 18px;
    margin-bottom: 16px;
}

.payment-info-title {
    color: #04162a;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

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

.payment-info-item {
    background: white;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #deebf7;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.payment-info-item--full {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .payment-info-item--full {
        grid-column: span 1;
    }
}

.payment-info-tag {
    font-size: 11px;
    font-weight: 700;
    color: #1d4ed8;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
}

.payment-info-subtext {
    font-size: 11px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.payment-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.payment-info-label {
    font-size: 11px;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.payment-info-ctrls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-info-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.payment-info-badge--auto {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.payment-info-badge--manual {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.payment-info-reset-btn {
    font-size: 11px;
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: color 0.15s ease;
}

.payment-info-reset-btn:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.payment-info-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.payment-info-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.payment-info-input.is-manual {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

/* ============================================
   LISTA DE CONTRIBUCIONES MEJORADA
   ============================================ */

.contribution-list-detailed {
    padding: 16px;
    background: white;
    border-radius: 12px;
}

.contribution-list-title {
    color: #04162a;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

.section-title {
    color: #04162a;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #deebf7;
}

/* Sección de resumen del miembro */
.member-summary-section {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

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

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #deebf7;
}

.summary-label {
    font-size: 12px;
    color: #5a7b9a;
    font-weight: 600;
}

.summary-value {
    font-size: 12px;
    color: #04162a;
    font-weight: 700;
}

/* Sección de estado de pago */
.payment-status-section {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

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

.status-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #27bea9;
}

.status-label {
    font-size: 11px;
    color: #5a7b9a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.status-value {
    font-size: 14px;
    color: #04162a;
    font-weight: 800;
}

.status-item.arrear-item {
    background: linear-gradient(135deg, #fff1f1 0%, #ffe6e6 100%);
    border-left-color: #ef4444;
}

.arrear-value {
    color: #dc2626 !important;
    font-size: 16px !important;
}

/* Sección de historial de aportes */
.contributions-history-section {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
}

.contributions-items-detailed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 600px;
    overflow-y: auto;
    padding: 4px;
}

.contribution-item-detailed {
    background: white;
    border: 1px solid #deebf7;
    border-radius: 8px;
    overflow: hidden;
}

.contribution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(90deg, #f8fafc 0%, #f0f7ff 100%);
    border-bottom: 1px solid #deebf7;
}

.contribution-date {
    font-size: 12px;
    color: #5a7b9a;
    font-weight: 600;
}

.contribution-amount {
    font-size: 13px;
    color: #10b981;
    font-weight: 800;
}

.contribution-body {
    padding: 10px 12px;
}

.contribution-body p {
    margin: 6px 0;
    font-size: 12px;
    color: #4a5f7f;
}

.contribution-body strong {
    color: #04162a;
    font-weight: 700;
}

.contribution-toggle {
    margin-top: 10px;
}

/* Responsive para móviles */
@media (max-width: 600px) {
    .payments-filter-grid {
        grid-template-columns: 1fr;
    }

    .payment-info-grid,
    .summary-grid,
    .status-grid {
        grid-template-columns: 1fr;
    }

    .contributions-items-detailed {
        max-height: 400px;
    }
}


/* ============================================================
   INFO-MODAL WIDE — para detalle completo de miembro
   ============================================================ */

.info-modal--wide {
    width: min(880px, 96vw);
    max-height: min(92vh, 900px);
}

/* ============================================================
   BTN-SM — botón pequeño
   ============================================================ */

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* ============================================================
   MSUM-BAR — barra resumen de miembros (sobre la tabla)
   ============================================================ */

.msum-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.msum-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(15, 40, 80, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.msum-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 40, 80, 0.11);
}

.msum-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.msum-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    font-weight: 600;
    margin-top: 4px;
}

.msum-card--total .msum-value   { color: #2563eb; }
.msum-card--active .msum-value  { color: #10b981; }
.msum-card--inactive .msum-value{ color: #6b7280; }
.msum-card--acum .msum-value    { color: #b45309; }
.msum-card--arrear .msum-value  { color: #dc2626; }
.msum-card--advance .msum-value { color: #059669; }

@media (max-width: 860px) {
    .msum-bar { grid-template-columns: repeat(2, 1fr); }
    .msum-card:last-child { grid-column: span 2; }
}

/* ============================================================
   MDETAIL — vista de detalle completo del miembro
   ============================================================ */

.mdetail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Meta bar */
.mdetail-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #c8dff4;
    font-weight: 600;
}

.mdetail-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.mdetail-badge--active   { background: rgba(52, 211, 153, 0.20); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.35); }
.mdetail-badge--inactive { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.30); }

/* KPI grid */
.mdetail-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mdetail-kpi {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    transition: background 0.14s ease;
}

.mdetail-kpi:hover { background: rgba(255, 255, 255, 0.14); }

.mdetail-kpi-value {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    color: #f0f9ff;
}

.mdetail-kpi-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #7dafd4;
    margin-top: 5px;
    font-weight: 600;
}

.mdetail-kpi--green  .mdetail-kpi-value { color: #6ee7b7; }
.mdetail-kpi--red    .mdetail-kpi-value { color: #fca5a5; }
.mdetail-kpi--orange .mdetail-kpi-value { color: #fdba74; }
.mdetail-kpi--blue   .mdetail-kpi-value { color: #93c5fd; }
.mdetail-kpi--purple .mdetail-kpi-value { color: #d8b4fe; }

/* Contributions section header */
.mdetail-contrib-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 14px;
}

.mdetail-contrib-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #e2f0ff;
    flex: 1;
}

.mdetail-contrib-count {
    font-size: 12px;
    color: #7dafd4;
    font-weight: 600;
}

.mdetail-empty {
    text-align: center;
    color: #7dafd4;
    font-size: 13px;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
}

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

/* =========================================
   AUTH + ROLES UI
   ========================================= */

.auth-userbar {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-user-chip {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #e6f2ff;
}

.auth-user-role {
    color: #c7def7;
    font-size: 12px;
    font-weight: 600;
}

.readonly-banner {
    margin: 10px 0 0;
    color: #ffe7b0;
    font-weight: 600;
    font-size: 13px;
}

.auth-panel {
    max-width: 560px;
    margin: 24px auto 0;
}

.auth-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
}

.auth-screen .header {
    width: 100%;
    max-width: 560px;
    margin: 0;
    padding: 24px 28px;
    text-align: center;
}

.auth-screen .main-container {
    margin: 0;
}

.field-wrapper,
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-input {
    padding-right: 44px;
}

.input-icon-left {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8fa3bd;
    pointer-events: none;
    z-index: 1;
}

.form-input.input-with-icon-left {
    padding-left: 38px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #000000;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.password-toggle:hover {
    color: #444444;
}

.auth-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.auth-form {
    margin-top: 6px;
}

.auth-hint {
    margin-top: 10px;
    color: #5d7697;
    font-size: 12px;
}

.readonly-text {
    margin: 0;
    color: #8b5e00;
    font-weight: 600;
    font-size: 13px;
}

.users-admin-form {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #b8d7f3;
    border-radius: 12px;
    background: linear-gradient(135deg, #eef7ff 0%, #e7f4ff 45%, #e9fff7 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 24px rgba(18, 50, 88, 0.10);
}

.users-admin-form .form-group label {
    color: #16345d;
    font-weight: 700;
}

.users-admin-form h3,
.users-list-panel h3 {
    margin: 0 0 10px;
    color: #16345d;
}

.users-list-panel {
    border: 1px solid #dbe7f5;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.users-table {
    width: 100%;
    min-width: 520px;
}

.users-form-input {
    border: 1px solid #b8cde6;
    box-shadow: 0 6px 16px rgba(21, 56, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.users-form-input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.2);
    border-color: #6aa2e8;
}


.users-table-input {
    min-width: 180px;
    max-width: 240px;
    padding: 9px 10px;
    font-size: 13px;
}

.users-password-input {
    min-width: 220px;
}

.users-actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 260px;
}

.users-protected-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    border: 1px solid rgba(100, 116, 139, 0.25);
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

/* ==========================================
   RESPONSIVE GENERAL / MOBILE (PWA)
   ========================================== */

html,
body {
    overflow-x: hidden;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

.auth-screen {
    min-height: 100vh;
    min-height: 100dvh;
}

@media (max-width: 880px) {
    .payments-table-scroll {
        max-height: none;
    }
}

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

    .auth-switch {
        flex-direction: column;
    }

    .auth-switch .btn {
        width: 100%;
    }

    .receipt-modal-content {
        width: 96vw;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px 10px 32px;
    }

    .header {
        padding: 16px;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .main-container {
        padding: 14px 10px;
    }

    .section-header h2 {
        font-size: 1.05rem;
    }

    .btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .form-input,
    .form-textarea {
        font-size: 13px;
        padding: 10px 10px;
    }

    .nav-tabs {
        gap: 8px;
    }
}

@media (max-height: 560px) and (max-width: 640px) {
    .auth-screen {
        justify-content: flex-start;
        padding: 20px 0;
    }
}

/* ==========================================
   MENÚ PROFESIONAL — SIDEBAR + HAMBURGUESA
   ========================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 272px;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    background: linear-gradient(180deg, #101c30 0%, #0b1320 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 6px 0 28px rgba(3, 8, 18, 0.45);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
}

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

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 18, 0.62);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 990;
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    margin-bottom: 14px;
}

.sidebar-logo {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    background: linear-gradient(135deg, #27bea9, #1f4fa6);
    box-shadow: 0 8px 18px rgba(31, 79, 166, 0.45);
}

.sidebar-brand-name {
    color: #f4f7fd;
    font-size: 15.5px;
    font-weight: 800;
    line-height: 1.25;
}

.sidebar-brand-sub {
    color: #8fa3c2;
    font-size: 11.5px;
    font-weight: 600;
    margin-top: 3px;
}

.sidebar-label {
    color: #5f718d;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    padding: 2px 10px 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
}

.sidebar-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: #c3d0e3;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 13px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.sidebar-item.active {
    background: linear-gradient(130deg, rgba(39, 190, 169, 0.18), rgba(31, 79, 166, 0.26));
    color: #ffffff;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #27bea9, #3b82f6);
}

.sidebar-footer {
    margin-top: 14px;
    padding: 14px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.sidebar-user {
    color: #e8eef8;
    font-size: 13px;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-role {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.sidebar-role--full { color: #6ee7b7; background: rgba(52, 211, 153, 0.16); }
.sidebar-role--read { color: #fbbf24; background: rgba(217, 119, 6, 0.16); }
.sidebar-role--super { color: #60a5fa; background: rgba(37, 99, 235, 0.2); border: 1px solid rgba(96, 165, 250, 0.3); }

/* ==============================================
   APP SHELL & PANEL LAYOUT ARCHITECTURE
   (Organización por Paneles + Responsive Móvil)
   ============================================== */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(30, 168, 150, 0.20), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(31, 79, 166, 0.22), transparent 28%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2));
    box-sizing: border-box;
}

/* 1. HEADER SUPERIOR FIJO (Logo a la izquierda + Subtítulos fijos a la derecha) */
.app-header {
    position: sticky;
    top: 0;
    z-index: 150;
    display: flex;
    align-items: stretch;
    background: linear-gradient(125deg, rgba(11, 19, 32, 0.97), rgba(16, 40, 70, 0.97));
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    box-sizing: border-box;
}

.header-logo-panel {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.10);
    box-sizing: border-box;
}

.header-logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, #27bea9, #1f4fa6);
    box-shadow: 0 4px 14px rgba(31, 79, 166, 0.4);
}

.header-brand-info {
    min-width: 0;
    flex: 1;
}

.header-brand-title {
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-brand-subtitle {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-menu-toggle-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-toggle-btn:hover,
.mobile-menu-toggle-btn.active {
    background: linear-gradient(130deg, #27bea9, #1f4fa6);
    border-color: transparent;
    transform: translateY(-1px);
}

.mobile-menu-label {
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* Header Info Panel (Subtítulos del menú clickeado fijo) */
.header-info-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 22px;
    gap: 16px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.header-active-menu {
    min-width: 0;
}

.header-active-title {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
}

.header-active-subtitle {
    margin: 3px 0 0;
    color: #b7c7dd;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
}

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

.topbar-tenant-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tenant-selector-label {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
}

.tenant-select-dropdown {
    width: auto;
    min-width: 190px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
    background: #ffffff;
    color: #11203a;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.topbar-tenant-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 168, 150, 0.15);
    border: 1px solid rgba(30, 168, 150, 0.35);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-1);
}

/* 2. MENÚ TIPO COLUMNA A LA DERECHA (De arriba a abajo) */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 20, 0.70);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.mobile-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #101c30 0%, #0c1524 60%, #070e18 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 16px;
    box-sizing: border-box;
    z-index: 1000;
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

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

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    margin-bottom: 12px;
}

.mobile-drawer-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mobile-drawer-icon {
    font-size: 1.5rem;
}

.mobile-drawer-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-drawer-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #cbd5e1;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.mobile-drawer-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ffffff;
    transform: rotate(90deg);
}

.mobile-drawer-section-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #64748b;
    padding: 0 4px 10px;
}

.mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    padding-right: 2px;
}

.mobile-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.16s ease;
    width: 100%;
    box-sizing: border-box;
}

.mobile-drawer-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    transform: translateX(3px);
}

.mobile-drawer-item.active {
    background: linear-gradient(130deg, rgba(39, 190, 169, 0.22), rgba(31, 79, 166, 0.32));
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(31, 79, 166, 0.2);
}

.mobile-drawer-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    margin-top: 12px;
}

/* 3. CUERPO PRINCIPAL (Paneles) */
.app-main-body {
    display: flex;
    flex: 1;
    width: 100%;
    min-width: 0;
    align-items: stretch;
    box-sizing: border-box;
}

/* Panel Menú Lateral (Desktop) */
.desktop-menu-panel {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #101c30 0%, #0b1320 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    position: sticky;
    top: 67px;
    height: calc(100vh - 67px);
    overflow-y: auto;
}

/* Panel de Contenido Principal (Ajustado a la ventana sin importar tamaño) */
.app-content-panel {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 20px 24px 48px;
    box-sizing: border-box;
}

.app-content-panel > .main-container {
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
}

.readonly-banner {
    margin: 0 0 16px;
}

/* Adaptación para pantallas móviles (<= 940px) */
@media (max-width: 940px) {
    .app-header {
        flex-direction: column;
    }

    .header-logo-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        justify-content: space-between;
        padding: 10px 14px;
    }

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

    .desktop-menu-panel {
        display: none !important;
    }

    .header-info-panel {
        padding: 8px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .header-actions-area {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .app-content-panel {
        padding: 12px 8px 36px;
    }
}


/* ============================================================
   OVERRIDES MÓVIL — Diseño compacto para celular (≤768px)
   ============================================================ */
@media (max-width: 768px) {

    /* Contenedor principal */
    .container {
        padding: 10px 8px 24px;
    }

    /* Topbar */
    .topbar {
        padding: 8px 12px;
        top: 6px;
        border-radius: 14px;
        gap: 10px;
    }
    .topbar-title h1 {
        font-size: 0.95rem;
    }
    .topbar-title p {
        font-size: 10px;
        margin-top: 1px;
    }
    .hamburger {
        width: 34px;
        height: 34px;
        font-size: 16px;
        border-radius: 9px;
    }

    /* Contenedor de sección */
    .main-container {
        margin-top: 10px;
        padding: 12px 10px;
        border-radius: 14px;
    }

    /* Superadmin Mobile Polish — Vista Limpia, Espaciosa y No Reguerosa */
    .superadmin-header {
        padding: 10px 14px !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
    }

    .superadmin-header-row {
        gap: 8px !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .superadmin-header-title-box {
        gap: 6px !important;
    }

    .superadmin-header-icon {
        font-size: 1.25rem !important;
    }

    .superadmin-header-title {
        font-size: 1.02rem !important;
    }

    .superadmin-header-badge {
        font-size: 0.72rem !important;
        padding: 2px 7px !important;
    }

    .superadmin-header-desc {
        display: none !important; /* Libera más de 80px de altura en móvil */
    }

    .superadmin-header-session {
        padding: 4px 10px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .superadmin-session-label {
        display: none !important;
    }

    .superadmin-session-email {
        font-size: 0.78rem !important;
    }

    /* Pestañas Segmentadas en Móvil: exactamente 50% / 50% */
    .superadmin-segmented-tabs {
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 14px !important;
        padding: 3px !important;
        gap: 4px !important;
    }

    .superadmin-segmented-btn {
        padding: 8px 6px !important;
        font-size: 0.85rem !important;
        gap: 5px !important;
    }

    .tab-text-full {
        display: none !important;
    }

    .tab-text-short {
        display: inline !important;
    }

    .superadmin-form-panel {
        padding: 16px 14px !important;
        border-radius: 14px !important;
    }

    .superadmin-form-header h3 {
        font-size: 1.1rem !important;
    }

    .superadmin-form-header p {
        font-size: 0.84rem !important;
        margin-bottom: 14px !important;
    }

    .superadmin-list-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .superadmin-search-wrapper {
        max-width: 100% !important;
        width: 100% !important;
    }

    .topbar-tenant-selector {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .tenant-select-dropdown {
        flex: 1 !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    /* Section header */
    .section-header {
        margin-bottom: 12px;
        gap: 8px;
    }
    .section-header h2 {
        font-size: 1rem;
    }

    /* Tarjetas generales */
    .card,
    .payment-card {
        padding: 12px;
    }
    .stat-card,
    .summary-stat {
        padding: 10px 12px;
    }
    .card-title,
    .payment-card-name {
        font-size: 0.88rem;
    }
    .card-footer,
    .payment-card-footer {
        margin-top: 8px;
        gap: 6px;
        flex-wrap: nowrap;
    }

    /* Botones */
    .btn {
        padding: 7px 11px;
        font-size: 12px;
        border-radius: 8px;
    }
    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* Grids de tarjetas */
    .cards-grid,
    .payments-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Stats grid */
    .stats-grid {
        gap: 8px;
    }
    .stat-value {
        font-size: 1.25rem;
        margin-top: 5px;
    }
    .stat-label {
        font-size: 11px;
    }

    /* Dashboard stats */
    .dashboard-stat .stat-value {
        font-size: 1.1rem;
    }
    .dashboard-stat {
        padding: 8px 12px;
    }

    /* Summary stats de miembros */
    .msum-bar {
        gap: 6px;
    }
    .msum-card {
        padding: 8px 10px;
    }
    .msum-value {
        font-size: 1rem;
    }
    .msum-label {
        font-size: 9.5px;
    }

    /* Formularios */
    .form-group label {
        font-size: 11px;
        margin-bottom: 3px;
    }
    .form-input,
    .premium-input,
    select.form-input {
        padding: 7px 10px;
        font-size: 12px;
        border-radius: 8px;
    }
    .form-row {
        gap: 8px;
    }
    .form-actions {
        gap: 6px;
    }

    /* Modales */
    .modal-content,
    .modal-inner {
        padding: 14px 12px;
        border-radius: 14px;
    }
    .modal-title {
        font-size: 1rem;
    }

    /* Abono panel */
    .abono-entry-panel {
        padding: 10px;
        gap: 8px;
    }
    .abono-entry-header h3 {
        font-size: 0.9rem;
    }

    /* Tablas de movimientos / abonos */
    .movement-table thead th,
    .abonos-table thead th {
        padding: 8px 10px;
        font-size: 11px;
    }
    .movement-table tbody td,
    .abonos-table tbody td {
        padding: 6px 8px;
        font-size: 11px;
    }

    /* Panel de dashboard */
    .dashboard-panel {
        padding: 8px;
    }
    .dashboard-grid {
        gap: 8px;
    }

    /* Readonly banner */
    .readonly-banner {
        margin: 6px 0 0;
        font-size: 10px;
        padding: 4px 8px;
    }

    /* Line-height compacto global */
    p, span, div, label, td, th, li {
        line-height: 1.25;
    }

    /* Modales compactos */
    .modal-overlay .modal-content,
    .premium-modal .modal-inner,
    .modal-inner,
    .modal-content {
        padding: 12px 10px !important;
        border-radius: 12px !important;
    }
    .modal-header,
    .modal-title {
        font-size: 0.9rem !important;
        margin-bottom: 8px !important;
    }
    .modal-body {
        gap: 8px !important;
    }
    .modal-footer,
    .form-actions {
        padding-top: 8px !important;
        gap: 6px !important;
    }

    /* Tarjetas de datos compactas */
    .member-card,
    .abono-card,
    .payment-card,
    .card {
        padding: 8px 10px !important;
    }
    .member-card p,
    .card p,
    .payment-card p {
        margin: 1px 0 !important;
        font-size: 11px !important;
    }

    /* Subtítulo dashboard */
    .dashboard-subtitle {
        font-size: 10px;
        margin-bottom: 6px;
    }
}

/* Premium Filter Panel */
.premium-filter-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(13, 24, 44, 0.08);
    border: 1px solid #e2eaf6;
    margin-bottom: 24px;
}

.premium-filter-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.15rem;
    color: #1e293b;
}

.premium-search-container {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.unified-search-bar {
    display: flex;
    flex: 1 1 300px;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.unified-search-bar:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.unified-search-select {
    border: none;
    background: #e2e8f0;
    padding: 12px 14px;
    font-weight: 600;
    color: #334155;
    outline: none;
    cursor: pointer;
    border-right: 1px solid #cbd5e1;
    font-size: 0.95rem;
}

.unified-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    outline: none;
    color: #0f172a;
    font-size: 1rem;
    min-width: 0;
}

.premium-date-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 6px 12px;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
}

.premium-date-input {
    border: none;
    background: transparent;
    padding: 6px 2px;
    outline: none;
    color: #475569;
    font-family: inherit;
    font-size: 0.95rem;
}

.date-separator {
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.9rem;
}

.payments-filter-preview {
    margin-top: 16px;
    margin-bottom: 0;
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}

@media (max-width: 768px) {
    .premium-search-container {
        flex-direction: column;
        align-items: stretch;
    }
    .premium-date-filters {
        justify-content: center;
    }
    .unified-search-select {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
}

/* ==============================================
   SUPERADMIN VIEW & MULTI-TENANT CONTRAST FIXES
   ============================================== */

/* Ensure any form labels inside .main-container are dark and readable */
.main-container .form-group label {
    color: var(--text-1);
}

/* Superadmin Platform Header */
.superadmin-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.superadmin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.superadmin-header-main {
    min-width: 0;
}

.superadmin-header-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.superadmin-header-icon {
    font-size: 1.8rem;
}

.superadmin-header-title {
    margin: 0;
    font-size: 1.45rem;
    color: #f8fafc;
    font-weight: 700;
}

.superadmin-header-badge {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.superadmin-header-desc {
    margin: 8px 0 0;
    color: #94a3b8;
    font-size: 0.92rem;
}

.superadmin-header-session {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    text-align: right;
}

.superadmin-session-label {
    font-size: 0.8rem;
    color: #94a3b8;
}

.superadmin-session-email {
    font-size: 0.9rem;
    color: #f8fafc;
    font-weight: 600;
}

/* Modern Segmented Control (Pills Switcher) */
.superadmin-segmented-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 14px;
    gap: 6px;
    margin-bottom: 22px;
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
}

.superadmin-segmented-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    user-select: none;
}

.superadmin-segmented-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.5);
}

.superadmin-segmented-btn.active {
    background: #ffffff;
    color: #1e3a8a;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.tab-icon {
    font-size: 1.05rem;
}

.tab-text-short {
    display: none;
}

.tab-text-full {
    display: inline;
}

.superadmin-tab-badge {
    background: #2563eb;
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    margin-left: 2px;
}

/* Superadmin List Header & Search */
.superadmin-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.superadmin-list-title {
    margin: 0;
    font-size: 1.25rem;
    color: #11203a;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.superadmin-list-desc {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: #475569;
}

.superadmin-search-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
}

.superadmin-search-input {
    width: 100%;
    padding: 9px 14px;
    font-size: 0.9rem;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    background: #fff;
    border-radius: 10px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.superadmin-form-panel {
    max-width: 680px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    padding: 26px 28px;
    box-shadow: 0 8px 24px rgba(31, 79, 166, 0.08);
}

.superadmin-form-header {
    margin-bottom: 22px;
}

.superadmin-form-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #11203a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.superadmin-form-header p {
    margin: 6px 0 0;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}

.superadmin-form-panel .form-group {
    margin-bottom: 18px;
}

.superadmin-form-panel .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #11203a !important;
}

.superadmin-form-panel .form-group label .hint {
    color: #64748b;
    font-weight: 400;
    font-size: 0.84rem;
}

.superadmin-form-panel .form-input {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.superadmin-form-panel .form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

