/* ==========================================================================
   ALBAFÉNIX — HOJA DE ESTILOS OFICIAL
   Basada fielmente en el lineamiento visual de Lumanex (Marca Lumareza)
   ========================================================================== */

/* =========================================
   1. PALETA DE COLORES Y VARIABLES GLOBALES
   ========================================= */
:root {
    --gold-primary: rgba(167, 145, 72, 1);      /* #a79148 */
    --gold-hover: #c2a855;
    --gold-transparent: rgba(167, 145, 72, 0.2);
    --dark-1: rgba(15, 20, 25, 1);              /* #0f1419 */
    --dark-2: rgba(30, 35, 40, 1);              /* #1e2328 */
    --white: #ffffff;
    --light-bg: #f4f6f8;
    --text-dark: #333333;
    --text-gray: #555555;

    /* Estados semánticos (para citas, autorizaciones y alertas clínicas) */
    --ok-bg: #d4edda;
    --ok-text: #155724;
    --warn-bg: #fff3cd;
    --warn-text: #856404;
    --err-bg: #f8d7da;
    --err-text: #721c24;
    --info-bg: #d1ecf1;
    --info-text: #0c5460;
}

/* =========================================
   2. ESTILOS GENERALES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    cursor: pointer;
}

/* =========================================
   3. BOTONES CORPORATIVOS
   ========================================= */
.btn-primary {
    background-color: var(--gold-primary);
    color: var(--dark-1);
    padding: 12px 26px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
}

.btn-outline-gold {
    background: transparent;
    color: var(--gold-primary);
    border: 2px solid var(--gold-primary);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.btn-outline-gold:hover {
    background: var(--gold-hover);
    color: var(--white);
}

.btn-dark {
    background-color: var(--dark-1);
    color: var(--white);
    border: 1px solid var(--gold-primary);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.btn-dark:hover {
    background-color: var(--dark-2);
    color: var(--gold-primary);
}

.btn-logout {
    background-color: var(--err-bg);
    color: var(--err-text);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background-color: #f5c6cb;
}

/* =========================================
   4. SELECTS CON FLECHA DORADA CORPORATIVA
   ========================================= */
select {
    width: 100%;
    padding: 10px 35px 10px 15px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: var(--dark-1);
    background-color: #fcfcfc;
    border: 1px solid #ccc;
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a79148'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    cursor: pointer;
}

select:hover {
    border-color: var(--gold-primary);
    background-color: var(--white);
}

select:focus {
    outline: none;
    border-color: var(--gold-primary);
    background-color: var(--white);
    box-shadow: 0 0 0 3px var(--gold-transparent);
}

select:disabled,
select[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
    color: #888888;
    border-color: #dddddd;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23999999'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

/* =========================================
   5. PANTALLA DE INGRESO (LOGIN)
   ========================================= */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.96), rgba(30, 35, 40, 0.98));
    padding: 20px;
}

.login-card {
    background-color: var(--dark-1);
    border: 1px solid var(--gold-primary);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-card .logo-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 5px 15px var(--gold-transparent);
}

.login-card h1 {
    color: var(--gold-primary);
    font-size: 26px;
    margin-bottom: 10px;
}

.login-card p {
    color: #d1d1d1;
    font-size: 14px;
    margin-bottom: 30px;
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-card .form-group label {
    display: block;
    color: var(--white);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.login-card .form-group input {
    width: 100%;
    padding: 12px;
    background-color: var(--dark-2);
    border: 1px solid #444444;
    border-radius: 5px;
    color: var(--white);
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.3s;
}

.login-card .form-group input:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.login-card .btn-primary {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
}

.login-links {
    margin-top: 25px;
    font-size: 13px;
    color: #aaaaaa;
}

.login-links a {
    color: var(--gold-primary);
    font-weight: 600;
    transition: color 0.3s;
}

.login-links a:hover {
    color: var(--gold-hover);
    text-decoration: underline;
}

/* =========================================
   6. LAYOUT DEL DASHBOARD (SIDEBAR + MAIN)
   ========================================= */
.dash-layout {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background-color: var(--light-bg);
}

.dash-sidebar {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    flex-shrink: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--dark-1);
    color: var(--white);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: width 0.25s ease, min-width 0.25s ease, max-width 0.25s ease;
}

.dash-sidebar::-webkit-scrollbar {
    width: 5px;
}
.dash-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.dash-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

.dash-logo-area {
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1px solid var(--gold-transparent);
    flex-shrink: 0;
    transition: padding 0.25s ease;
}

.dash-logo-area img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--gold-primary);
    margin-bottom: 6px;
}

