/* ==========================================================
   MI COOPERADORA
   style.css
   ========================================================== */


/* ==========================================================
   VARIABLES
   ========================================================== */

:root {

    --color-primary: #E9865D;
    --color-primary-dark: #D36F48;
    --color-primary-soft: #FCE9DF;

    --color-secondary: #F5F1ED;

    --color-success: #3F8F6B;
    --color-success-soft: #E3F2EA;

    --color-warning: #D89A38;
    --color-warning-soft: #FFF3D8;

    --color-danger: #C95D5D;
    --color-danger-soft: #FBE7E7;

    --color-bg: #F7F7F8;
    --color-surface: #FFFFFF;

    --color-text: #2D3338;
    --color-text-soft: #737A80;
    --color-border: #E4E6E8;

    --shadow-sm:
        0 2px 8px rgba(0, 0, 0, 0.05);

    --shadow-md:
        0 8px 24px rgba(0, 0, 0, 0.08);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --transition: 0.2s ease;

}


/* ==========================================================
   RESET
   ========================================================== */

* {

    box-sizing: border-box;

}


html {

    scroll-behavior: smooth;

}


body {

    margin: 0;

    font-family:
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    background:
        var(--color-bg);

    color:
        var(--color-text);

    line-height: 1.5;

}


/* ==========================================================
   APP
   ========================================================== */

#app {

    width: 100%;

    min-height: 100vh;

    padding: 32px;

}


.page {

    width: 100%;

    max-width: 1200px;

    margin: 0 auto;

}


/* ==========================================================
   TIPOGRAFÍA
   ========================================================== */

h1,
h2,
h3 {

    margin-top: 0;

    color:
        var(--color-text);

}


h1 {

    font-size: 32px;

    margin-bottom: 6px;

}


h2 {

    font-size: 21px;

}


p {

    color:
        var(--color-text-soft);

}


/* ==========================================================
   BOTONES
   ========================================================== */

button {

    appearance: none;

    border: none;

    border-radius:
        var(--radius-sm);

    background:
        var(--color-primary);

    color: white;

    padding:
        11px 18px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        var(--transition);

}


button:hover {

    background:
        var(--color-primary-dark);

    transform:
        translateY(-1px);

}


button:active {

    transform:
        translateY(0);

}


button:disabled {

    opacity: 0.55;

    cursor: not-allowed;

}


/* ==========================================================
   FORMULARIOS
   ========================================================== */

.form-grid {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;

}


.form-group {

    display: flex;

    flex-direction: column;

    gap: 7px;

}


label {

    font-size: 14px;

    font-weight: 600;

    color:
        var(--color-text);

}


input,
select,
textarea {

    width: 100%;

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-sm);

    background: white;

    padding:
        11px 12px;

    font-size: 15px;

    color:
        var(--color-text);

    outline: none;

    transition:
        var(--transition);

}


input:focus,
select:focus,
textarea:focus {

    border-color:
        var(--color-primary);

    box-shadow:
        0 0 0 3px
        rgba(233, 134, 93, 0.12);

}


textarea {

    resize: vertical;

}


.form-error {

    margin-top: 16px;

    padding: 12px 14px;

    border-radius:
        var(--radius-sm);

    background:
        var(--color-danger-soft);

    color:
        var(--color-danger);

    font-weight: 600;

}


/* ==========================================================
   TABLAS
   ========================================================== */

table {

    width: 100%;

    border-collapse: collapse;

    background: white;

}


thead {

    background:
        #F4F5F6;

}


th {

    padding:
        13px 14px;

    text-align: left;

    font-size: 13px;

    color:
        var(--color-text-soft);

    text-transform: uppercase;

    letter-spacing: 0.03em;

    border-bottom:
        1px solid var(--color-border);

}


td {

    padding:
        14px;

    border-bottom:
        1px solid var(--color-border);

    font-size: 14px;

}


tbody tr {

    transition:
        var(--transition);

}


tbody tr:hover {

    background:
        #FAFAFA;

}


/* ==========================================================
   LOADER
   ========================================================== */

.loader {

    position: fixed;

    inset: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    background: white;

    z-index: 9999;

}


.loader__content {

    text-align: center;

}


.loader__spinner {

    width: 44px;

    height: 44px;

    margin:
        0 auto 18px;

    border:
        4px solid var(--color-primary-soft);

    border-top-color:
        var(--color-primary);

    border-radius:
        50%;

    animation:
        loader-spin 0.8s linear infinite;

}


