* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f5f8;
    color: #222;
}

/* =========================
   LOGIN
========================= */

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 24px;
    background: linear-gradient(135deg, #201033, #4b168c);
}

.login-card {
    width: min(92vw, 420px);
    background: #fff;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.login-card h1 {
    margin: 0;
    font-size: 42px;
    color: #4b168c;
}

.login-card p {
    margin-top: 8px;
    margin-bottom: 24px;
    color: #555;
}

.login-card label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: bold;
}

.login-card input {
    width: 100%;
    padding: 11px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.login-card button {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #5b1ca6;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.login-card button:hover {
    background: #43137d;
}

@media (max-width: 768px) {
    .login-card {
        width: calc(100vw - 8px) !important;
        margin: 4px !important;
        padding: 20px !important;
        border-radius: 12px;
        box-sizing: border-box;
    }
}

/* =========================
   LAYOUT GENERAL
========================= */

.topbar {
    min-height: 64px;
    background: #201033;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 0 28px;
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar strong {
    font-size: 24px;
    margin-right: 8px;
}

.topbar span {
    font-size: 13px;
    opacity: 0.75;
}

.topbar a {
    color: white;
    text-decoration: none;
    margin-left: 18px;
    font-weight: bold;
    white-space: nowrap;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 24px;
    white-space: nowrap;
}

.topbar nav a {
    margin-left: 0;
}

.topbar-user {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    margin-right: 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.1;
    opacity: 0.95;
}

.topbar-user small {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.75;
    text-transform: uppercase;
}

.main-content {
    padding: 36px 40px;
}

.content {
    padding: 32px;
}

.content h1 {
    margin-top: 0;
}

.mobile-content {
    max-width: 760px;
    margin: 0 auto;
}

/* =========================
   COMPONENTES GENERALES
========================= */

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 10px;
    margin: 14px 0;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 12px 14px;
    border-radius: 10px;
    margin: 14px 0;
}

.help-text,
.text-muted {
    color: #6b7280;
    font-size: 14px;
}

.footer {
    padding: 20px 40px;
    color: #6b7280;
    font-size: 14px;
}

.btn-primary {
    display: inline-block;
    background: #4b1d95;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
}

.btn-primary:hover {
    background: #35116f;
}

.btn-light {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 12px;
    background: #ffffff;
    color: #3d147c;
    border: 1px solid #ddd6f3;
    text-decoration: none;
    font-weight: 700;
}

.btn-light:hover {
    background: #f7f3ff;
}

.btn-secondary {
    display: inline-block;
    text-align: center;
    padding: 14px 18px;
    border-radius: 14px;
    background: #eee7fa;
    color: #4b168c;
    text-decoration: none;
    font-weight: bold;
}

.btn-secondary:hover {
    background: #e0d4ff;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0 26px 0;
    align-items: center;
}

.status-badge,
.badge-soon {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: #f1eaff;
    color: #35116f;
}

.status-recibido {
    background: #f1eaff;
    color: #35116f;
}

/* =========================
   CARDS / DASHBOARD GENERAL
========================= */

.cards {
    display: flex;
    gap: 22px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.card {
    flex: 1;
    min-width: 260px;
}

.card h2 {
    margin-top: 0;
    color: #4b168c;
}

.card span {
    display: inline-block;
    margin-top: 12px;
    padding: 7px 12px;
    background: #eee7fa;
    color: #4b168c;
    border-radius: 999px;
    font-weight: bold;
    font-size: 13px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 28px;
}

.module-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    min-height: 160px;
}

.module-card h2 {
    color: #4b1d95;
    margin-top: 0;
}

.info-box {
    background: #ffffff;
    margin-top: 28px;
    padding: 22px 24px;
    border-radius: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.summary-card {
    background: #f7f3ff;
    border-radius: 16px;
    padding: 18px 20px;
}

.summary-card span {
    display: block;
    color: #5f4b8b;
    font-size: 14px;
    margin-bottom: 8px;
}

.summary-card strong {
    display: block;
    color: #1f1538;
    font-size: 24px;
}

.insight-list {
    margin: 16px 0 0 0;
    padding-left: 22px;
}

.insight-list li {
    margin-bottom: 12px;
    line-height: 1.5;
}

/* =========================
   TABLAS / FORMULARIOS
========================= */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    margin-top: 20px;
    border-radius: 14px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.data-table th {
    background: #f3f0ff;
    color: #35116f;
    font-weight: 700;
}

.form-card {
    max-width: 520px;
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    margin-top: 20px;
}

.form-card label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: 700;
}

.form-card input,
.form-card select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
}