.dash-logo-area h3 {
    color: var(--gold-primary);
    font-size: 17px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-logo-area small {
    color: #9ca3af;
    font-size: 11px;
    display: block;
    margin-top: 2px;
}

.dash-menu {
    flex-grow: 1;
    padding: 12px 0;
    list-style: none;
    margin: 0;
}

.dash-menu .menu-sep-texto {
    padding: 14px 20px 6px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    font-weight: 700;
}

.dash-menu li a {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    color: #a0aec0;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-size: 13.5px;
    font-weight: 600;
    border-left: 4px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-menu li a i {
    margin-right: 14px;
    font-size: 20px;
    flex-shrink: 0;
    text-align: center;
    width: 22px;
}

.dash-menu li a:hover,
.dash-menu li a.active {
    background-color: rgba(167, 145, 72, 0.12);
    color: var(--gold-primary);
    border-left: 4px solid var(--gold-primary);
}

/* Submenús */
.dash-submenu {
    display: none;
    list-style: none;
    background-color: rgba(0, 0, 0, 0.2);
}

.dash-submenu.open {
    display: block;
}

.dash-submenu li a {
    padding: 10px 25px 10px 50px;
    font-size: 13px;
    color: #888888;
    border-left: 3px solid transparent;
}

.dash-submenu li a:hover,
.dash-submenu li a.active {
    color: var(--gold-primary);
    background-color: rgba(167, 145, 72, 0.05);
    border-left: 3px solid var(--gold-primary);
}

/* Sidebar colapsado */
.dash-sidebar.colapsado {
    width: 68px;
    min-width: 68px;
    max-width: 68px;
}
.dash-sidebar.colapsado .dash-logo-area {
    padding: 12px 6px;
}
.dash-sidebar.colapsado .dash-logo-area img {
    width: 36px;
    height: 36px;
    margin-bottom: 0;
}
.dash-sidebar.colapsado .dash-logo-area h3,
.dash-sidebar.colapsado .dash-logo-area small,
.dash-sidebar.colapsado .dash-menu li a span,
.dash-sidebar.colapsado .menu-sep-texto {
    display: none !important;
}
.dash-sidebar.colapsado .dash-menu li a {
    padding: 12px 0;
    justify-content: center;
}
.dash-sidebar.colapsado .dash-menu li a i {
    margin-right: 0;
    font-size: 22px;
}
.dash-sidebar.colapsado #btn-toggle-sidebar {
    position: static !important;
    margin: 8px auto 0 !important;
}

#btn-toggle-sidebar {
    position: absolute;
    right: 8px;
    top: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(167, 145, 72, 0.25);
    color: var(--gold-primary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

#btn-toggle-sidebar:hover {
    background: rgba(167, 145, 72, 0.18);
    border-color: var(--gold-primary);
    color: var(--gold-hover);
}

/* Área principal */
.dash-main {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.dash-header {
    flex-shrink: 0;
    background-color: var(--white);
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
    width: 100%;
}

.dash-header h2 {
    color: var(--dark-1);
    font-size: 19px;
    margin: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--dark-1);
    font-weight: 600;
    font-size: 14px;
}

.dash-content {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 28px 30px;
}

.dash-content::-webkit-scrollbar {
    width: 8px;
}
.dash-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dash-cabecera-fija {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--light-bg);
    padding: 12px 0 8px;
    margin-bottom: 16px;
}

.dash-section-title {
    color: var(--dark-1);
    font-size: 22px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gold-primary);
    padding-bottom: 8px;
    display: inline-block;
}

/* =========================================
   7. TARJETAS (STATS, MÓDULOS Y CONTENIDO)
   ========================================= */
.dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dash-stat-card {
    background-color: var(--white);
    padding: 22px 24px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-stat-card .info h4 {
    margin: 0;
    font-size: 28px;
    color: var(--dark-1);
}

.dash-stat-card .info p {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-gray);
    text-transform: uppercase;
    font-weight: 600;
}

.dash-stat-card i {
    font-size: 38px;
    color: var(--gold-transparent);
}

/* Cuadrícula de Módulos (idéntica a Luma Nexus) */
.dash-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
    margin-bottom: 30px;
}

.dash-module-card {
    background-color: var(--dark-1);
    border: 1px solid var(--gold-primary);
    border-radius: 10px;
    padding: 26px 18px;
    text-align: center;
    color: var(--white);
    transition: transform 0.25s, box-shadow 0.25s, background-color 0.25s;
    text-decoration: none;
    display: block;
}

.dash-module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(167, 145, 72, 0.22);
    background-color: var(--dark-2);
}