@keyframes loader-spin {

    to {

        transform:
            rotate(360deg);

    }

}


/* ==========================================================
   DASHBOARD
   ========================================================== */

.dashboard {

    max-width: 1200px;

    margin: 0 auto;

}


.dashboard__header {

    margin-bottom: 28px;

}


.dashboard__header p {

    margin-top: 0;

}


.dashboard__cards {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 32px;

}


.dashboard-card {

    background:
        var(--color-surface);

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

    padding: 22px;

}


.dashboard-card__label {

    display: block;

    color:
        var(--color-text-soft);

    font-size: 14px;

    margin-bottom: 8px;

}


.dashboard-card__value {

    display: block;

    font-size: 27px;

    color:
        var(--color-text);

}


.dashboard__actions,
.dashboard__welcome {

    background:
        var(--color-surface);

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

    padding: 24px;

    margin-bottom: 22px;

}


.dashboard__buttons {

    display: flex;

    flex-wrap: wrap;

    gap: 12px;

}


/* ==========================================================
   FAMILIAS
   ========================================================== */

.familias__header,
.familia__header,
.nueva-familia__header,
.cuotas__header,
.caja__header,
.reportes__header {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 20px;

    margin-bottom: 26px;

}


.familias__header p,
.cuotas__header p,
.caja__header p,
.reportes__header p {

    margin: 0;

}


.familias__search {

    background:
        var(--color-surface);

    padding: 20px;

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    margin-bottom: 20px;

}


.familias__table-container,
.cuotas__table-container,
.caja__table-container {

    overflow-x: auto;

    background: white;

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

}


.familias__empty {

    text-align: center;

    padding: 30px;

}


/* ==========================================================
   NUEVA FAMILIA
   ========================================================== */

.nueva-familia__form {

    background:
        var(--color-surface);

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    padding: 26px;

    box-shadow:
        var(--shadow-sm);

}


.nueva-familia__form section {

    margin-bottom: 30px;

}


.nueva-familia__actions {

    display: flex;

    justify-content: flex-end;

    gap: 12px;

    margin-top: 24px;

}


/* ==========================================================
   FICHA FAMILIAR
   ========================================================== */

.familia__datos,
.familia__alumnos,
.familia__pagos,
.familia__resumen {

    background:
        var(--color-surface);

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

    padding: 24px;

    margin-bottom: 22px;

}


.familia__datos-grid {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

}


.familia__datos-grid > div {

    background:
        var(--color-bg);

    border-radius:
        var(--radius-sm);

    padding: 14px;

}


.familia__datos-grid span {

    display: block;

    font-size: 12px;

    color:
        var(--color-text-soft);

    margin-bottom: 4px;

}


.familia__section-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 16px;

    margin-bottom: 18px;

}


.familia__resumen > div {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;

}


.familia__resumen > div > div {

    background:
        var(--color-primary-soft);

    border-radius:
        var(--radius-sm);

    padding: 16px;

}


.familia__resumen span {

    display: block;

    color:
        var(--color-text-soft);

    font-size: 13px;

}


.familia__resumen strong {

    font-size: 20px;

}


/* ==========================================================
   CUOTAS
   ========================================================== */

.cuotas__form,
.cuotas__listado {

    background:
        var(--color-surface);

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

    padding: 24px;

    margin-bottom: 22px;

}


.cuotas__actions {

    display: flex;

    justify-content: flex-end;

    margin-top: 20px;

}


.cuotas__section-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;

}


.cuotas__section-header input {

    max-width: 320px;

}


/* ==========================================================
   CAJA
   ========================================================== */

.caja__resumen {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 24px;

}


.caja-card {

    background:
        var(--color-surface);

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

    padding: 22px;

}


.caja-card span {

    display: block;

    color:
        var(--color-text-soft);

    margin-bottom: 8px;

}


.caja-card strong {

    font-size: 25px;

}


.caja__filtros,
.caja__movimientos,
.caja__form {

    background:
        var(--color-surface);

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

    padding: 24px;

    margin-bottom: 22px;

}


.caja__form-actions {

    display: flex;

    justify-content: flex-end;

    gap: 12px;

    margin-top: 20px;

}


/* ==========================================================
   REPORTES
   ========================================================== */

.reportes__filtros {

    display: flex;

    align-items: flex-end;

    gap: 14px;

    background: white;

    padding: 20px;

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    margin-bottom: 22px;

}


