/* ============================= */
/* VARIABLES GLOBALES */
/* ============================= */

:root {
    --color-corporativo: <?= COLOR_CORPORATIVO ?>;
    --color-corporativo-hover: <?= COLOR_CORPORATIVO_HOVER ?>;

    --color-corporativo-rgba-10: <?= COLOR_CORPORATIVO_RGBA_10 ?>;
    --color-corporativo-rgba-18: <?= COLOR_CORPORATIVO_RGBA_18 ?>;

    /* Estados */
    --color-success: #047857;
    --color-success-bg: #d1fae5;

    --color-error: #b91c1c;
    --color-error-bg: #fee2e2;

    --color-warning: #b45309;
    --color-warning-bg: #fef3c7;

    --color-info: #1d4ed8;
    --color-info-bg: #dbeafe;

    /* Base */
    --border: #e5e7eb;
    --text: #111827;
    --text-soft: #6b7280;
    --bg-soft: #f9fafb;
}


/* ============================= */
/* BOTONES */
/* ============================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--color-corporativo);
    background: var(--color-corporativo);
    color: #fff;
    box-shadow: 0 10px 20px var(--color-corporativo-rgba-18);
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
}

.btn:hover {
    filter: brightness(0.96);
    text-decoration: none;
}

.btn-secundario {
    background: #ffffff;
    border: 2px solid #c4c9d1;
    color: var(--text);
    box-shadow: none;
}

.btn-success {
    background: var(--color-success);
    border: 1px solid var(--color-success);
}

.btn-error {
    background: var(--color-error);
    border: 1px solid var(--color-error);
}

.btn-warning {
    background: var(--color-warning);
    border: 1px solid var(--color-warning);
}


/* ============================= */
/* CARDS */
/* ============================= */

.card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.05);
}


/* ============================= */
/* HERO SIMPLE ANTIGUO */
/* ============================= */

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

.hero h2 {
    margin: 0;
}


/* ============================= */
/* HERO GLOBAL */
/* ============================= */

.hero-layout {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, var(--color-corporativo-rgba-10), transparent 34%),
        linear-gradient(135deg, #f5faf5 0%, #eef7ee 55%, #ffffff 100%);
    border: 1px solid rgba(34, 139, 34, 0.22);
    border-radius: 28px;
    padding: 28px 30px;
    box-shadow: 0 20px 44px rgba(0,0,0,0.06);
}

.hero-layout::after {
    content: "";
    position: absolute;
    right: -55px;
    bottom: -55px;
    width: 190px;
    height: 190px;
    background: radial-gradient(circle, var(--color-corporativo-rgba-10) 0%, rgba(0,0,0,0) 72%);
    pointer-events: none;
}

.hero-layout__table {
    position: relative;
    z-index: 1;
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.hero-layout__table td {
    padding: 0;
    border: 0;
    vertical-align: top;
}

.hero-layout__row-title td {
    text-align: left;
    padding-bottom: 10px;
}

.hero-layout__row-text td {
    text-align: left;
    padding-bottom: 14px;
}

.hero-layout__row-actions td {
    text-align: right;
}

.hero-layout__title {
    margin: 0;
    color: var(--color-corporativo);
    font-size: 2rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.hero-layout__text {
    margin: 0;
    color: #4b5563;
    line-height: 1.7;
    font-size: 1rem;
    max-width: 980px;
}

.hero-layout__actions .btn {
    width: auto !important;
    display: inline-flex !important;
    white-space: nowrap;
}


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

.input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    transition: all 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--color-corporativo);
    box-shadow: 0 0 0 4px var(--color-corporativo-rgba-10);
}

.input.is-valid {
    border-color: var(--color-success);
}

.input.is-invalid {
    border-color: var(--color-error);
}

.validacion-mensaje {
    font-size: 0.8rem;
    margin-top: 5px;
}

.validacion-mensaje.ok {
    color: var(--color-success);
}

.validacion-mensaje.error {
    color: var(--color-error);
}


/* ============================= */
/* ALERTAS */
/* ============================= */

.alert {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.alert-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.alert-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}


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

.tabla-wrap {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.tabla {
    width: 100%;
    border-collapse: collapse;
}

.tabla thead {
    background: var(--bg-soft);
}

.tabla th {
    padding: 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-soft);
}

.tabla td {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.tabla tr:hover {
    background: #f9fafb;
}


/* ============================= */
/* POPUPS */
/* ============================= */

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.popup {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.popup h3 {
    margin-bottom: 10px;
}

.popup.success h3 {
    color: var(--color-success);
}

.popup.error h3 {
    color: var(--color-error);
}

.popup-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}


/* ============================= */
/* BOTÓN VOLVER INFERIOR */
/* ============================= */

.volver-bottom {
    margin-top: 25px;
    text-align: center;
}


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

@media (max-width: 768px) {

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn {
        width: 100%;
    }

    .hero-layout {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .hero-layout__title {
        font-size: 1.7rem;
    }

    .hero-layout__text {
        font-size: 0.96rem;
    }

    .hero-layout__actions .btn {
        width: auto !important;
        display: inline-flex !important;
    }
}