/* =====================================================================
   MultiEmpresa360 · estilos propios del sistema (sobre la plantilla Zatarra360)
   Los colores generales están en assets/zatarra360/css/zatarra360.css (verde agua).
   Cada empresa pone SUS colores en Configuración › Empresa: el layout los aplica
   encima con MarcaHelper.Estilo. No se edita este archivo por cliente.
   ===================================================================== */

/* Variables que usaban las pantallas anteriores: ahora salen de la paleta de Zatarra360 */
:root, [data-bs-theme=dark] {
    --ms-principal: var(--zt-primario);
    --ms-principal-oscuro: var(--zt-primario-hover);
    --ms-marino: var(--zt-marca-oscuro);
    --ms-acento: var(--zt-acento-claro);
}

/* ---------- Selector de empresas ---------- */
.selector-fondo {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(var(--bs-primary-rgb), .14), transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(var(--bs-primary-rgb), .10), transparent 45%),
        var(--bs-body-bg);
}
.selector-barra {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    min-height: var(--zt-barra-alto); padding: .75rem 1.5rem; border-bottom: 1px solid var(--zt-borde);
    background: var(--zt-superficie);
}
.selector-barra .marca { display: flex; align-items: center; gap: .6rem; }
.selector-barra .marca img { height: 34px; }
/* Logo: versión clara u oscura según el tema del sistema (botón de la luna) */
.logo-oscuro { display: none !important; }
[data-bs-theme="dark"] .logo-claro { display: none !important; }
[data-bs-theme="dark"] .logo-oscuro { display: inline-block !important; }
.selector-contenido { max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }

.tarjeta-empresa {
    position: relative; display: flex; flex-direction: column; height: 100%;
    border: 1px solid var(--bs-border-color); border-radius: .75rem;
    background: var(--zt-superficie); cursor: pointer; box-shadow: var(--zt-sombra);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tarjeta-empresa:hover, .tarjeta-empresa:focus-visible {
    transform: translateY(-2px); box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .08);
    border-color: var(--color-empresa, var(--bs-primary)); outline: none;
}
.tarjeta-empresa .franja { height: 6px; background: var(--color-empresa, var(--bs-primary)); border-radius: .75rem .75rem 0 0; }
.tarjeta-empresa .cuerpo { display: flex; gap: .9rem; align-items: center; padding: 1rem 1rem .75rem; }
.tarjeta-empresa .logo {
    flex: 0 0 64px; height: 64px; border-radius: .6rem; display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--bs-border-color); overflow: hidden;
}
.tarjeta-empresa .logo img { max-width: 56px; max-height: 56px; object-fit: contain; }
.tarjeta-empresa .logo .iniciales {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.35rem; color: #fff; background: var(--color-empresa, var(--bs-primary));
}
.tarjeta-empresa .datos { flex: 1 1 auto; min-width: 0; }
.tarjeta-empresa .nombre {
    font-weight: 600; font-size: 1rem; line-height: 1.25; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.tarjeta-empresa .clave { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tarjeta-empresa .menu-empresa .btn { line-height: 1.2; }
/* Con el menú abierto, la tarjeta queda encima de las de abajo */
.tarjeta-empresa:has(.dropdown-menu.show) { z-index: 5; transform: none; }
.tarjeta-empresa .pie {
    margin-top: auto; display: flex; justify-content: space-between; align-items: center;
    padding: .55rem 1rem; border-top: 1px dashed var(--bs-border-color); font-size: .8rem; color: var(--bs-secondary-color);
}
.tarjeta-empresa.inactiva { opacity: .6; }
.tarjeta-empresa.abierta { box-shadow: 0 0 0 2px var(--color-empresa, var(--bs-primary)); }
.tarjeta-nueva {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; height: 100%; min-height: 150px;
    border: 2px dashed var(--bs-border-color); border-radius: .75rem; color: var(--bs-secondary-color); cursor: pointer;
    background: transparent; width: 100%;
}
.tarjeta-nueva:hover { border-color: var(--bs-primary); color: var(--bs-primary); }

/* ---------- Inicio: módulos ---------- */
.tarjeta-modulo { border-radius: .75rem; height: 100%; transition: transform .12s ease; }
a.tarjeta-modulo:hover { transform: translateY(-2px); }
.tarjeta-modulo .icono {
    width: 44px; height: 44px; border-radius: .6rem; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--bs-primary-rgb), .12); color: var(--bs-primary);
}
.tarjeta-modulo.bloqueado { opacity: .55; }
.encabezado-empresa { display: flex; align-items: center; gap: 1rem; }
.encabezado-empresa img { max-height: 56px; max-width: 160px; object-fit: contain; }
.pleca-muestra { width: 100%; max-height: 40px; object-fit: cover; border-radius: .4rem; }


/* Vista previa de logo y plecas */
.vista-imagen {
    border: 1px dashed var(--bs-border-color); border-radius: .5rem; min-height: 90px;
    display: flex; align-items: center; justify-content: center; padding: .5rem; background: #fff;
}
.vista-imagen img { max-width: 100%; max-height: 120px; object-fit: contain; }

/* Vista previa de la hoja membretada (proporción carta 612 x 792) con las líneas de los márgenes */
.hoja-vista { position: relative; width: 100%; max-width: 300px; aspect-ratio: 612 / 792; border: 1px solid var(--bs-border-color); background: #fff; }
.hoja-vista .fondo-hoja { width: 100%; height: 100%; object-fit: fill; display: block; }
.hoja-vista .linea-margen { position: absolute; left: 4%; right: 4%; border-top: 2px dashed rgba(220, 53, 69, .8); }
.hoja-vista .marca-agua-vista { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: auto; object-fit: contain; pointer-events: none; }

/* ---------- Editor del correo (Quill) ---------- */
#modal-redactar .ql-toolbar.ql-snow { border-color: var(--bs-border-color); border-radius: .25rem .25rem 0 0; }
#modal-redactar .ql-container.ql-snow { border-color: var(--bs-border-color); border-radius: 0 0 .25rem .25rem; font-size: .875rem; font-family: inherit; }
[data-bs-theme="dark"] #modal-redactar .ql-snow .ql-stroke { stroke: #ced4da; }
[data-bs-theme="dark"] #modal-redactar .ql-snow .ql-fill { fill: #ced4da; }
[data-bs-theme="dark"] #modal-redactar .ql-snow .ql-picker { color: #ced4da; }
[data-bs-theme="dark"] #modal-redactar .ql-snow .ql-picker-options { background-color: var(--bs-body-bg); }
[data-bs-theme="dark"] #modal-redactar .ql-editor.ql-blank::before { color: #8a929a; }

/* ---------- Aviso de privacidad y términos de uso (texto editable en Sistema › Datos legales) ---------- */
.legal-texto h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.legal-texto ul, .legal-texto ol { padding-left: 1.5rem; }
.legal-texto .ql-align-center { text-align: center; }
.legal-texto .ql-align-right { text-align: right; }
.legal-texto .ql-align-justify { text-align: justify; }
.legal-texto blockquote { border-left: 3px solid var(--zt-borde); padding-left: 1rem; color: var(--bs-secondary-color); }
