/* ============================================================
   TEMA OSCURO - TopLand (front + panel admin)
   Se activa con <html data-theme="dark">
   Paleta:
     --tl-bg        #0f1620   fondo general
     --tl-bg-2      #16202c   superficie (cards, topbar, sidebar)
     --tl-bg-3      #1e2a38   superficie elevada (inputs, hover)
     --tl-border    #2a3848   bordes
     --tl-text      #e6edf5   texto principal
     --tl-text-2    #9fb0c3   texto secundario
     --tl-primary   #f02c2d   color de marca (se mantiene)
     --tl-secondary #0A547A
   ============================================================ */

html[data-theme="dark"] {
    --tl-bg: #0f1620;
    --tl-bg-2: #16202c;
    --tl-bg-3: #1e2a38;
    --tl-border: #2a3848;
    --tl-text: #e6edf5;
    --tl-text-2: #9fb0c3;
    color-scheme: dark;
}

/* ---------- base ---------- */
html[data-theme="dark"] body,
html[data-theme="dark"] .main_menu,
html[data-theme="dark"] .wsus__main_menu,
html[data-theme="dark"] .wsus__footer,
html[data-theme="dark"] .wsus__copyright,
html[data-theme="dark"] .wsus__dashboard,
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .main-navbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .wsus__topbar_right_area {
    background-color: var(--tl-bg) !important;
    color: var(--tl-text) !important;
}

html[data-theme="dark"] body {
    color: var(--tl-text) !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] p,
html[data-theme="dark"] span,
html[data-theme="dark"] li,
html[data-theme="dark"] label,
html[data-theme="dark"] td,
html[data-theme="dark"] th,
html[data-theme="dark"] .wsus__single_property_title,
html[data-theme="dark"] .wsus__blog_title,
html[data-theme="dark"] .wsus__section_heading h2,
html[data-theme="dark"] .wsus__about_text,
html[data-theme="dark"] .wsus__property_text,
html[data-theme="dark"] .wsus__single_property_text,
html[data-theme="dark"] .wsus__dash_info_text,
html[data-theme="dark"] .wsus__comm_text {
    color: var(--tl-text) !important;
}

html[data-theme="dark"] .wsus__property_text p,
html[data-theme="dark"] .wsus__about_text p,
html[data-theme="dark"] .wsus__single_property_text p,
html[data-theme="dark"] .wsus__comm_text p,
html[data-theme="dark"] .wsus__blog_text p {
    color: var(--tl-text-2) !important;
}

/* ---------- superficies ---------- */
html[data-theme="dark"] .wsus__single_property,
html[data-theme="dark"] .wsus__single_blog,
html[data-theme="dark"] .wsus__blog_post,
html[data-theme="dark"] .wsus__blog_text,
html[data-theme="dark"] .wsus__about_single,
html[data-theme="dark"] .wsus__agent_profile,
html[data-theme="dark"] .wsus__checkout,
html[data-theme="dark"] .wsus__contact_single,
html[data-theme="dark"] .wsus__dash_info,
html[data-theme="dark"] .wsus__dash_order,
html[data-theme="dark"] .wsus__dash_invoice,
html[data-theme="dark"] .wsus__dash_change_pass,
html[data-theme="dark"] .wsus__banner_search,
html[data-theme="dark"] .wsus__con_form_single,
html[data-theme="dark"] .wsus__search_area,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .wsus__breadcrumb,
html[data-theme="dark"] .wsus__banner_single,
html[data-theme="dark"] .wsus__single_property_details,
html[data-theme="dark"] .wsus__property_details {
    background-color: var(--tl-bg-3) !important;
    border-color: var(--tl-border) !important;
    color: var(--tl-text) !important;
}

/* ---------- barra superior y menu ---------- */
html[data-theme="dark"] .wsus__topbar {
    background-color: #141d27 !important;
    color: var(--tl-text-2) !important;
    border-bottom: 1px solid var(--tl-border);
}

html[data-theme="dark"] .wsus__topbar a,
html[data-theme="dark"] .wsus__topbar i {
    color: var(--tl-text-2) !important;
}