.reportes__cards {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 24px;

}


.reporte-card {

    background:
        var(--color-surface);

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

    padding: 22px;

}


.reporte-card span {

    display: block;

    color:
        var(--color-text-soft);

    margin-bottom: 8px;

}


.reporte-card strong {

    font-size: 24px;

}


.reportes__periodo,
.reportes__medios,
.reportes__informacion {

    background:
        var(--color-surface);

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

    padding: 24px;

    margin-bottom: 22px;

}


.reportes__periodo-grid {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 16px;

}


.reportes__periodo-grid > div {

    background:
        var(--color-primary-soft);

    padding: 18px;

    border-radius:
        var(--radius-sm);

}


.reportes__acciones {

    display: flex;

    justify-content: flex-end;

}


/* ==========================================================
   RECIBO
   ========================================================== */

.recibo {

    max-width: 900px;

    margin: 0 auto;

}


.recibo__acciones {

    display: flex;

    justify-content: space-between;

    margin-bottom: 20px;

}


.recibo__documento {

    background:
        white;

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-md);

    padding: 36px;

}


.recibo__header {

    display: flex;

    justify-content: space-between;

    gap: 20px;

}


.recibo__numero {

    text-align: right;

}


.recibo__numero span {

    display: block;

    color:
        var(--color-text-soft);

}


.recibo__numero strong {

    font-size: 20px;

}


.recibo__total {

    display: flex;

    justify-content: flex-end;

    align-items: center;

    gap: 30px;

    padding-top: 20px;

}


.recibo__total strong {

    font-size: 24px;

    color:
        var(--color-primary-dark);

}


.recibo__footer {

    margin-top: 50px;

    text-align: center;

}


.recibo__firma {

    margin-top: 45px;

    display: flex;

    flex-direction: column;

    align-items: center;

}


/* ==========================================================
   ERRORES
   ========================================================== */

.error-page,
.familia__error,
.recibo__error {

    max-width: 600px;

    margin:
        80px auto;

    text-align: center;

    background: white;

    border:
        1px solid var(--color-border);

    border-radius:
        var(--radius-md);

    padding: 40px;

    box-shadow:
        var(--shadow-md);

}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 900px) {

    #app {

        padding: 20px;

    }


    .dashboard__cards,
    .reportes__cards {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .familia__datos-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .caja__resumen {

        grid-template-columns:
            1fr;

    }

}


@media (max-width: 640px) {

    #app {

        padding: 14px;

    }


    h1 {

        font-size: 27px;

    }


    .dashboard__cards,
    .reportes__cards,
    .familia__datos-grid,
    .familia__resumen > div,
    .reportes__periodo-grid,
    .form-grid {

        grid-template-columns:
            1fr;

    }


    .familias__header,
    .familia__header,
    .nueva-familia__header,
    .cuotas__header,
    .caja__header,
    .reportes__header {

        flex-direction: column;

    }


    .dashboard__buttons {

        flex-direction: column;

    }


    .dashboard__buttons button {

        width: 100%;

    }


    .cuotas__section-header {

        align-items: stretch;

        flex-direction: column;

    }


    .cuotas__section-header input {

        max-width: none;

    }


    .reportes__filtros {

        flex-direction: column;

        align-items: stretch;

    }


    .recibo__documento {

        padding: 20px;

    }


    .recibo__header {

        flex-direction: column;

    }


    .recibo__numero {

        text-align: left;

    }

}
/* ==========================================================
   HEADER PRINCIPAL
   ========================================================== */

.app-header {

    position: sticky;

    top: 0;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 24px;

    min-height: 74px;

    padding:
        12px 32px;

    background:
        rgba(255, 255, 255, 0.96);

    border-bottom:
        1px solid var(--color-border);

    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.04);

    backdrop-filter:
        blur(10px);

}


.app-header__brand {

    display: flex;

    align-items: center;

    gap: 12px;

    flex-shrink: 0;

}


.app-header__logo {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 46px;

    height: 46px;

    border-radius: 14px;

    background: white;

    border: 1px solid var(--color-border);

    overflow: hidden;

}
.app-header__logo img {

    width: 100%;

    height: 100%;

    object-fit: contain;

    padding: 4px;

}

.app-header__brand strong {

    display: block;

    font-size: 16px;

}