.form-card button {
    margin-top: 20px;
    background: #4b1d95;
    color: #ffffff;
    border: none;
    padding: 11px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.form-card button:hover {
    background: #35116f;
}

/* =========================
   NXIA CLIC - INICIO
========================= */

.summary-box {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.summary-box div {
    background: white;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.summary-box span {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.summary-box strong {
    font-size: 24px;
    color: #4b168c;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    margin: 24px 0;
    align-items: stretch;
}

.btn-main {
    display: block;
    text-align: center;
    padding: 18px;
    border-radius: 16px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 20px;
}

.btn-main.expense {
    background: #b42318;
}

.btn-main.income {
    background: #067647;
}

.dashboard-action {
    margin: 0 0 24px 0;
}

/* =========================
   NXIA CLIC - RESUMEN DIARIO
========================= */

.daily-summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.daily-summary-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.daily-summary-card strong {
    display: block;
    margin-bottom: 10px;
    color: #201033;
}

.daily-numbers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #555;
    font-size: 14px;
}

/* =========================
   NXIA CLIC - MOVIMIENTOS
========================= */

.movement-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.movement-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.movement-card small {
    display: block;
    color: #777;
    margin-top: 4px;
}

.movement-card p {
    margin: 8px 0 0 0;
    color: #444;
}

.movement-amount {
    font-weight: bold;
    white-space: nowrap;
    font-size: 18px;
}

.movement-amount.ingreso {
    color: #067647;
}

.movement-amount.gasto {
    color: #b42318;
}

.map-link,
.receipt-link {
    display: inline-block;
    margin-top: 8px;
    color: #4b168c;
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
}

.empty-state {
    background: white;
    padding: 24px;
    border-radius: 16px;
    color: #666;
    text-align: center;
}

/* =========================
   NXIA CLIC - FORMULARIO
========================= */

.mobile-form {
    background: white;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.mobile-form label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-weight: bold;
}

.mobile-form input,
.mobile-form select,
.mobile-form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 18px;
}

.gps-box {
    margin-top: 18px;
    padding: 14px;
    background: #f4f1fa;
    border-radius: 14px;
}

.btn-gps {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #4b168c;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.gps-box small {
    display: block;
    margin-top: 10px;
    color: #555;
}

.btn-save {
    width: 100%;
    margin-top: 22px;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: #201033;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.btn-cancel {
    display: block;
    margin-top: 14px;
    text-align: center;
    color: #4b168c;
    text-decoration: none;
    font-weight: bold;
}

/* =========================
   NXIA CLIC - DASHBOARD
========================= */

.summary-period-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.summary-period-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.summary-period-card h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.summary-period-card small {
    display: block;
    color: #777;
    margin-bottom: 14px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    font-size: 15px;
}

.summary-line strong {
    font-size: 16px;
    white-space: nowrap;
}

.summary-line.balance {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 12px;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.dashboard-row {
    background: white;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.dashboard-row span {
    color: #333;
    font-weight: bold;
}

.dashboard-row strong {
    color: #b42318;
    white-space: nowrap;
}

.dashboard-row.income-row strong {
    color: #067647;
}

.weekly-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.weekly-card strong {
    display: block;
    color: #201033;
}

.weekly-card small {
    display: block;
    color: #777;
    margin: 4px 0 10px 0;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {
    .module-grid,
    .summary-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .summary-period-grid {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .topbar {
        height: auto;
        min-height: 86px;
        padding: 28px 20px 12px;
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }
    .header-logo {
        height: 42px;
        max-width: 150px;
    }

    .topbar strong {
        font-size: 22px;
    }

    .topbar nav {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 16px;
        white-space: normal;
    }

    .topbar a {
        margin-left: 0;
        font-size: 15px;
    }

    .topbar-user {
        align-items: flex-start;
        margin-right: 0;
    }

    .main-content {
        padding: 24px 18px;
    }

    .content {
        padding: 0;
    }

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

    .content h1,
    .mobile-content h1 {
        font-size: 32px;
        line-height: 1.12;
        margin-bottom: 12px;
    }

    .content h2,
    .mobile-content h2 {
        font-size: 24px;
        line-height: 1.15;
        margin-top: 26px;
        margin-bottom: 16px;
    }

    .content p,
    .mobile-content p {
        font-size: 17px;
        line-height: 1.35;
    }

    .cards,
    .module-grid,
    .summary-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .summary-box {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 20px 0;
    }

    .summary-box div {
        padding: 15px 18px;
        border-radius: 16px;
    }

    .summary-box span {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .summary-box strong {
        font-size: 24px;
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin: 20px 0;
    }

    .quick-actions .btn-secondary {
        grid-column: 1 / -1;
    }

    .btn-main {
        padding: 13px 10px;
        font-size: 16px;
        border-radius: 14px;
    }

    .btn-secondary {
        padding: 12px 14px;
        font-size: 15px;
        border-radius: 13px;
    }

    .daily-summary-card {
        padding: 14px 16px;
    }

    .daily-summary-card strong {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .daily-numbers {
        font-size: 15px;
        gap: 3px;
    }

    .movement-card {
        padding: 13px 14px;
        gap: 12px;
        align-items: flex-start;
    }

    .movement-card p {
        margin-top: 5px;
        font-size: 14px;
        line-height: 1.25;
    }

    .movement-card small {
        font-size: 12px;
    }

    .movement-amount {
        font-size: 15px;
    }

    .map-link,
    .receipt-link {
        font-size: 13px;
        margin-top: 6px;
    }

    .mobile-form {
        padding: 18px;
        border-radius: 16px;
    }

    .mobile-form input,
    .mobile-form select,
    .mobile-form textarea {
        padding: 12px;
        font-size: 16px;
    }

    .summary-period-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 20px 0;
    }

    .summary-period-card {
        padding: 15px 18px;
        border-radius: 16px;
    }

    .summary-period-card h2 {
        font-size: 20px;
    }

    .summary-period-card small {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .summary-line {
        font-size: 16px;
        margin: 5px 0;
    }

    .summary-line strong {
        font-size: 16px;
    }

    .dashboard-row,
    .weekly-card {
        padding: 14px 16px;
    }

    .footer {
        padding: 18px;
    }
}

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

    .content h1,
    .mobile-content h1 {
        font-size: 30px;
    }

    .content h2,
    .mobile-content h2 {
        font-size: 23px;
    }

    .summary-box strong {
        font-size: 23px;
    }

    .btn-main {
        font-size: 15px;
        padding: 12px 8px;
    }

    .summary-period-card h2 {
        font-size: 19px;
    }
}

.chart-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.chart-row {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.chart-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.chart-row-header span {
    font-weight: 700;
    color: #222;
}

.chart-row-header strong {
    white-space: nowrap;
    color: #b42318;
}

.chart-bar-bg {
    width: 100%;
    height: 9px;
    background: #f1f1f4;
    border-radius: 999px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 999px;
}

.chart-bar-fill.expense {
    background: #d96b5f;
}

.chart-bar-fill.income {
    background: #067647;
}

@media (max-width: 768px) {
    .chart-row {
        padding: 13px 14px;
    }

    .chart-row-header span {
        font-size: 15px;
    }

    .chart-row-header strong {
        font-size: 15px;
    }

    .chart-bar-bg {
        height: 8px;
    }
}

.chart-amount {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
    color: #a94442;
}

.chart-amount small {
    font-size: 0.85em;
    font-weight: 700;
    color: #a94442;
    opacity: 0.9;
}

.period-selector {
    display: inline-flex;
    gap: 8px;
    background: #ffffff;
    border-radius: 16px;
    padding: 6px;
    margin: 18px 0 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.period-selector a {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #4b168c;
    font-weight: 700;
}

.period-selector a.active {
    background: #4b168c;
    color: #ffffff;
}

.period-label {
    color: #666;
    font-size: 14px;
    margin: 4px 0 20px;
}

.period-label strong {
    color: #201033;
}

@media (max-width: 768px) {
    .period-selector {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .period-selector a {
        text-align: center;
        padding: 12px 10px;
    }

    .period-label {
        font-size: 13px;
    }
}

#analisis-periodo {
    scroll-margin-top: 60px;
}

.movement-list.compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.movement-row {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 5px 16px rgba(0,0,0,0.055);
}

.movement-info {
    min-width: 0;
}

.movement-top-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
}

.movement-category {
    font-size: 15.5px;
    color: #201033;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movement-row .movement-amount {
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

.movement-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12.5px;
    line-height: 1.35;
}

.movement-icon-link {
    color: #4b168c;
    text-decoration: none;
    font-size: 17px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    padding: 0 2px;
}

@media (max-width: 768px) {
    .movement-icon-link {
        font-size: 18px;
        padding: 0 3px;
    }
}

.movement-comment {
    margin-top: 5px;
    color: #444;
    font-size: 13px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .movement-row {
        padding: 12px 13px;
    }

    .movement-category {
        font-size: 15px;
    }

    .movement-row .movement-amount {
        font-size: 15.5px;
    }

    .movement-meta-line {
        font-size: 12px;
    }
}

.view-selector {
    display: inline-flex;
    gap: 8px;
    background: #ffffff;
    border-radius: 16px;
    padding: 6px;
    margin: 8px 0 22px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.view-selector a {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #4b168c;
    font-weight: 700;
}

.view-selector a.active {
    background: #4b168c;
    color: #ffffff;
}

@media (max-width: 768px) {
    .view-selector {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }

    .view-selector a {
        text-align: center;
        padding: 12px 10px;
    }
}

.dashboard-action {
    margin: 28px 0 24px;
}

.dashboard-action .btn-secondary {
    display: block;
    width: 100%;
    max-width: 360px;
    text-align: center;
    padding: 14px 18px;
}

.dashboard-action .btn-secondary {
    display: block;
    width: 100%;
    max-width: 360px;
    text-align: center;
    padding: 14px 18px;
}

@media (max-width: 768px) {
    .dashboard-action .btn-secondary {
        max-width: none;
    }
}

#ultimos-movimientos {
    scroll-margin-top: 60px;
}

.load-more-box {
    margin: 16px 0 28px;
}

.load-more-box .btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
}

.seller-header-compact {
    background: #fff;
    border-radius: 18px;
    padding: 22px 30px;
    margin-bottom: 24px;
    border-left: 6px solid #4b168c;
}

.seller-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
}

.seller-header-title h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.1;
}

.seller-header-title h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.2;
    color: #4b168c;
    font-weight: 700;
}

.seller-header-meta {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.seller-header-meta div {
    background: #f4efff;
    border-radius: 14px;
    padding: 12px 16px;
    min-width: 230px;
}

.seller-header-meta span {
    display: block;
    color: #4b168c;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.seller-header-meta strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.seller-header-actions {
    margin-top: 14px;
}

.seller-header-actions a {
    display: inline-block;
    background: #4b168c;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.seller-header-actions a:hover {
    opacity: 0.9;
}

@media (max-width: 900px) {
    .seller-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .seller-header-meta {
        justify-content: flex-start;
        width: 100%;
    }

    .seller-header-meta div {
        min-width: 100%;
    }
}

.goal-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 28px;
    align-items: stretch;
}

.goal-table-wrap {
    min-width: 0;
}


.compact-table th,
.compact-table td {
    padding: 10px 12px;
    font-size: 14px;
}

.compact-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.goal-chart-card {
    background: #f8f4ff;
    border-radius: 18px;
    padding: 22px 24px;
}

.goal-chart-card h3 {
    margin-top: 0;
}

.vertical-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 18px;
    height: 230px;
    margin-top: 18px;
}

.vertical-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 70px;
}

.vertical-bar-track {
    width: 42px;
    height: 150px;
    background: #e9ddff;
    border-radius: 999px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.vertical-bar-fill {
    width: 100%;
    background: #4b168c;
    border-radius: 999px;
}

.vertical-bar-item strong {
    font-size: 16px;
}

.vertical-bar-item span {
    font-size: 13px;
    color: #4b5563;
}

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

    .vertical-chart {
        height: 210px;
    }
}

.dual-chart {
    align-items: flex-end;
}

.dual-bar-item {
    min-width: 90px;
}

.dual-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.dual-bars .vertical-bar-track {
    width: 28px;
}

.sale-fill {
    background: #4b168c;
}

.kg-fill {
    background: #8b5cf6;
}

.dual-percent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.dual-percent strong {
    font-size: 13px;
    line-height: 1.1;
} 

/* Mi cartera atendida + avance del mes */
.seller-care-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.seller-care-left {
    min-width: 0;
}

.seller-care-right {
    background: #f8f4ff;
    border-radius: 18px;
    padding: 22px 24px;
}

.seller-care-right h3 {
    margin-top: 0;
}

.seller-care-right .progress-box {
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px;
    margin-top: 16px;
}

.seller-care-right .progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.seller-care-right .progress-head span {
    color: #4b168c;
    font-weight: 700;
}

.seller-care-right .progress-head strong {
    font-size: 22px;
}

.seller-care-right .progress-bar {
    width: 100%;
    height: 14px;
    background: #e9ddff;
    border-radius: 999px;
    overflow: hidden;
    display: block;
}

.seller-care-right .progress-fill {
    height: 100%;
    background: #4b168c;
    border-radius: 999px;
    display: block;
}

.seller-care-right .progress-detail {
    margin: 8px 0 0;
    font-size: 14px;
    color: #4b5563;
}

@media (max-width: 900px) {
    .seller-care-grid {
        grid-template-columns: 1fr;
    }
}

.category-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 28px;
    align-items: start;
}

.category-table-wrap {
    min-width: 0;
}

.category-chart-card {
    background: #f8f4ff;
    border-radius: 18px;
    padding: 22px 24px;
}

.category-chart-card h3 {
    margin-top: 0;
}

.donut-wrap {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.donut-chart {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    position: relative;
}

.donut-chart::after {
    content: "";
    position: absolute;
    inset: 42px;
    background: #f8f4ff;
    border-radius: 50%;
}

.donut-center {
    position: absolute;
    inset: 42px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-center span {
    color: #4b168c;
    font-size: 13px;
    font-weight: 700;
}

.donut-center strong {
    font-size: 18px;
    line-height: 1.1;
}

.donut-legend {
    display: grid;
    gap: 9px;
}

.donut-legend-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

.donut-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.donut-legend-item strong {
    color: #111827;
}

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

/* Bloques con pestañas */
.tab-section {
    margin-bottom: 28px;
}

.tab-header {
    margin-bottom: 18px;
}

.tab-header h2 {
    margin-bottom: 6px;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.tab-button {
    border: 0;
    background: #f4efff;
    color: #4b168c;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
}

.tab-button.active {
    background: #4b168c;
    color: #fff;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel h3 {
    margin-top: 0;
}

/* Impresión / PDF: mostrar todo aunque esté en pestañas */
@media print {
    .tab-buttons {
        display: none !important;
    }

    .tab-panel {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 24px;
    }

    .tab-panel h3 {
        margin-top: 18px;
        border-bottom: 1px solid #ddd;
        padding-bottom: 6px;
    }
}

/* Clientes únicos por mes */
.monthly-clients-grid {
    display: grid;
    grid-template-columns: 1fr 0.9fr;
    gap: 28px;
    align-items: stretch;
}

.monthly-chart-card,
.monthly-table-card {
    background: #f8f4ff;
    border-radius: 18px;
    padding: 22px 24px;
}

.monthly-chart-card h3,
.monthly-table-card h3 {
    margin-top: 0;
}

.monthly-bar-chart {
    height: 260px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 34px;
    margin-top: 18px;
    padding: 12px 0;
}

.monthly-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    gap: 8px;
}

.monthly-bars {
    height: 150px;
    display: flex;
    align-items: flex-end;
    gap: 9px;
}

.monthly-bar-track {
    width: 34px;
    height: 150px;
    background: #e9ddff;
    border-radius: 999px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.monthly-bar-fill {
    width: 100%;
    border-radius: 999px;
}

.clients-fill {
    background: #4b168c;
}

.invoices-fill {
    background: #8b5cf6;
}

.monthly-bar-values {
    text-align: center;
    line-height: 1.15;
}

.monthly-bar-values strong {
    display: block;
    font-size: 20px;
    color: #111827;
}

.monthly-bar-values span {
    display: block;
    font-size: 13px;
    color: #4b5563;
}

.monthly-bar-label {
    color: #4b5563;
    font-weight: 700;
    font-size: 14px;
}

.monthly-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 14px;
    color: #4b5563;
}

.legend-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
}

.clients-dot {
    background: #4b168c;
}

.invoices-dot {
    background: #8b5cf6;
}

@media (max-width: 900px) {
    .monthly-clients-grid {
        grid-template-columns: 1fr;
    }

    .monthly-bar-chart {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 16px;
    }
}

.tabs-reactivados {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 16px 0 18px;
    padding-bottom: 6px;
}

.tab-reactivado {
    border: 1px solid #ded4f5;
    background: #fff;
    color: #35106d;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.tab-reactivado.activo {
    background: #4b148c;
    color: #fff;
    border-color: #4b148c;
}

.vista-reactivados {
    display: none;
}

.vista-reactivados.activa {
    display: block;
}

.grupo-vendedor-reactivado {
    margin-bottom: 24px;
}

.grupo-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: #f1ebff;
    border-radius: 12px 12px 0 0;
    padding: 12px 16px;
    color: #2d0566;
    font-size: 14px;
}

.grupo-header div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.grupo-header span {
    font-size: 12px;
    color: #6b5a8f;
}

.mini-link {
    font-size: 12px;
    font-weight: 600;
    color: #4b148c;
    text-decoration: none;
    white-space: nowrap;
}

.mini-link:hover {
    text-decoration: underline;
}

/* Ajustes finos - Clientes reactivados por vendedor */
.grupo-vendedor-reactivado {
    margin-bottom: 28px;
}

.grupo-vendedor-reactivado .data-table {
    margin-top: 0;
    border-radius: 0 0 14px 14px;
}

.grupo-header {
    margin-bottom: 0;
}

.grupo-header + .data-table {
    margin-top: 0;
}

.mini-link {
    opacity: 0.85;
}

.mini-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Pestañas más compactas para muchos vendedores */
.tab-reactivado {
    padding: 8px 13px;
    font-size: 12.5px;
}

/* Mejor respiración en pantallas pequeñas */
@media (max-width: 768px) {
    .tabs-reactivados {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .tab-reactivado {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: 12px;
    }

    .grupo-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .mini-link {
        white-space: normal;
    }
}

.grupo-vendedor-reactivado {
    border-radius: 14px;
    overflow: hidden;
}

.grupo-vendedor-reactivado .data-table th {
    background: #f3f0ff;
}

/* Ventas por vendedor - enlace gerencial */
.seller-link-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.seller-link-cell strong {
    color: #111827;
    font-weight: 700;
}

.seller-report-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: #f4efff;
    color: #4b168c;
    border: 1px solid #ded4f5;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.seller-report-link:hover {
    background: #4b168c;
    color: #ffffff;
    border-color: #4b168c;
    text-decoration: none;
}

@media (max-width: 768px) {
    .seller-link-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

.daily-summary-list.compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.daily-summary-row {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 5px 16px rgba(0,0,0,0.055);
}

.daily-summary-main {
    min-width: 0;
}

.daily-summary-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
}

.daily-summary-top strong {
    font-size: 15.5px;
    color: #201033;
}

.daily-balance {
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

.daily-balance.positive {
    color: #067647;
}

.daily-balance.negative {
    color: #b42318;
}

.daily-summary-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12.5px;
    line-height: 1.35;
}

@media (max-width: 768px) {
    .daily-summary-row {
        padding: 12px 13px;
    }

    .daily-summary-top strong {
        font-size: 15px;
    }

    .daily-balance {
        font-size: 15.5px;
    }

    .daily-summary-meta {
        font-size: 12px;
    }
}

.monthly-history-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 24px 0;
}