html[data-theme="dark"] .main_menu,
html[data-theme="dark"] .wsus__main_menu,
html[data-theme="dark"] .main-navbar {
    background-color: var(--tl-bg-2) !important;
    border-bottom: 1px solid var(--tl-border);
}

html[data-theme="dark"] .main_menu .nav-link,
html[data-theme="dark"] .wsus__main_menu .wsus__main_menu_list > li > a,
html[data-theme="dark"] .wsus__main_menu .wsus__main_menu_list > li > ul > li > a,
html[data-theme="dark"] .navbar-nav .nav-link {
    color: var(--tl-text) !important;
}

html[data-theme="dark"] .main_menu .nav-link:hover,
html[data-theme="dark"] .main_menu .nav-link.active,
html[data-theme="dark"] .wsus__main_menu .wsus__main_menu_list > li:hover > a,
html[data-theme="dark"] .wsus__main_menu .wsus__main_menu_list > li > ul > li:hover > a,
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .nav-link:hover {
    background-color: var(--tl-bg-3) !important;
    color: #fff !important;
}

html[data-theme="dark"] .main_menu .dropdown-menu,
html[data-theme="dark"] .wsus__main_menu .wsus__main_menu_list > li > ul,
html[data-theme="dark"] .dropdown-menu {
    background-color: var(--tl-bg-3) !important;
    border-color: var(--tl-border);
}

html[data-theme="dark"] .main_menu .dropdown-item,
html[data-theme="dark"] .wsus__main_menu .wsus__main_menu_list > li > ul > li > a {
    color: var(--tl-text) !important;
}

/* el logo del front va sobre la navbar */
html[data-theme="dark"] .main_menu .navbar-brand {
    background-color: var(--tl-bg-2) !important;
}

/* ---------- footer ---------- */
html[data-theme="dark"] .wsus__footer {
    background-color: #141d27 !important;
    border-top: 1px solid var(--tl-border);
}

html[data-theme="dark"] .wsus__footer h4,
html[data-theme="dark"] .wsus__footer h3,
html[data-theme="dark"] .wsus__copyright h3 {
    color: #fff !important;
}

html[data-theme="dark"] .wsus__footer p,
html[data-theme="dark"] .wsus__footer li,
html[data-theme="dark"] .wsus__footer a,
html[data-theme="dark"] .wsus__copyright p {
    color: var(--tl-text-2) !important;
}

html[data-theme="dark"] .wsus__footer a:hover {
    color: #fff !important;
}

/* ---------- formularios ---------- */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .custom-select,
html[data-theme="dark"] .select2-container--default .select2-selection--single {
    background-color: var(--tl-bg-3) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--tl-text-2) !important;
    opacity: 1;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--tl-text) !important;
}

html[data-theme="dark"] .select2-container--default .select2-results__option {
    background-color: var(--tl-bg-3);
    color: var(--tl-text);
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #2b3b4d;
}