.app-header__brand span {

    display: block;

    margin-top: 1px;

    color:
        var(--color-text-soft);

    font-size: 12px;

}


.app-nav {

    display: flex;

    align-items: center;

    gap: 6px;

}


.app-nav button {

    background:
        transparent;

    color:
        var(--color-text-soft);

    padding:
        9px 13px;

    border-radius:
        9px;

}


.app-nav button:hover {

    background:
        var(--color-primary-soft);

    color:
        var(--color-primary-dark);

    transform: none;

}


.app-nav button.active {

    background:
        var(--color-primary-soft);

    color:
        var(--color-primary-dark);

}


/* ==========================================================
   HEADER RESPONSIVE
   ========================================================== */

@media (max-width: 760px) {

    .app-header {

        position: static;

        align-items: flex-start;

        flex-direction: column;

        padding:
            14px;

        gap: 12px;

    }


    .app-nav {

        width: 100%;

        overflow-x: auto;

        padding-bottom: 3px;

    }


    .app-nav button {

        flex-shrink: 0;

    }

}
/* ==========================================================
   DASHBOARD VISUAL V2
   ========================================================== */

.dashboard__eyebrow {

    display: inline-block;

    margin-bottom: 6px;

    color: var(--color-primary-dark);

    font-size: 12px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.08em;

}


.dashboard__header {

    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    margin-bottom: 28px;

}


.dashboard__header h1 {

    margin-bottom: 4px;

}


.dashboard__cards {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 24px;

}


.dashboard-card {

    display: flex;

    align-items: center;

    gap: 16px;

    min-height: 118px;

    padding: 22px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fffaf7
        );

    border:
        1px solid var(--color-border);

    border-radius:
        18px;

    box-shadow:
        var(--shadow-sm);

}


.dashboard-card__icon {

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    width: 52px;

    height: 52px;

    border-radius: 16px;

    background:
        var(--color-primary-soft);

    font-size: 23px;

}


.dashboard-card__label {

    display: block;

    margin-bottom: 4px;

    color:
        var(--color-text-soft);

    font-size: 13px;

}


.dashboard-card__value {

    display: block;

    font-size: 25px;

    line-height: 1.15;

}


.dashboard__main-grid {

    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, 1fr);

    gap: 22px;

}


.dashboard-panel,
.dashboard-welcome {

    background: white;

    border:
        1px solid var(--color-border);

    border-radius:
        18px;

    box-shadow:
        var(--shadow-sm);

    padding: 24px;

}


.dashboard-panel__header {

    margin-bottom: 18px;

}


.dashboard-panel__header h2 {

    margin-bottom: 0;

}


.dashboard__quick-actions {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;

}


.quick-action {

    display: flex;

    align-items: center;

    gap: 13px;

    width: 100%;

    padding: 15px;

    text-align: left;

    background:
        #fffaf7;

    color:
        var(--color-text);

    border:
        1px solid #f1dfd5;

    border-radius:
        14px;

}


.quick-action:hover {

    background:
        var(--color-primary-soft);

    color:
        var(--color-text);

    border-color:
        #efcdbd;

    transform:
        translateY(-2px);

}


.quick-action__icon {

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    width: 40px;

    height: 40px;

    border-radius: 12px;

    background:
        white;

    color:
        var(--color-primary-dark);

    font-size: 20px;

    font-weight: 800;

}


.quick-action strong {

    display: block;

    margin-bottom: 2px;

    font-size: 14px;

}


.quick-action small {

    display: block;

    color:
        var(--color-text-soft);

    font-size: 11px;

    font-weight: 400;

}


.dashboard-welcome {

    display: flex;

    flex-direction: column;

    justify-content: center;

    background:
        linear-gradient(
            160deg,
            #fff,
            var(--color-primary-soft)
        );

}


.dashboard-welcome__logo {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 100px;

    height: 100px;

    margin-bottom: 18px;

    background: white;

    border-radius: 22px;

    box-shadow:
        var(--shadow-sm);

    overflow: hidden;

}


.dashboard-welcome__logo img {

    width: 100%;

    height: 100%;

    object-fit: contain;

    padding: 7px;

}


.dashboard-welcome h2 {

    margin-bottom: 8px;

}


.dashboard-welcome p {

    margin-bottom: 0;

}