.dash-module-card i {
    font-size: 46px;
    color: var(--gold-primary);
    margin-bottom: 12px;
    display: block;
}

.dash-module-card h3 {
    margin: 0 0 8px 0;
    font-size: 17px;
    color: var(--white);
}

.dash-module-card p {
    margin: 0;
    font-size: 12.5px;
    color: #aaaaaa;
    line-height: 1.5;
}

.dash-module-card.pendiente {
    opacity: 0.72;
}

.panel-card {
    background: linear-gradient(180deg, #ffffff 0%, #faf8f2 100%);
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 6px 18px rgba(15, 20, 25, 0.06);
    border: 1px solid rgba(167, 145, 72, 0.22);
    border-top: 4px solid var(--gold-primary);
    color: var(--text-dark);
    margin-bottom: 24px;
}

.panel-card h3 {
    color: var(--dark-1);
    margin-bottom: 20px;
    font-size: 19px;
    border-bottom: 1px solid rgba(167, 145, 72, 0.25);
    padding-bottom: 10px;
}

/* =========================================
   8. FORMULARIOS CORPORATIVOS CÁLIDOS
   ========================================= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.form-group-dash {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

.form-group-dash label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--dark-1);
    background: linear-gradient(90deg, rgba(167, 145, 72, 0.18) 0%, rgba(167, 145, 72, 0.04) 100%);
    border-left: 3px solid var(--gold-primary);
    padding: 5px 10px;
    border-radius: 0 5px 5px 0;
    margin-bottom: 2px;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.form-group-dash:focus-within label {
    background: linear-gradient(90deg, rgba(167, 145, 72, 0.30) 0%, rgba(167, 145, 72, 0.08) 100%);
    border-left-color: var(--dark-1);
    color: #000000;
}

.form-group-dash input,
.form-group-dash select,
.form-group-dash textarea {
    padding: 11px 12px;
    border: 1px solid #b8b09c;
    border-radius: 6px;
    background-color: var(--white);
    color: #111827;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(15, 20, 25, 0.05);
}

.form-group-dash textarea {
    resize: vertical;
    min-height: 90px;
}

.form-group-dash input:focus,
.form-group-dash select:focus,
.form-group-dash textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    background-color: #fffdf9;
    box-shadow: 0 0 0 3px rgba(167, 145, 72, 0.22);
}

.form-group-dash input[type="number"],
.form-group-dash input.input-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.form-group-dash input[type="tel"] {
    text-align: left !important;
}

/* =========================================
   9. TABLAS DE ALTO CONTRASTE
   ========================================= */
.table-container {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e1e1;
    overflow-x: auto;
}

.impact-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: var(--white);
}

.impact-table th {
    background-color: var(--dark-1);
    color: var(--white);
    padding: 14px 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    border-bottom: 3px solid var(--gold-primary);
}

.impact-table td {
    padding: 13px 18px;
    color: #222222;
    font-size: 13.5px;
    font-weight: 500;
    border-bottom: 1px solid #e5e5e5;
    transition: background-color 0.2s ease;
}

.impact-table td.highlight {
    background-color: rgba(167, 145, 72, 0.05);
    color: var(--dark-1);
    font-weight: 700;
}

.impact-table tr:hover td {
    background-color: rgba(167, 145, 72, 0.14);
}

/* =========================================
   10. BADGES Y ALERTAS
   ========================================= */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-ok   { background-color: var(--ok-bg);   color: var(--ok-text); }
.badge-warn { background-color: var(--warn-bg); color: var(--warn-text); }
.badge-err  { background-color: var(--err-bg);  color: var(--err-text); }
.badge-info { background-color: var(--info-bg); color: var(--info-text); }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 18px;
    border-left: 4px solid transparent;
}

.alert-ok   { background-color: var(--ok-bg);   color: var(--ok-text);   border-left-color: var(--ok-text); }
.alert-warn { background-color: var(--warn-bg); color: var(--warn-text); border-left-color: var(--warn-text); }
.alert-err  { background-color: var(--err-bg);  color: var(--err-text);  border-left-color: var(--err-text); }
.alert-info { background-color: var(--info-bg); color: var(--info-text); border-left-color: var(--info-text); }

/* =========================================
   11. EDITOR DE TEXTO PROPIO (.af-editor)
   ========================================= */
.af-editor-wrapper {
    border: 1px solid #b8b09c;
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--white);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.af-editor-wrapper:focus-within {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(167, 145, 72, 0.22);
}

.af-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 10px;
    background-color: var(--dark-1);
    border-bottom: 2px solid var(--gold-primary);
}

