/* ============================================================
   RESET Y BASE
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

/* ============================================================
   HEADER
   ============================================================ */

header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
}

.stats {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.stat {
    font-size: 14px;
    color: #cbd5e1;
}

.stat b {
    color: #38bdf8;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #cbd5e1;
}

.user-info b {
    color: #f1f5f9;
}

.icon-btn,
.logout-btn {
    text-decoration: none;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.icon-btn:hover,
.logout-btn:hover {
    background: #334155;
}

/* ============================================================
   TABS
   ============================================================ */

.tabs {
    display: flex;
    gap: 4px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 0 24px;
    overflow-x: auto;
}

.tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.tab:hover {
    color: #e2e8f0;
}

.tab.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
}

/* ============================================================
   MAIN / TAB-CONTENT
   ============================================================ */

main {
    padding: 24px;
    max-width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   TABLA DE DISPOSITIVOS
   ============================================================ */

#devices-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e293b;
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
}

#devices-table thead {
    background: #0f172a;
}

#devices-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #334155;
}

#devices-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
}

#devices-table tr:last-child td {
    border-bottom: none;
}

#devices-table tr.online td:first-child::before {
    content: "🟢";
    margin-right: 6px;
}

#devices-table tr.offline td:first-child::before {
    content: "🔴";
    margin-right: 6px;
}

#devices-table tr:hover {
    background: #243447;
}

#devices-table code {
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #94a3b8;
    font-family: "Consolas", "Monaco", monospace;
}

/* ============================================================
   GRAFO DE TOPOLOGÍA
   ============================================================ */

.graph-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.graph-btn {
    background: #334155;
    color: #e2e8f0;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.graph-btn:hover {
    background: #475569;
}

.graph-btn.primary {
    background: #3b82f6;
}

.graph-btn.primary:hover {
    background: #2563eb;
}

.graph-btn.danger {
    background: #7f1d1d;
}

.graph-btn.danger:hover {
    background: #991b1b;
}

.graph-hint {
    color: #64748b;
    font-size: 13px;
    margin-left: auto;
}

#network-graph {
    width: 100%;
    height: calc(100vh - 240px);
    min-height: 500px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
}

/* ============================================================
   SECCIÓN DE TRÁFICO
   ============================================================ */

.traffic-title {
    font-size: 17px;
    font-weight: 600;
    color: #f1f5f9;
    margin: 28px 0 14px;
}

.traffic-title:first-of-type {
    margin-top: 0;
}

/* ============================================================
   PANEL VPN
   ============================================================ */

.vpn-traffic-panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 20px;
}

.vpn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid #334155;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.vpn-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #e2e8f0;
}

.vpn-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
    display: inline-block;
}

.vpn-status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse-green 2s infinite;
}

.vpn-status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.vpn-status-text {
    font-size: 13px;
    color: #94a3b8;
}

.vpn-mtu {
    font-size: 12px;
    color: #64748b;
    font-family: "Consolas", "Monaco", monospace;
}

.vpn-section-label {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
    margin: 18px 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vpn-section-label:first-of-type {
    margin-top: 0;
}

.vpn-section-label b {
    color: #38bdf8;
    text-transform: none;
}

/* ============================================================
   VPN — Velocidad instantánea
   ============================================================ */

.vpn-rates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .vpn-rates {
        grid-template-columns: 1fr;
    }
}