@media (max-width: 950px) {

    .dashboard__cards {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .dashboard__main-grid {

        grid-template-columns:
            1fr;

    }

}


@media (max-width: 620px) {

    .dashboard__cards,
    .dashboard__quick-actions {

        grid-template-columns:
            1fr;

    }


    .dashboard-card {

        min-height: auto;

    }

}
/* ==========================================================
   FAMILIAS - VISUAL V2
   ========================================================== */

.familias {

    width: 100%;

}


.familias__header {

    align-items: center;

    margin-bottom: 24px;

}


.familias__header h1 {

    margin-bottom: 3px;

}


.familias__header button {

    padding: 12px 18px;

    box-shadow:
        0 5px 15px rgba(233, 134, 93, 0.18);

}


/* ----------------------------------------------------------
   BUSCADOR
   ---------------------------------------------------------- */

.familias__search {

    position: relative;

    padding: 22px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fffaf7
        );

}


.familias__search label {

    display: block;

    margin-bottom: 8px;

    color:
        var(--color-text-soft);

    font-size: 12px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.06em;

}


.familias__search input {

    min-height: 46px;

    padding-left: 15px;

    font-size: 15px;

}


/* ----------------------------------------------------------
   TABLA
   ---------------------------------------------------------- */

.familias__table-container {

    border-radius: 16px;

    overflow-x: auto;

}


.familias__table {

    min-width: 850px;

}


.familias__table thead {

    background:
        #faf7f5;

}


.familias__table th {

    padding:
        14px 16px;

    color:
        #777;

    font-size: 11px;

    letter-spacing:
        0.07em;

}


.familias__table td {

    padding:
        15px 16px;

    vertical-align: middle;

}


.familias__table tbody tr:hover {

    background:
        #fffaf7;

}


/* ----------------------------------------------------------
   ESTADOS
   ---------------------------------------------------------- */

.estado-badge {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 70px;

    padding:
        5px 10px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 700;

}


.estado-badge--activo {

    background:
        var(--color-success-soft);

    color:
        var(--color-success);

}


.estado-badge--inactivo {

    background:
        #eeeeee;

    color:
        #777;

}


/* ----------------------------------------------------------
   BOTONES DE TABLA
   ---------------------------------------------------------- */

.tabla-acciones {

    display: flex;

    align-items: center;

    gap: 7px;

}


.btn-tabla {

    padding:
        7px 11px;

    border-radius: 8px;

    font-size: 12px;

    box-shadow: none;

}


.btn-tabla--ver {

    background:
        var(--color-primary-soft);

    color:
        var(--color-primary-dark);

}


.btn-tabla--ver:hover {

    background:
        #f8d9ca;

    color:
        var(--color-primary-dark);

}


.btn-tabla--editar {

    background:
        #f0f1f2;

    color:
        var(--color-text);

}


.btn-tabla--editar:hover {

    background:
        #e4e6e8;

    color:
        var(--color-text);

}


/* ----------------------------------------------------------
   SIN RESULTADOS
   ---------------------------------------------------------- */

.familias__empty {

    padding: 35px;

    color:
        var(--color-text-soft);

    font-size: 14px;

}


/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 700px) {

    .familias__header {

        align-items: stretch;

    }


    .familias__header button {

        width: 100%;

    }
    
    }

/* ==========================================================
   FAMILIAS - DISEÑO DEFINITIVO
   ========================================================== */

.familias {

    display: flex;
    flex-direction: column;
    gap: 20px;

}


/* CABECERA */

.familias__header {

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 24px 26px;

    margin-bottom: 0;

    background:
        linear-gradient(
            135deg,
            #fff7f2,
            #fce8dc
        );

    border: 1px solid #f2d8ca;

    border-radius: 20px;

}


.familias__header h1 {

    margin: 0 0 3px;

    font-size: 29px;

}


.familias__header p {

    margin: 0;

    color: var(--color-text-soft);

}


.familias__header button {

    min-height: 44px;

    padding: 0 18px;

    border-radius: 12px;

    box-shadow:
        0 5px 14px
        rgba(233, 134, 93, 0.20);

}


/* BUSCADOR */

.familias__search {

    margin: 0;

    padding: 20px 22px;

    background: white;

    border:
        1px solid var(--color-border);

    border-radius: 16px;

    box-shadow:
        var(--shadow-sm);

}


.familias__search label {

    display: block;

    margin-bottom: 8px;

    color:
        var(--color-primary-dark);

    font-size: 12px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: .06em;

}


.familias__search input {

    height: 46px;

    background: #fafafa;

    border-radius: 11px;

}