.monthly-history-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.monthly-history-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.monthly-history-top strong {
    display: block;
    color: #201033;
    font-size: 18px;
}

.monthly-history-top small {
    display: block;
    color: #6b7280;
    margin-top: 4px;
    font-size: 13px;
}

.monthly-balance {
    font-weight: 800;
    font-size: 18px;
    white-space: nowrap;
}

.monthly-balance.positive {
    color: #067647;
}

.monthly-balance.negative {
    color: #b42318;
}

.monthly-history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    border-top: 1px solid #eeeeee;
    padding-top: 14px;
}

.monthly-history-grid span {
    display: block;
    color: #6b7280;
    font-size: 12.5px;
    margin-bottom: 4px;
}

.monthly-history-grid strong {
    color: #222;
    font-size: 15px;
}

.monthly-history-actions {
    margin-top: 14px;
}

.monthly-history-actions a {
    display: inline-block;
    color: #4b168c;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}

@media (max-width: 768px) {
    .monthly-history-card {
        padding: 14px;
    }

    .monthly-history-top strong {
        font-size: 16px;
    }

    .monthly-balance {
        font-size: 16px;
    }

    .monthly-history-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.monthly-metrics {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 1px solid #eeeeee;
    padding-top: 14px;
}

.monthly-metric {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.monthly-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
}

.monthly-metric-header span {
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
}

.monthly-metric-header strong {
    color: #222;
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
}

.monthly-metric-header .monthly-income {
    color: #067647;
}

.monthly-metric-header .monthly-expense {
    color: #a94442;
}

.monthly-bar-bg {
    width: 100%;
    height: 9px;
    background: #f1f1f4;
    border-radius: 999px;
    overflow: hidden;
}

.monthly-bar-fill {
    height: 100%;
    border-radius: 999px;
}

.monthly-bar-fill.income {
    background: #4aa879;
}

.monthly-bar-fill.expense {
    background: #d96b5f;
}

.monthly-bar-fill.movement {
    background: #5bbfc0;
}

@media (max-width: 768px) {
    .monthly-metric-header strong {
        font-size: 17px;
    }

    .monthly-metric-header span {
        font-size: 13px;
    }

    .monthly-bar-bg {
        height: 8px;
    }
}

.movement-detail-link {
    color: #4b168c;
    text-decoration: none;
    font-weight: 700;
    font-size: 12.5px;
}

.movement-detail-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .movement-detail-link {
        font-size: 12px;
    }
}

.movement-detail-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px;
    margin: 24px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

.movement-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.movement-detail-type {
    display: inline-block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.movement-detail-header h2 {
    margin: 0;
    color: #201033;
}

.movement-detail-amount {
    font-size: 24px;
    font-weight: 900;
    white-space: nowrap;
}

.movement-detail-amount.ingreso {
    color: #067647;
}

.movement-detail-amount.gasto {
    color: #b42318;
}

.movement-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.movement-detail-grid div,
.movement-detail-section {
    background: #f7f7fa;
    border-radius: 14px;
    padding: 14px;
}

.movement-detail-grid span,
.movement-detail-section span {
    display: block;
    color: #6b7280;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 5px;
}

.movement-detail-grid strong {
    color: #222;
    font-size: 15px;
}

.movement-detail-section {
    margin-top: 12px;
}

.movement-detail-section p {
    margin: 0;
    color: #333;
    line-height: 1.45;
}

.movement-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0;
}

@media (max-width: 768px) {
    .movement-detail-card {
        padding: 16px;
    }

    .movement-detail-header {
        flex-direction: column;
        gap: 8px;
    }

    .movement-detail-amount {
        font-size: 22px;
    }

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

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

.movement-detail-card + .dashboard-action .btn-secondary {
    max-width: 360px;
}

.dashboard-action .btn-secondary {
    display: block;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.footer {
    margin-top: 40px;
    padding: 18px 20px;
    color: #8a8a96;
    font-size: 12.5px;
    text-align: center;
}

.footer a.footer-link {
    color: #8a8a96;
    text-decoration: none;
    font-weight: 600;
}

.footer a.footer-link:hover {
    color: #4b168c;
    text-decoration: underline;
}

.footer-separator {
    margin: 0 6px;
    color: #b0b0b8;
}

.dashboard-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 28px 0;
    max-width: 900px;
}

.dashboard-actions-row .btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
}

@media (max-width: 768px) {
    .dashboard-actions-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .dashboard-action .btn-secondary {
        max-width: none;
    }
}
.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.account-row {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 5px 16px rgba(0,0,0,0.055);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.account-row.inactive {
    opacity: 0.55;
}

.account-main {
    flex: 1;
    min-width: 0;
}

.account-top-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
}

.account-top-line strong {
    font-size: 15.5px;
    color: #201033;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-balance {
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

.account-balance.positive {
    color: #067647;
}

.account-balance.negative {
    color: #b42318;
}

.account-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12.5px;
    line-height: 1.35;
}

.account-actions {
    flex: 0 0 auto;
}

@media (max-width: 768px) {
    .account-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-top-line {
        width: 100%;
    }

    .account-actions {
        width: 100%;
    }
}

.field-help {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12.5px;
    line-height: 1.35;
}

.form-check-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 5px 16px rgba(0,0,0,0.045);
}