.vpn-rate-card {
    background: linear-gradient(135deg, #0f172a 0%, #1a2332 100%);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}

.vpn-rate-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.vpn-rate-card.rx::before {
    background: #38bdf8;
}

.vpn-rate-card.tx::before {
    background: #a78bfa;
}

.vpn-rate-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vpn-rate-value {
    font-size: 24px;
    font-weight: 700;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.vpn-rate-card.rx .vpn-rate-value {
    color: #7dd3fc;
}

.vpn-rate-card.tx .vpn-rate-value {
    color: #c4b5fd;
}

.vpn-rate-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* ============================================================
   WIREGUARD LOCAL (VPS) — NUEVO
   ============================================================ */

.wg-local-panel {
    background: linear-gradient(135deg, #0f2a1d 0%, #1e293b 100%);
    border: 1px solid #166534;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 20px 0;
}

.wg-local-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(22, 101, 52, 0.4);
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.wg-local-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #e2e8f0;
}

.wg-local-iface {
    background: #166534;
    color: #86efac;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: "Consolas", "Monaco", monospace;
    font-weight: 600;
}

.wg-local-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
    display: inline-block;
}

.wg-local-status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse-green 2s infinite;
}

.wg-local-status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.wg-local-meta-header {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #94a3b8;
    font-family: "Consolas", "Monaco", monospace;
}

.wg-local-totals {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

@media (max-width: 768px) {
    .wg-local-totals {
        grid-template-columns: 1fr;
    }
}

.wg-local-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
}

.wg-local-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
}

.wg-local-card.rx::before {
    background: #22c55e;
}

.wg-local-card.tx::before {
    background: #16a34a;
}

.wg-local-card.grand::before {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.wg-local-card.grand {
    background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
    border-color: #166534;
}

.wg-local-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wg-local-value {
    font-size: 20px;
    font-weight: 700;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.wg-local-card.rx .wg-local-value {
    color: #86efac;
}

.wg-local-card.tx .wg-local-value {
    color: #4ade80;
}

.wg-local-card.grand .wg-local-value {
    color: #10b981;
    font-size: 22px;
}

.wg-local-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #94a3b8;
    padding-top: 10px;
    border-top: 1px solid rgba(22, 101, 52, 0.3);
}

.wg-local-meta b {
    color: #86efac;
    font-family: "Consolas", "Monaco", monospace;
}

/* ============================================================
   VPN — Total acumulado (MikroTik)
   ============================================================ */

.vpn-total-totals {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .vpn-total-totals {
        grid-template-columns: 1fr;
    }
}

.vpn-total-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}

.vpn-total-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.vpn-total-card.rx::before {
    background: #38bdf8;
}

.vpn-total-card.tx::before {
    background: #a78bfa;
}

.vpn-total-card.grand::before {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.vpn-total-card.grand {
    background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
    border-color: #166534;
}

.vpn-total-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vpn-total-value {
    font-size: 22px;
    font-weight: 700;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.vpn-total-card.rx .vpn-total-value {
    color: #7dd3fc;
}

.vpn-total-card.tx .vpn-total-value {
    color: #c4b5fd;
}

.vpn-total-card.grand .vpn-total-value {
    color: #86efac;
    font-size: 24px;
}

/* ============================================================
   VPN — Acumulado del mes
   ============================================================ */

.vpn-month-totals {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .vpn-month-totals {
        grid-template-columns: 1fr;
    }
}

.vpn-month-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
}

.vpn-month-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
}

.vpn-month-card.rx::before {
    background: #0ea5e9;
}

.vpn-month-card.tx::before {
    background: #8b5cf6;
}

.vpn-month-card.total::before {
    background: #22c55e;
}

.vpn-month-card.total {
    background: linear-gradient(135deg, #0f2a1d 0%, #0f172a 100%);
    border-color: #14532d;
}

.vpn-month-label {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.vpn-month-value {
    font-size: 18px;
    font-weight: 700;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
}

.vpn-month-card.rx .vpn-month-value {
    color: #38bdf8;
}

.vpn-month-card.tx .vpn-month-value {
    color: #a78bfa;
}

.vpn-month-card.total .vpn-month-value {
    color: #4ade80;
}

/* ============================================================
   VPN — Gráfica histórica
   ============================================================ */

.vpn-chart-container {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px;
    height: 280px;
    position: relative;
}

/* ============================================================
   SELECTOR DE MES
   ============================================================ */

.month-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 14px;
    color: #94a3b8;
}

.month-selector select {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.month-selector select:focus {
    outline: none;
    border-color: #38bdf8;
}

/* ============================================================
   RESUMEN DE TRÁFICO
   ============================================================ */

.traffic-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .traffic-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .traffic-summary {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.summary-card.rx::before {
    background: #38bdf8;
}

.summary-card.tx::before {
    background: #a78bfa;
}

.summary-card.total::before {
    background: #22c55e;
}

.summary-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
}

.summary-card.rx .summary-value {
    color: #7dd3fc;
}

.summary-card.tx .summary-value {
    color: #c4b5fd;
}

.summary-card.total .summary-value {
    color: #86efac;
}

/* ============================================================
   GRÁFICO DE BARRAS
   ============================================================ */

.chart-container {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 20px;
    height: 500px;
    margin-bottom: 20px;
    position: relative;
}

/* ============================================================
   TABLA DE TOP CONSUMIDORES
   ============================================================ */

#traffic-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e293b;
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
}

#traffic-table thead {
    background: #0f172a;
}