/* CONTENEDOR DE TABLA */

.familias__table-container {

    overflow: hidden;

    background: white;

    border:
        1px solid var(--color-border);

    border-radius: 18px;

    box-shadow:
        var(--shadow-sm);

}


/* TABLA */

.familias__table {

    min-width: 850px;

}


.familias__table thead {

    background: #fff8f4;

}


.familias__table th {

    padding: 15px 16px;

    color:
        #8b6d5e;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: .06em;

}


.familias__table td {

    padding: 16px;

    vertical-align: middle;

}


.familias__table tbody tr {

    background: white;

}


.familias__table tbody tr:hover {

    background: #fffaf7;

}


/* ESTADO */

.estado-badge {

    display: inline-flex;

    align-items: center;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 700;

}


.estado-badge--activo {

    background: #e3f3ea;

    color: #38805f;

}


.estado-badge--inactivo {

    background: #f1f1f1;

    color: #777;

}


/* ACCIONES */

.tabla-acciones {

    display: flex;

    gap: 7px;

}


.btn-tabla {

    padding: 7px 11px;

    border-radius: 9px;

    font-size: 12px;

    box-shadow: none;

}


.btn-tabla--ver {

    background:
        var(--color-primary-soft);

    color:
        var(--color-primary-dark);

}


.btn-tabla--ver:hover {

    background: #f7d6c5;

    color:
        var(--color-primary-dark);

}


.btn-tabla--editar {

    background: #eef0f1;

    color:
        var(--color-text);

}


.btn-tabla--editar:hover {

    background: #dfe2e4;

    color:
        var(--color-text);

}


/* SIN FAMILIAS */

.familias__empty {

    margin: 0;

    padding: 35px;

    text-align: center;

    background: white;

    border:
        1px dashed var(--color-border);

    border-radius: 16px;

}


/* CELULAR */

@media (max-width: 700px) {

    .familias__header {

        align-items: stretch;

        flex-direction: column;

        gap: 16px;

    }


    .familias__header button {

        width: 100%;

    }


    .familias__table-container {

        overflow-x: auto;

    }

}
/* ==========================================================
   NUEVA FAMILIA - VISUAL V2
   ========================================================== */

.nueva-familia {
    max-width: 1000px;
    margin: 0 auto;
}

.nueva-familia__header {
    display: block;
    margin-bottom: 22px;
}

.btn-volver {
    margin-bottom: 22px;
    padding: 7px 0;
    background: transparent;
    color: var(--color-text-soft);
    box-shadow: none;
}

.btn-volver:hover {
    background: transparent;
    color: var(--color-primary-dark);
    transform: translateX(-2px);
}

.nueva-familia__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--color-primary-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.nueva-familia__header h1 {
    margin-bottom: 5px;
}

.nueva-familia__header p {
    margin: 0;
}


/* FORMULARIO GENERAL */

.nueva-familia__form {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}


/* TARJETAS */

.form-card {
    margin-bottom: 18px !important;
    padding: 24px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.form-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 17px;
    border-bottom: 1px solid #eeeeee;
}

.form-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--color-primary-soft);
    border-radius: 13px;
    color: var(--color-primary-dark);
    font-size: 20px;
}

.form-card__header h2 {
    margin: 0 0 2px;
    font-size: 17px;
}

.form-card__header p {
    margin: 0;
    font-size: 12px;
}


/* CAMPOS */

.form-card .form-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.form-card:first-of-type .form-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.form-card input,
.form-card textarea {
    background: #fafafa;
}

.form-card input:hover,
.form-card textarea:hover {
    border-color: #d4d7d9;
}

.form-card textarea {
    min-height: 110px;
}


/* BOTONES INFERIORES */

.nueva-familia__actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding: 16px 0;
    background: var(--color-bg);
}

.btn-secundario {
    background: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secundario:hover {
    background: #f1f2f3;
    color: var(--color-text);
}

.btn-guardar {
    min-width: 155px;
}


/* RESPONSIVE */

@media (max-width: 750px) {

    .form-card .form-grid,
    .form-card:first-of-type .form-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 19px;
    }

    .nueva-familia__actions {
        flex-direction: column-reverse;
    }

    .nueva-familia__actions button {
        width: 100%;
    }

}
/* ==========================================================
   NUEVA FAMILIA - CORRECCION VISUAL
   DEBE QUEDAR AL FINAL DE STYLE.CSS
   ========================================================== */