.form-check-card label {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.form-check-card input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
}

.form-check-card strong {
    display: block;
    color: #201033;
    font-size: 15px;
    line-height: 1.25;
}

.form-check-card small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12.5px;
    line-height: 1.35;
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    width: 100%;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 18px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        max-width: none;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }
}

.form-card .form-actions {
    align-items: center;
}

.form-card .form-actions button.btn-primary,
.form-card .form-actions a.btn-secondary {
    margin: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 18px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box;
    line-height: 1 !important;
}

.btn-primary,
.btn-secondary,
.btn-light,
.btn-save,
.btn-cancel,
.btn-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
}

.btn-secondary {
    min-height: 54px;
    padding: 0 18px;
}

.quick-actions .btn-secondary {
    height: 100%;
    min-height: 66px;
}

.dashboard-actions-row .btn-secondary,
.dashboard-action .btn-secondary,
.load-more-box .btn-secondary {
    min-height: 54px;
    padding: 0 18px;
}

.btn-cancel {
    min-height: 50px;
    padding: 0 18px;
    border-radius: 14px;
    background: #eee7fa;
    color: #4b168c;
    font-weight: 700;
}
.dashboard-actions-row .btn-secondary,
.dashboard-action .btn-secondary,
.load-more-box .btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 18px;
    line-height: 1.1;
}