#traffic-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid #334155;
}

#traffic-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
}

#traffic-table tr:last-child td {
    border-bottom: none;
}

#traffic-table tr:hover {
    background: #243447;
}

.rank-medal {
    font-size: 18px;
}

/* ============================================================
   MÓDULO DE PAGOS
   ============================================================ */

.payments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.payments-month-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #94a3b8;
}

.payments-month-selector select {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.payments-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: #334155;
    color: #e2e8f0;
    border: none;
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    background: #475569;
}

.action-btn.primary {
    background: #3b82f6;
    color: white;
}

.action-btn.primary:hover {
    background: #2563eb;
}

.action-btn.danger {
    background: #7f1d1d;
}

.action-btn.danger:hover {
    background: #991b1b;
}

/* ============================================================
   RESUMEN DE PAGOS
   ============================================================ */

.payments-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .payments-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .payments-summary {
        grid-template-columns: 1fr;
    }
}

.pay-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-left: 4px solid #22c55e;
    border-radius: 10px;
    padding: 16px;
}

.pay-card.warning {
    border-left-color: #fbbf24;
}

.pay-card.danger {
    border-left-color: #ef4444;
}

.pay-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.pay-value {
    font-size: 22px;
    font-weight: 700;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
}

.pay-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* ============================================================
   BREAKDOWN DE MONEDAS
   ============================================================ */

.currency-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .currency-breakdown {
        grid-template-columns: 1fr;
    }
}

.currency-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 18px;
}

.currency-card.usd-card {
    border-top: 4px solid #3b82f6;
}

.currency-card.mn-card {
    border-top: 4px solid #f59e0b;
}

.currency-card.total-card {
    border-top: 4px solid #22c55e;
    background: linear-gradient(135deg, #0f2a1d 0%, #1e293b 100%);
}

.currency-flag {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 8px;
}

.currency-total {
    font-size: 24px;
    font-weight: 700;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}

.currency-sub {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.7;
}

.currency-sub b {
    color: #38bdf8;
}

/* ============================================================
   ALERTA DE VENCIDOS
   ============================================================ */

.overdue-alert {
    background: rgba(127, 29, 29, 0.2);
    border: 1px solid #7f1d1d;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 24px;
}

.overdue-alert h3 {
    font-size: 15px;
    color: #fca5a5;
    margin-bottom: 14px;
}

.overdue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.overdue-table th {
    text-align: left;
    padding: 8px 10px;
    color: #fca5a5;
    font-weight: 600;
    border-bottom: 1px solid #7f1d1d;
    font-size: 12px;
    text-transform: uppercase;
}

.overdue-table td {
    padding: 8px 10px;
    color: #fecaca;
    border-bottom: 1px solid rgba(127, 29, 29, 0.3);
}

.overdue-table tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   GRÁFICA DE RECAUDACIÓN MENSUAL
   ============================================================ */

.chart-month-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 20px;
}

@media (max-width: 800px) {
    .chart-month-container {
        grid-template-columns: 1fr;
    }
}

.chart-month-canvas {
    position: relative;
    height: 280px;
}

.chart-month-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.revenue-total-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    text-align: center;
}

.revenue-total-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.revenue-total-value {
    font-size: 22px;
    font-weight: 700;
    color: #22c55e;
    font-variant-numeric: tabular-nums;
}