/* ---------- botones ---------- */
html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-light,
html[data-theme="dark"] .btn-default,
html[data-theme="dark"] .common_btn,
html[data-theme="dark"] .common_btn2 {
    background: transparent !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-light:hover,
html[data-theme="dark"] .btn-default:hover {
    background: var(--tl-bg-3) !important;
    color: #fff !important;
}

/* ---------- badges, alerts y tablas ---------- */
html[data-theme="dark"] .badge-secondary {
    background-color: var(--tl-bg-3) !important;
    color: var(--tl-text) !important;
}

html[data-theme="dark"] .alert-secondary,
html[data-theme="dark"] .alert-info {
    background-color: var(--tl-bg-3) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

html[data-theme="dark"] .table thead th {
    background-color: var(--tl-bg-3) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

/* ---------- panel admin ---------- */
html[data-theme="dark"] .main-navbar {
    background-color: var(--tl-bg-2) !important;
}

html[data-theme="dark"] .navbar-bg {
    background: var(--tl-bg) !important;
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .main-sidebar,
html[data-theme="dark"] .sidebar .sidebar-menu,
html[data-theme="dark"] .sidebar .sidebar-menu .sidebar-header,
html[data-theme="dark"] .main-sidebar .sidebar-header,
html[data-theme="dark"] .main-sidebar .nav-header,
html[data-theme="dark"] .wsus__topbar_right_area {
    background-color: var(--tl-bg) !important;
    color: var(--tl-text) !important;
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .sidebar .sidebar-menu,
html[data-theme="dark"] .sidebar .sidebar-menu .sidebar-header {
    background-color: var(--tl-bg-2) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .sidebar .sidebar-menu li a,
html[data-theme="dark"] .sidebar .sidebar-header,
html[data-theme="dark"] .main-sidebar .sidebar-menu li a,
html[data-theme="dark"] .main-sidebar .nav-header,
html[data-theme="dark"] .main-sidebar .sidebar-header {
    color: var(--tl-text) !important;
}

html[data-theme="dark"] .sidebar .sidebar-menu li a:hover,
html[data-theme="dark"] .main-sidebar .sidebar-menu li a:hover {
    background-color: var(--tl-bg-3) !important;
    color: #fff !important;
}

html[data-theme="dark"] .sidebar .sidebar-menu li.active > a,
html[data-theme="dark"] .main-sidebar .sidebar-menu li.active > a {
    background-color: var(--tl-primary) !important;
    color: #fff !important;
}

/* menu desplegable dentro del sidebar */
html[data-theme="dark"] .main-sidebar .sidebar-menu li a .nav-link,
html[data-theme="dark"] .main-sidebar .submenu,
html[data-theme="dark"] .main-sidebar .treeview-menu {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text-2) !important;
}

html[data-theme="dark"] .main-sidebar .dropdown-menu a.nav-link,
html[data-theme="dark"] .main-sidebar .dropdown-menu .nav-item a {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
}

html[data-theme="dark"] .main-sidebar .dropdown-menu a.nav-link:hover,
html[data-theme="dark"] .main-sidebar .dropdown-menu a.nav-link.active {
    background-color: var(--tl-bg-3) !important;
    color: #fff !important;
}

html[data-theme="dark"] .main-sidebar .submenu a:hover {
    color: #fff !important;
}

/* encabezado de pagina (titulo + breadcrumb) */
html[data-theme="dark"] .section-header,
html[data-theme="dark"] .section-header h1,
html[data-theme="dark"] .section-header h2,
html[data-theme="dark"] .section-header .breadcrumb,
html[data-theme="dark"] .section-header .breadcrumb-item,
html[data-theme="dark"] .section-header .breadcrumb-item a {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .section-header .breadcrumb-item a {
    color: var(--tl-text-2) !important;
}

html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .breadcrumb-item,
html[data-theme="dark"] .breadcrumb-item a {
    background-color: transparent !important;
    color: var(--tl-text-2) !important;
}

html[data-theme="dark"] .main-content {
    background-color: var(--tl-bg) !important;
}

html[data-theme="dark"] .header_admin,
html[data-theme="dark"] .navbar-brand,
html[data-theme="dark"] .top-navbar .dropdown-menu {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
}

/* ---------- pestanas / tabs ---------- */
html[data-theme="dark"] .nav-tabs .nav-link,
html[data-theme="dark"] .nav-tabs .nav-item.show .nav-link {
    background-color: var(--tl-bg-2) !important;
    border-color: var(--tl-border) !important;
    color: var(--tl-text-2) !important;
}

html[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--tl-bg-3) !important;
    color: var(--tl-text) !important;
}

/* ---------- barra de filtros y selects ---------- */
html[data-theme="dark"] .wsus__property_topbar,
html[data-theme="dark"] .wsus__property_topbar .list,
html[data-theme="dark"] .nice-select .list,
html[data-theme="dark"] .wsus__property_topbar a,
html[data-theme="dark"] .wsus__property_topbar span {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .wsus__property_topbar a:hover {
    background-color: var(--tl-bg-3) !important;
    color: #fff !important;
}

/* ---------- secciones del front ---------- */
html[data-theme="dark"] .wsus__new_properties,
html[data-theme="dark"] .wsus__popular_properties,
html[data-theme="dark"] .wsus__top_properties,
html[data-theme="dark"] .wsus__services,
html[data-theme="dark"] .wsus__about,
html[data-theme="dark"] .wsus__about_page,
html[data-theme="dark"] .wsus__agents,
html[data-theme="dark"] .wsus__testimonial,
html[data-theme="dark"] .wsus__pricing,
html[data-theme="dark"] .wsus__faq,
html[data-theme="dark"] .wsus__contact,
html[data-theme="dark"] .wsus__property_page,
html[data-theme="dark"] .wsus__property_details,
html[data-theme="dark"] .wsus__blog,
html[data-theme="dark"] .wsus__blog_details,
html[data-theme="dark"] .wsus__custome_page,
html[data-theme="dark"] .wsus__career,
html[data-theme="dark"] .wsus__career_details,
html[data-theme="dark"] .wsus__checkout,
html[data-theme="dark"] .wsus__logon,
html[data-theme="dark"] .wsus__agent_profile {
    background-color: var(--tl-bg) !important;
    color: var(--tl-text) !important;
}

/* ---------- tarjetas de servicios / propiedades destacadas ---------- */
html[data-theme="dark"] .wsus__top_properties_item,
html[data-theme="dark"] .wsus__single_service,
html[data-theme="dark"] .wsus__single_property_box,
html[data-theme="dark"] .wsus__service_item {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .wsus__top_properties_item h3,
html[data-theme="dark"] .wsus__top_properties_item h4,
html[data-theme="dark"] .wsus__top_properties_item h5,
html[data-theme="dark"] .wsus__top_properties_item p,
html[data-theme="dark"] .wsus__top_properties_item span,
html[data-theme="dark"] .wsus__single_service h3,
html[data-theme="dark"] .wsus__single_service h4,
html[data-theme="dark"] .wsus__single_service h5,
html[data-theme="dark"] .wsus__single_service p,
html[data-theme="dark"] .wsus__single_service span {
    color: var(--tl-text) !important;
}

/* ---------- detalle de propiedad ---------- */
html[data-theme="dark"] .wsus__single_details,
html[data-theme="dark"] .wsus__single_details.details_future,
html[data-theme="dark"] .wsus__single_details.details_description,
html[data-theme="dark"] .wsus__single_details.details_review,
html[data-theme="dark"] .wsus__share_blog,
html[data-theme="dark"] .wsus__single_details_details,
html[data-theme="dark"] .wsus__single_agent_details,
html[data-theme="dark"] .wsus__review_area {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .wsus__single_details h2,
html[data-theme="dark"] .wsus__single_details h3,
html[data-theme="dark"] .wsus__single_details h4,
html[data-theme="dark"] .wsus__single_details h5,
html[data-theme="dark"] .wsus__single_details p,
html[data-theme="dark"] .wsus__single_details span,
html[data-theme="dark"] .wsus__single_details li,
html[data-theme="dark"] .wsus__share_blog p,
html[data-theme="dark"] .wsus__share_blog span,
html[data-theme="dark"] .wsus__single_details_details p,
html[data-theme="dark"] .wsus__single_details_details span {
    color: var(--tl-text) !important;
}

/* ---------- login / registro del front ---------- */
html[data-theme="dark"] .wsus__login_form,
html[data-theme="dark"] .wsus__logon_form {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

/* ---------- imagenes con borde (img-thumbnail) ---------- */
html[data-theme="dark"] .img-thumbnail {
    background-color: var(--tl-bg-3) !important;
    border-color: var(--tl-border) !important;
}

/* ---------- testimonios ---------- */
html[data-theme="dark"] .wsus__testimonial {
    background-image: none !important;
    background-color: var(--tl-bg) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .wsus__testi_item,
html[data-theme="dark"] .wsus__testimonial .wsus__testi_item {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .wsus__testi_item p,
html[data-theme="dark"] .wsus__testi_item span,
html[data-theme="dark"] .wsus__testi_item h3,
html[data-theme="dark"] .wsus__testi_item h5,
html[data-theme="dark"] .wsus__testimonial .wsus__section_heading p {
    color: var(--tl-text-2) !important;
}

html[data-theme="dark"] .wsus__testimonial .wsus__section_heading h2 {
    color: var(--tl-text) !important;
}

/* logo del footer: en oscuro se necesita version clara */
html[data-theme="dark"] .footer_logo img,
html[data-theme="dark"] .wsus__footer .footer_logo img {
    filter: brightness(0) invert(1);
    opacity: .92;
}

/* ---------- sidebar de busqueda (front) ---------- */
html[data-theme="dark"] .wsus__search_property,
html[data-theme="dark"] .wsus__search_area,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .accordion-button,
html[data-theme="dark"] .accordion-button:not(.collapsed),
html[data-theme="dark"] .wsus__search_property .card {
    background-color: var(--tl-bg-2) !important;
    color: var(--tl-text) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .accordion-button::after {
    filter: invert(1) brightness(1.6);
}

/* ---------- titulos de tarjeta ---------- */
html[data-theme="dark"] .wsus__single_property a.title,
html[data-theme="dark"] .wsus__single_property .title,
html[data-theme="dark"] .wsus__single_property p,
html[data-theme="dark"] .wsus__single_property span,
html[data-theme="dark"] .wsus__single_property_text a,
html[data-theme="dark"] .wsus__blog_post a.title,
html[data-theme="dark"] .wsus__blog_post .title,
html[data-theme="dark"] .wsus__blog_post p,
html[data-theme="dark"] .wsus__blog_post span,
html[data-theme="dark"] .wsus__single_blog a.title,
html[data-theme="dark"] .wsus__single_blog .title,
html[data-theme="dark"] .wsus__single_blog h3,
html[data-theme="dark"] .wsus__single_blog h4,
html[data-theme="dark"] .wsus__single_blog h5,
html[data-theme="dark"] .wsus__single_blog p,
html[data-theme="dark"] .wsus__single_blog span,
html[data-theme="dark"] .wsus__blog_text a,
html[data-theme="dark"] .wsus__blog_text h3,
html[data-theme="dark"] .wsus__blog_text h4,
html[data-theme="dark"] .wsus__blog_text p {
    color: var(--tl-text) !important;
}

html[data-theme="dark"] .wsus__single_property a.title:hover,
html[data-theme="dark"] .wsus__blog_post a.title:hover,
html[data-theme="dark"] .wsus__single_blog a.title:hover {
    color: #fff !important;
}

/* ---------- botón del toggle ---------- */
.tl-theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--tl-border, rgba(255, 255, 255, .25));
    background: rgba(255, 255, 255, .08);
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
    line-height: 1;
    padding: 0;
    flex: 0 0 auto;
}

.tl-theme-toggle:hover {
    background: rgba(255, 255, 255, .18);
    transform: rotate(-18deg);
}

.tl-theme-toggle i {
    font-size: 15px;
}

html[data-theme="dark"] .tl-theme-toggle {
    background: rgba(255, 255, 255, .12);
}

/* en el panel admin el boton va sobre la navbar azul */
.main-navbar .tl-theme-toggle {
    color: #fff;
    border-color: rgba(255, 255, 255, .35);
}

/* boton flotante en el sidebar del dashboard del cliente */
.wsus__dashboard_logo {
    position: relative;
}

/* boton flotante en las pantallas de login */
.tl-theme-toggle-corner {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 1080;
}

html[data-theme="dark"] .tl-theme-toggle-corner .tl-theme-toggle {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}

.tl-theme-toggle-float {
    position: absolute;
    top: 10px;
    right: 12px;
}

html[data-theme="dark"] .wsus__dashboard_logo,
html[data-theme="dark"] .wsus__dashboard_side_bar {
    background-color: var(--tl-bg-2) !important;
    border-color: var(--tl-border) !important;
}

html[data-theme="dark"] .wsus__dashboard_side_bar {
    background: var(--tl-bg-2) !important;
}

html[data-theme="dark"] .wsus__deshboard_menu li a {
    color: var(--tl-text) !important;
}

html[data-theme="dark"] .wsus__deshboard_menu li a:hover,
html[data-theme="dark"] .wsus__deshboard_menu li a.dash_active {
    background-color: var(--tl-bg-3) !important;
    color: #fff !important;
}
