/* =====================================================================
   Colores GENÉRICOS de MultiSuite (cuando no hay empresa abierta):
     verde azulado #0F766E → principal: botones, menú activo, enlaces
     pizarra       #1E293B → títulos de página
     acento        #5FC9BE → enlaces y menú activo en modo oscuro
   Cada empresa pone SUS colores, logo y plecas en Configuración › Empresa:
   el layout los aplica encima de estos (MarcaHelper.Estilo). No se edita este archivo por cliente.
   ===================================================================== */
:root,
[data-bs-theme=dark] {
    --ms-principal: #0F766E;
    --ms-principal-oscuro: #0B5D57;
    --ms-marino: #1E293B;
    --ms-acento: #5FC9BE;
    --bs-primary: #0F766E;
    --bs-primary-rgb: 15, 118, 110;
    --bs-primary-bg-subtle: rgba(15, 118, 110, .12);
    --bs-primary-border-subtle: rgba(15, 118, 110, .35);
    --bs-primary-text-emphasis: #0B5D57;
    --bs-link-color: #0F766E;
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color: #0B5D57;
    --bs-link-hover-color-rgb: 11, 93, 87;
    --bs-focus-ring-color: rgba(15, 118, 110, .25);
}

[data-bs-theme=dark] {
    --bs-primary-text-emphasis: #9EE0D8;
    --bs-link-color: #5FC9BE;
    --bs-link-color-rgb: 95, 201, 190;
    --bs-link-hover-color: #9EE0D8;
    --bs-link-hover-color-rgb: 158, 224, 216;
}

[data-bs-theme=dark] #sidebar-menu ul li.mm-active > a,
[data-bs-theme=dark] #sidebar-menu ul li a.active,
[data-bs-theme=dark] #sidebar-menu ul li.mm-active > a i,
[data-bs-theme=dark] #sidebar-menu ul li a.active i {
    color: var(--ms-acento) !important;
}

.navbar-brand-box .logo img { object-fit: contain; }
.navbar-brand-box .logo-lg img { max-width: 220px; }

.btn-primary { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    filter: brightness(.9);
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.bg-primary { background-color: var(--bs-primary) !important; }
.text-primary { color: var(--bs-primary) !important; }
.page-item.active .page-link { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }

#sidebar-menu ul li.mm-active > a, #sidebar-menu ul li a.active,
#sidebar-menu ul li.mm-active > a i, #sidebar-menu ul li a.active i {
    color: var(--bs-primary) !important;
}

.logo-txt {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    display: inline-block;
    vertical-align: middle;
}

a { color: var(--bs-link-color); }
a:hover { color: var(--bs-link-hover-color); }

.btn-soft-primary { color: var(--bs-primary); background-color: rgba(var(--bs-primary-rgb), .1); border-color: transparent; }
.btn-soft-primary:hover, .btn-soft-primary:focus, .btn-soft-primary:active {
    color: #fff !important;
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.btn-outline-primary { color: var(--bs-primary); border-color: var(--bs-primary); }
.btn-outline-primary:hover { color: #fff; background-color: var(--bs-primary); border-color: var(--bs-primary); }

.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .15rem var(--bs-focus-ring-color);
}

.alert-primary {
    color: var(--bs-primary-text-emphasis);
    background-color: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary-border-subtle);
}

/* Títulos de página en el marino (en oscuro, el texto normal) */
.page-title-box h4 { color: var(--ms-marino); }
[data-bs-theme=dark] .page-title-box h4 { color: var(--bs-body-color); }

/* ---------- 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 {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: .9rem 1.5rem; border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-secondary-bg);
}
.selector-barra .marca { display: flex; align-items: center; gap: .6rem; }
.selector-barra .marca img { height: 34px; }
.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(--bs-secondary-bg); cursor: pointer;
    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; }

/* Botón de empresa en el encabezado */
.empresa-actual .texto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 180px; vertical-align: middle; }

/* 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; }