.mobile-form .btn-cancel {
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    margin-top: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;
    background: #eee7fa;
    color: #4b168c;
    font-weight: 700;
    line-height: 1.1;
}

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

.brand strong {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
}

.brand span {
    font-size: 16px;
    color: rgba(255,255,255,.75);
}

.brand-logo {
    height: 38px;
    width: auto;
    display: block;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-logo {
    display: block;
    height: 38px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.dashboard-description {
    font-size: 20px;
    font-weight: 600;
    color: #2f2f3a;
    margin-top: 8px;
    margin-bottom: 18px;
    max-width: 760px;
    line-height: 1.45;
}
.dashboard-welcome {
    font-size: 20px;
    margin-bottom: 34px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: #ffffff;
    text-decoration: none;
}

.brand:hover {
    opacity: 0.9;
}

.header-logo {
    display: block;
    height: 42px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: #ffffff;
    font-size: 30px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

@media (max-width: 768px) {
    .topbar {
        min-height: 72px;
        padding: 32px 20px 12px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        overflow: visible;
    }

    .header-logo {
        height: 42px;
        max-width: 150px;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

     .topbar nav {
        display: none;
        position: absolute;
        top: 72px;
        right: 0;
        left: auto;
        width: min(82vw, 340px);
        z-index: 50;

        background: #201033;
        padding: 18px 24px 22px;
        box-shadow: -12px 12px 24px rgba(0,0,0,0.22);

        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        border-radius: 0 0 0 18px;
    }

    .topbar nav.is-open {
        display: flex;
    }

    .topbar nav a {
        font-size: 17px;
        margin-left: 0;
    }

    .topbar-user {
        align-items: flex-start;
        margin-right: 0;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        width: 100%;
    }
}
.btn-main.transfer {
    background: #eee7fa;
    color: #4b168c;
    border: none;
}

.btn-main.transfer:hover {
    background: #e0d4ff;
    color: #4b168c;
}

.btn-main.transfer:active {
    transform: scale(0.98);
}
.quick-actions .btn-main.transfer {
    grid-column: 1 / -1;
    width: 100%;
    background: #eee7fa;
    color: #4b168c;
    border: none;
}
.quick-actions .account-new {
    grid-column: 1 / -1;
    width: 100%;
}
.comercial-hero {
    background: #fff;
    border-radius: 18px;
    padding: 18px 28px;
    margin-bottom: 18px;
}

.comercial-hero h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.25;
    color: #202638;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.comercial-hero h1 span {
    font-size: 15px;
    font-weight: 400;
    color: #4b5563;
}

.config-section {
    margin-top: 30px;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fafafa;
}

.config-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
    color: #202638;
}

.config-header p {
    margin: 0 0 14px;
    font-size: 13px;
    color: #6b7280;
}

.config-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.config-link {
    position: relative;
    display: block;
    padding: 16px 18px 16px 20px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e7e2f3;
    color: #32106b;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(50, 16, 107, 0.04);
    transition: all 0.18s ease;
}

.config-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 0 8px 8px 0;
    background: #5b1fa6;
}

.config-link span {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
}

.config-link:hover {
    transform: translateY(-1px);
    border-color: #b79be6;
    box-shadow: 0 10px 24px rgba(50, 16, 107, 0.10);
    background: #fbf8ff;
}


@media (max-width: 768px) {
    .comercial-hero {
        padding: 16px 18px;
    }

    .comercial-hero h1 {
        font-size: 24px;
        display: block;
    }

    .comercial-hero h1 span {
        display: block;
        margin-top: 4px;
        font-size: 14px;
    }
}
.metric-subtext {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.25;
}
.app-actions-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0 20px;
}

