
* { box-sizing: border-box; }
body { margin:0; font-family:"Segoe UI",Arial,sans-serif; background:#f5f7fb; color:#253047; }
.topbar { height:64px; padding:0 28px; background:white; border-bottom:1px solid #e7eaf0; display:flex; align-items:center; justify-content:space-between; }
.topbar-right { display:flex; gap:20px; align-items:center; }
.topbar a { text-decoration:none; color:#5267d9; font-weight:600; }
.container { width:min(1400px,calc(100% - 40px)); margin:auto; padding:32px 0; }
.page-title { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
.page-title h1 { margin:0; font-size:32px; }
.page-title p { margin:6px 0 0; color:#7b8498; }
.panel { background:white; border-radius:18px; padding:22px; border:1px solid #e7eaf0; }
.toolbar { margin-bottom:18px; }
.search { width:min(600px,100%); border:1px solid #dfe4ed; border-radius:11px; padding:12px 14px; font-size:15px; outline:none; }
.search:focus { border-color:#6579df; box-shadow:0 0 0 3px rgba(101,121,223,.12); }
.table-wrapper { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
th,td { text-align:left; padding:13px 12px; border-bottom:1px solid #edf0f5; }
th { color:#687187; font-size:13px; }
.table-action { color:#5267d9; text-decoration:none; font-weight:700; }
.badge { display:inline-block; padding:5px 10px; border-radius:999px; font-weight:700; font-size:12px; background:#edf0f5; }
.badge.success { background:#dff6e7; color:#17683b; }
.badge.danger { background:#ffd7d4; color:#8c211b; }
.empty { padding:30px; text-align:center; color:#7b8498; }
.button { display:inline-block; text-decoration:none; border-radius:10px; padding:10px 15px; font-weight:700; }
.button.secondary { background:white; border:1px solid #dfe4ed; color:#5267d9; }
.detail-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.detail-card { background:white; border:1px solid #e7eaf0; border-radius:16px; padding:22px; }
.detail-card span { display:block; color:#7b8498; font-size:13px; margin-bottom:8px; }
.detail-card strong { font-size:20px; }
@media(max-width:800px){ .detail-grid{grid-template-columns:repeat(2,1fr)} }
@media(max-width:600px){ .topbar{padding:0 16px}.topbar span{display:none}.container{width:calc(100% - 24px);padding-top:22px}.detail-grid{grid-template-columns:1fr} }
.dashboard-clientes-link {
    margin-top: 24px;
}

.dashboard-clientes-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: #5267d9;
    color: white;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(82, 103, 217, .18);
}

.dashboard-clientes-button:hover {
    filter: brightness(.96);
}
/* Dashboard - tarjetas pastel restauradas */
.cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin-top: 26px;
}

.card {
    min-height: 185px;
    border-radius: 18px;
    padding: 22px;
    border: 5px solid;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(37, 48, 71, .06);
    transition: transform .15s ease, box-shadow .15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 48, 71, .10);
}

.card-icon {
    font-size: 27px;
    margin-bottom: 8px;
}

.card span {
    font-size: 15px;
    font-weight: 800;
}

.card strong {
    font-size: 34px;
    margin: 9px 0 4px;
    line-height: 1.1;
}

.card small {
    color: #687187;
    line-height: 1.35;
}

.pastel-blue {
    background: #e8f1ff;
    border-color: #a9c9f7;
}

.pastel-green {
    background: #e8f8ee;
    border-color: #a9dfbf;
}

.pastel-yellow {
    background: #fff7d9;
    border-color: #ead38b;
}

.pastel-red {
    background: #ffe9e7;
    border-color: #efaaa4;
}

.pastel-purple {
    background: #f0eaff;
    border-color: #c6b1ef;
}

@media (max-width: 1150px) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

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



/* ===== FORMULARIO NUEVO CLIENTE ===== */

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

.form-section {
    background: #fbfcff;
    border: 1px solid #e6eaf2;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 20px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.form-section-title > span {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    background: #eef1ff;
}

.form-section-title h2 {
    margin: 0;
    font-size: 18px;
    color: #253047;
}

.form-section-title p {
    margin: 3px 0 0;
    color: #7b8498;
    font-size: 13px;
}

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

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #5e687c;
    font-size: 13px;
    font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    border: 1px solid #dce2ec;
    border-radius: 11px;
    padding: 12px 13px;
    font: inherit;
    color: #253047;
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border-color: #6579df;
    box-shadow: 0 0 0 3px rgba(101,121,223,.12);
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 2px;
}

.button.primary {
    background: #5267d9;
    color: #fff;
    border: 1px solid #5267d9;
}

.button.secondary {
    background: #fff;
    color: #5267d9;
    border: 1px solid #dce2ec;
}

.flash {
    padding: 12px 15px;
    border-radius: 11px;
    margin-bottom: 18px;
}

.flash.error {
    background: #ffe9e7;
    color: #8c211b;
}

.flash.success {
    background: #e8f8ee;
    color: #17683b;
}

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

    .form-grid .full {
        grid-column: auto;
    }

    .form-section {
        padding: 17px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        text-align: center;
    }
}

/* Contraseña en ficha de cliente */
.password-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-display strong {
    overflow-wrap: anywhere;
}

.password-toggle {
    border: 1px solid #dce2ec;
    background: #fff;
    border-radius: 9px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 15px;
}

.password-toggle:hover {
    background: #f5f7fb;
}


/* ========================================= */
/* RENOVAR CLIENTE */
/* ========================================= */

.renew-client-card {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 25px;

}


.renew-client-info {

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 14px;

    padding: 18px;

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.04);

}


.renew-label {

    display: block;

    color: #7a8499;

    font-size: 13px;

    margin-bottom: 8px;

}


.renew-client-info strong {

    font-size: 16px;

    color: #263047;

}


.renew-form-card {

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 16px;

    padding: 28px;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.05);

}


.renew-form-title {

    margin-bottom: 25px;

}


.renew-form-title h2 {

    margin-bottom: 5px;

}


.renew-form-title p {

    color: #7a8499;

}


.renew-warning {

    margin-top: 25px;

    padding: 18px;

    background: #fff8e7;

    border: 1px solid #f1dda1;

    border-radius: 12px;

    color: #745a13;

}


.renew-warning p {

    margin-top: 8px;

    line-height: 1.6;

}


.renewal-button {

    background: #5267d9;

    color: white;

    border: 1px solid #5267d9;

}


.renewal-button:hover {

    background: #4053c5;

}


/* MÓVIL */

@media (max-width: 850px) {

    .renew-client-card {

        grid-template-columns:
            repeat(2, 1fr);

    }

}


@media (max-width: 600px) {

    .renew-client-card {

        grid-template-columns:
            1fr;

    }

}


/* ==============================
   HISTORIAL DE ABONOS
   ============================== */

.renewal-history-card {
    margin-top: 25px;
}

.renewal-history-card .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.renewal-history-card .section-header h2 {
    margin: 0 0 5px 0;
}

.renewal-history-card .section-header p {
    margin: 0;
    opacity: 0.75;
}

.renewal-history-table {
    width: 100%;
}

.renewal-history-table th,
.renewal-history-table td {
    padding: 12px 14px;
}

.renewal-history-table td strong {
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 35px 20px;
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.empty-state h3 {
    margin: 0 0 8px 0;
}

.empty-state p {
    margin: 0;
    opacity: 0.7;
}