.revenue-legend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.revenue-legend-item {
    display: grid;
    grid-template-columns: 12px 1fr auto auto;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: #cbd5e1;
    padding: 6px 10px;
    border-radius: 6px;
    background: #0f172a;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-label {
    color: #94a3b8;
}

.legend-value {
    color: #e2e8f0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.legend-pct {
    color: #64748b;
    font-size: 12px;
    min-width: 45px;
    text-align: right;
}

/* ============================================================
   MÉTODOS DE PAGO
   ============================================================ */

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.method-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.method-name {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.method-value {
    font-size: 18px;
    font-weight: 700;
    color: #22c55e;
    font-variant-numeric: tabular-nums;
}

.method-count {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* ============================================================
   TABLA DE PAGOS
   ============================================================ */

.payments-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e293b;
    border-radius: 10px;
    overflow: hidden;
    font-size: 13px;
    margin-bottom: 24px;
}

.payments-table thead {
    background: #0f172a;
}

.payments-table th {
    padding: 11px 12px;
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid #334155;
}

.payments-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
}

.payments-table tr:last-child td {
    border-bottom: none;
}

.payments-table tr:hover {
    background: #243447;
}

.status-paid {
    color: #22c55e;
    font-weight: 600;
}

.status-partial {
    color: #fbbf24;
    font-weight: 600;
}

.status-pending {
    color: #94a3b8;
    font-weight: 600;
}

.status-overdue {
    color: #ef4444;
    font-weight: 600;
}

/* ============================================================
   FILTRO DE PAGOS
   ============================================================ */

.payments-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #94a3b8;
    flex-wrap: wrap;
}

.payments-filter select {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 7px 11px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* ============================================================
   MODALES
   ============================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #334155;
}

.modal-header h2 {
    font-size: 17px;
    color: #f1f5f9;
}

.modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #334155;
    color: #e2e8f0;
}

.modal-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-body label {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
}

.modal-body input,
.modal-body select {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 7px;
    padding: 9px 12px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #334155;
}

.modal-error {
    color: #fca5a5;
    font-size: 13px;
    min-height: 18px;
    margin-top: 6px;
}

.pay-info-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.8;
    margin-bottom: 6px;
}

.pay-info-box b {
    color: #94a3b8;
}

/* ============================================================
   TABLA DE PLANES
   ============================================================ */

.plans-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.plans-table th {
    text-align: left;
    padding: 8px 10px;
    color: #94a3b8;
    border-bottom: 1px solid #334155;
    font-size: 11px;
    text-transform: uppercase;
}

.plans-table td {
    padding: 8px 10px;
    color: #cbd5e1;
    border-bottom: 1px solid #1e293b;
}

.plans-table button {
    background: #7f1d1d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.plans-table button:hover {
    background: #991b1b;
}

/* ============================================================
   LOGIN
   ============================================================ */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-logo {
    font-size: 56px;
    margin-bottom: 12px;
    line-height: 1;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 24px;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    text-align: left;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.login-form label {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 4px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 11px 14px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-form input::placeholder {
    color: #64748b;
}

.login-form button[type="submit"] {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
    transition: background 0.2s, transform 0.1s;
}

.login-form button[type="submit"]:hover {
    background: #2563eb;
}

.login-form button[type="submit"]:active {
    transform: scale(0.98);
}

/* ============================================================
   CHANGE PASSWORD
   ============================================================ */

.change-password-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 20px;
}

.change-password-container {
    width: 100%;
    max-width: 480px;
}

.change-password-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.change-password-card h1 {
    font-size: 22px;
    color: #f1f5f9;
    margin-bottom: 6px;
    text-align: center;
}

.change-password-card .subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 24px;
    text-align: center;
}

.change-password-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.change-password-card label {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

.change-password-card input {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 11px 14px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
}

.change-password-card input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.change-password-card button[type="submit"] {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 12px;
    transition: background 0.2s;
}

.change-password-card button[type="submit"]:hover {
    background: #2563eb;
}

.change-password-card .back-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
}

.change-password-card .back-link:hover {
    color: #38bdf8;
}

.change-password-card .error-msg {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
}

.change-password-card .success-msg {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid #22c55e;
    color: #86efac;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}