.app-actions-strip a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 14px;
    background: #eee7fa;
    color: #4b168c;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}

.quick-actions .btn-analysis {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 66px;
    font-size: 20px;
    font-weight: 800;
    background: #4b1d8f;
    color: #ffffff;
    border: none;
}

.quick-actions .btn-analysis:hover {
    background: #3a146f;
    color: #ffffff;
}
.analysis-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 18px 0 26px;
}

.analysis-summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.analysis-summary-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.analysis-summary-card strong {
    font-size: 19px;
    font-weight: 800;
}

.analysis-summary-card strong.income {
    color: #067647;
}

.analysis-summary-card strong.expense {
    color: #b42318;
}

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

.donut-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px;
    margin: 0 0 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: center;
}

.donut-chart {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    position: relative;
}

.donut-chart::after {
    content: "";
    position: absolute;
    inset: 58px;
    background: #ffffff;
    border-radius: 50%;
}

.donut-center {
    position: absolute;
    inset: 58px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.donut-center span {
    color: #6b7280;
    font-size: 12px;
}

.donut-center strong {
    font-size: 17px;
    color: #201033;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.donut-legend-row {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 14px;
}

.donut-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
}

.donut-legend-row strong {
    color: #201033;
}

@media (max-width: 768px) {
    .donut-card {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .donut-legend {
        width: 100%;
    }
}
.period-selector,
.view-selector {
    display: grid;
    width: 100%;
    max-width: none;
    gap: 0;
    background: #ffffff;
    border-radius: 16px;
    padding: 6px;
    margin: 18px 0 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.period-selector {
    grid-template-columns: repeat(4, 1fr);
}

.view-selector {
    grid-template-columns: repeat(3, 1fr);
}

.period-selector a,
.view-selector a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #4b168c;
    font-weight: 800;
    text-align: center;
}

.period-selector a.active,
.view-selector a.active {
    background: #4b168c;
    color: #ffffff;
}

@media (max-width: 768px) {
    .period-selector,
    .view-selector {
        width: 100%;
    }

    .period-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .view-selector {
        grid-template-columns: repeat(3, 1fr);
    }

    .period-selector a,
    .view-selector a {
        min-height: 44px;
        font-size: 14px;
    }
}
.chart-bar-fill.income {
    background: #22a447;
}

.chart-amount.income,
.chart-amount.income small {
    color: #067647;
}
@media (min-width: 900px) {
    .chart-list-two-cols {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .chart-list-two-cols .chart-row {
        margin: 0;
    }
}
.chart-list-two-cols .chart-row:last-child:nth-child(odd) {
    grid-column: span 2;
}
.login-body.modo-app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}
/* Login centrado solo en modo app */
body.login-body.modo-app {
    min-height: 100vh !important;
    height: 100vh !important;
    display: grid !important;
    place-items: center !important;
    padding: 24px 16px !important;
}

body.login-body.modo-app .login-card {
    transform: translateY(180px);
    max-width: 420px !important;
    margin: 0 auto !important;
    padding: 28px 26px !important;
    border-radius: 18px !important;
}