.nueva-familia {
    max-width: 1000px;
    margin: 0 auto;
}


/* CABECERA */

.nueva-familia .nueva-familia__header {
    display: block;
    margin-bottom: 24px;
}

.nueva-familia .btn-volver {
    display: inline-block;
    margin: 0 0 18px 0;
    padding: 0;
    background: transparent !important;
    color: var(--color-primary-dark) !important;
    border: none;
    box-shadow: none !important;
    font-size: 13px;
}

.nueva-familia .btn-volver:hover {
    background: transparent !important;
    transform: translateX(-3px);
}

.nueva-familia__eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--color-primary-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.nueva-familia__header h1 {
    margin: 0 0 6px;
}

.nueva-familia__header p {
    margin: 0;
}


/* EL FORMULARIO YA NO ES UNA TARJETA */

.nueva-familia .nueva-familia__form {
    display: block;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}


/* CADA SECCION ES UNA TARJETA */

.nueva-familia__form .form-card {
    display: block;
    margin: 0 0 18px 0 !important;
    padding: 24px !important;
    background: #ffffff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 18px !important;
    box-shadow: var(--shadow-sm) !important;
}


/* CABECERA DE CADA TARJETA */

.nueva-familia__form .form-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 17px;
    border-bottom: 1px solid #eeeeee;
}

.nueva-familia__form .form-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    border-radius: 13px;
    font-size: 19px;
}

.nueva-familia__form .form-card__header h2 {
    margin: 0 0 3px;
    font-size: 17px;
}

.nueva-familia__form .form-card__header p {
    margin: 0;
    font-size: 12px;
}


/* CAMPOS */

.nueva-familia__form .form-card .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.nueva-familia__form .form-card:first-of-type .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nueva-familia__form .form-card input,
.nueva-familia__form .form-card textarea {
    background: #fafafa;
}

.nueva-familia__form .form-card textarea {
    min-height: 105px;
}


/* BOTONES INFERIORES */

.nueva-familia .nueva-familia__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
    padding: 14px 0 8px;
    background: transparent;
}

.nueva-familia .btn-secundario {
    background: #ffffff !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border);
    box-shadow: none;
}

.nueva-familia .btn-secundario:hover {
    background: #f1f2f3 !important;
}

.nueva-familia .btn-guardar {
    min-width: 160px;
}


/* RESPONSIVE */

@media (max-width: 750px) {

    .nueva-familia__form .form-card .form-grid,
    .nueva-familia__form .form-card:first-of-type .form-grid {
        grid-template-columns: 1fr;
    }

    .nueva-familia__form .form-card {
        padding: 19px !important;
    }

    .nueva-familia .nueva-familia__actions {
        flex-direction: column-reverse;
    }

    .nueva-familia .nueva-familia__actions button {
        width: 100%;
    }
}
/* ==========================================================
   LOGIN
   ========================================================== */

.login {
    min-height: calc(100vh - 74px);

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 30px 16px;
}


.login__card {
    width: 100%;

    max-width: 420px;

    padding: 32px;

    background: white;

    border: 1px solid var(--color-border);

    border-radius: 20px;

    box-shadow: var(--shadow-md);

    text-align: center;
}


.login__logo {
    display: block;

    width: 120px;

    height: 120px;

    margin: 0 auto 20px;

    object-fit: contain;
}


.login__card h1 {
    margin-bottom: 6px;
}


.login__card > p {
    margin-top: 0;

    margin-bottom: 24px;
}


.login__card form {
    display: flex;

    flex-direction: column;

    gap: 10px;

    text-align: left;
}


.login__card form button {
    width: 100%;

    margin-top: 10px;
}


#loginError {
    margin-top: 16px;

    color: var(--color-danger);

    font-weight: 600;
}


@media (max-width: 600px) {

    .login__card {
        padding: 24px 20px;
    }

    .login__logo {
        width: 100px;
        height: 100px;
    }

}

.login__link {
    width: 100%;
    margin-top: 14px;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: #8f4f2f;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login__registro[hidden],
.login__link[hidden] {
    display: none;
}

.login__mensaje {
    min-height: 1.5em;
    margin-top: 12px;
    color: #25643a;
    font-weight: 600;
}

.login__mensaje--error {
    color: #b42318;
}

.login__card form button:disabled {
    opacity: .65;
    cursor: wait;
}
