/*
 * Mestto — extensiones de marca sobre el UI Kit Larkon.
 * Se carga después de app.min.css. Ver docs/design-system.md §34 y docs/theme-color.md.
 *
 * Primario (compilado en app.css): #ffec00
 * Fondo oscuro de marca:           #1e1e1e
 */

:root {
    --ls-brand-dark: #1e1e1e;
    --ls-brand-dark-rgb: 30, 30, 30;
    /* Texto sobre el amarillo: el Kit fija #fff, ilegible sobre #ffec00 */
    --ls-on-primary: #1e1e1e;
}

.logo-box .logo-lg{
    height: 30px;
}

.logo-box .logo-sm{
    height: 25px;
}

/* ───────────── Fondo oscuro de marca ───────────── */

html[data-menu-color=dark],
html[data-bs-theme=dark][data-menu-color=light] {
    --bs-main-nav-bg: var(--ls-brand-dark);
    --bs-main-nav-item-color: #a3a3a3;
    --bs-main-nav-border-color: #2e2e2e;
}

html[data-topbar-color=dark],
html[data-bs-theme=dark][data-topbar-color=light] {
    --bs-topbar-bg: var(--ls-brand-dark);
    --bs-topbar-search-bg: #2a2a2a;
}

/* Modo oscuro en grises neutros (el Kit usa grises azulados) */
html[data-bs-theme=dark],
[data-bs-theme=dark] {
    --bs-body-bg: var(--ls-brand-dark);
    --bs-body-bg-rgb: var(--ls-brand-dark-rgb);
    --bs-secondary-bg: #262626;
    --bs-secondary-bg-rgb: 38, 38, 38;
    --bs-tertiary-bg: #2e2e2e;
    --bs-tertiary-bg-rgb: 46, 46, 46;
    --bs-border-color: #333333;
    --bs-light: #2e2e2e;
    --bs-light-rgb: 46, 46, 46;
    --bs-input-border-color: #3a3a3a;
    --bs-input-focus-border-color: #4d4d4d;
}

/* ───────────── Legibilidad del primario en modo claro ─────────────
 * #ffec00 sobre blanco tiene contraste ~1.2:1. Sobre superficies claras el
 * texto "primario" usa el tono oscuro derivado (--bs-primary-text-emphasis);
 * los fondos, bordes y el menú oscuro conservan el amarillo de marca. */

html:not([data-bs-theme=dark]) {
    --bs-link-hover-color: var(--bs-primary-text-emphasis);
    --bs-link-hover-color-rgb: 102, 94, 0;
}

html:not([data-bs-theme=dark]) .text-primary,
html:not([data-bs-theme=dark]) .link-primary,
html:not([data-bs-theme=dark]) .link-primary:hover,
html:not([data-bs-theme=dark]) .link-primary:focus {
    color: var(--bs-primary-text-emphasis) !important;
}

html:not([data-bs-theme=dark]) .nav-tabs {
    --bs-nav-tabs-link-active-color: var(--bs-primary-text-emphasis);
}

html:not([data-bs-theme=dark]) .btn-soft-primary {
    --bs-btn-color: var(--bs-primary-text-emphasis);
    --bs-btn-bg: rgba(var(--bs-primary-rgb), .25);
}

html[data-menu-color=light]:not([data-bs-theme=dark]) {
    --bs-main-nav-item-hover-color: var(--bs-primary-text-emphasis);
}

html[data-topbar-color=light]:not([data-bs-theme=dark]) .topbar .topbar-item .topbar-button:is(.show, .active, :active, :hover) {
    color: var(--bs-primary-text-emphasis);
}

/* El menú oscuro mantiene el amarillo (contraste alto sobre #1e1e1e) */
html[data-menu-color=dark] .main-nav .text-primary {
    color: var(--bs-primary) !important;
}

/* ───────────── Texto sobre fondo amarillo ───────────── */

.ls-text-on-primary {
    color: var(--ls-on-primary) !important;
}

/* La X de cierre se mantiene oscura sobre amarillo, también en modo oscuro */
.bg-primary .btn-close {
    filter: none;
}

.btn-soft-primary {
    --bs-btn-hover-color: var(--ls-on-primary);
    --bs-btn-active-color: var(--ls-on-primary);
}

.nav-pills {
    --bs-nav-pills-link-active-color: var(--ls-on-primary);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: var(--ls-on-primary);
}

.pagination {
    --bs-pagination-active-color: var(--ls-on-primary);
}

.list-group {
    --bs-list-group-active-color: var(--ls-on-primary);
}

.form-check-input:checked[type=checkbox] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231e1e1e' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:checked[type=radio] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%231e1e1e'/%3e%3c/svg%3e");
}

.form-check-input[type=checkbox]:indeterminate {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231e1e1e' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:checked {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%231e1e1e'/%3e%3c/svg%3e");
}

.choices__list--multiple .choices__item,
.gridjs-pagination .gridjs-pages button.gridjs-currentPage,
.progressbar li.active::before,
.conversation-list .odd .ctext-wrap,
.chat-conversation-list .odd .chat-ctext-wrap,
.tasks .task-header,
.card-pricing .pricing-ribbon,
.card-pricing-recommended,
.product-card .btn-prod-card:is(:hover, :focus, :active),
.fc .fc-button-primary,
.fc-state-down,
.fc-state-active {
    color: var(--ls-on-primary);
}