.af-editor-btn {
    background: transparent;
    color: var(--white);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.af-editor-btn i.material-icons {
    font-size: 18px;
}

.af-editor-btn:hover {
    background-color: rgba(167, 145, 72, 0.22);
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}

.af-editor-body {
    min-height: 140px;
    max-height: 360px;
    overflow-y: auto;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #111827;
    outline: none;
}

.af-editor-body ul,
.af-editor-body ol {
    padding-left: 22px;
    margin: 6px 0;
}

/* =========================================
   12. INPUT DE CONTRASEÑA CON OJITO Y MODALES DEL LOGIN
   ========================================= */
.pass-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pass-input-wrap input {
    padding-right: 42px !important;
}

.btn-ver-clave {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.2s;
}

.btn-ver-clave:hover {
    color: var(--gold-primary);
}

.btn-ver-clave i.material-icons {
    font-size: 20px;
}

.login-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(167, 145, 72, 0.22);
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.7;
}

.login-footer strong {
    color: var(--gold-primary);
}

.login-footer .normativa-linea {
    display: block;
    font-size: 11px;
    color: #7c8591;
    margin-top: 4px;
}

/* Modales corporativos (Términos, Habeas Data, Recuperar Contraseña) */
.af-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.af-modal-overlay.activo {
    display: flex;
}

.af-modal {
    background-color: var(--dark-1);
    border: 1px solid var(--gold-primary);
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    text-align: left;
}

.af-modal-header {
    padding: 16px 22px;
    background-color: var(--dark-2);
    border-bottom: 2px solid var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.af-modal-header h3 {
    color: var(--gold-primary);
    font-size: 17px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.af-modal-close {
    background: transparent;
    border: none;
    color: #cccccc;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.af-modal-close:hover {
    color: var(--gold-primary);
}

.af-modal-body {
    padding: 22px;
    color: #e5e7eb;
    font-size: 13.5px;
    line-height: 1.7;
    overflow-y: auto;
}

.af-modal-body p {
    margin-bottom: 10px;
    color: #e5e7eb;
}

.af-modal-body ul,
.af-modal-body ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.af-modal-footer {
    padding: 14px 22px;
    background-color: var(--dark-2);
    border-top: 1px solid rgba(167, 145, 72, 0.2);
    text-align: right;
}

/* =========================================
   13. LAYOUT SIN SCROLL (1/3 + 2/3, RIBETES/PESTAÑAS Y BARRA DE MÓDULO)
   ========================================= */
.af-toolbar-modulo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.af-toolbar-modulo .dash-section-title {
    margin-bottom: 0;
    font-size: 20px;
    padding-bottom: 5px;
}

.af-toolbar-acciones {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.af-split-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 18px;
    align-items: start;
}

@media (max-width: 1050px) {
    .af-split-1-2 {
        grid-template-columns: 1fr;
    }
}

.af-panel-compact {
    background: linear-gradient(180deg, #ffffff 0%, #faf8f2 100%);
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 6px 18px rgba(15, 20, 25, 0.06);
    border: 1px solid rgba(167, 145, 72, 0.22);
    border-top: 4px solid var(--gold-primary);
    color: var(--text-dark);
    margin-bottom: 16px;
}

.af-panel-compact h3 {
    color: var(--dark-1);
    margin-bottom: 12px;
    font-size: 16px;
    border-bottom: 1px solid rgba(167, 145, 72, 0.25);
    padding-bottom: 7px;
}

.af-form-compact .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 0;
}

.af-form-compact .form-group-dash label {
    font-size: 11.5px;
    padding: 3px 8px;
}

.af-form-compact .form-group-dash input,
.af-form-compact .form-group-dash select {
    padding: 7px 10px;
    font-size: 13px;
}

/* Ribetes / Pestañas corporativas */
.af-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--gold-primary);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.af-tab-btn {
    background-color: var(--dark-2);
    color: #cbd5e1;
    border: 1px solid rgba(167, 145, 72, 0.35);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 9px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background-color 0.2s, color 0.2s;
}

.af-tab-btn i.material-icons {
    font-size: 18px;
}

.af-tab-btn:hover {
    color: var(--gold-hover);
    background-color: var(--dark-1);
}

.af-tab-btn.activo {
    background-color: var(--gold-primary);
    color: var(--dark-1);
    border-color: var(--gold-primary);
    font-weight: 700;
}

.af-tab-pane {
    display: none;
}

.af-tab-pane.activo {
    display: block;
}

/* Editor más alto en vista 2/3 para aprovechar toda la pantalla sin scroll general */
.af-editor-alto .af-editor-body {
    min-height: 330px;
    max-height: 460px;
}
