html {
    font-size: 11px;
}

@media (min-width: 768px) {
    html {
        font-size: 13px;
    }
}

:root {
    --dash-bg: #f8fafc;
    --dash-card: #ffffff;
    --dash-text: #0f172a;
    --dash-muted: #64748b;
    --dash-border: #e2e8f0;
    --dash-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --dash-accent: #2563eb;
    --dash-accent-strong: #1d4ed8;
}

html.dark {
    --dash-bg: #0f172a;
    --dash-card: #1e293b;
    --dash-text: #f1f5f9;
    --dash-muted: #94a3b8;
    --dash-border: #334155;
    --dash-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    --dash-accent: #3b82f6;
    --dash-accent-strong: #2563eb;
}

.bg-blue-600 {
    background-color: #2563eb;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.p-1\.5 {
    padding: 0.375rem;
}

.shadow-lg {
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
}

.shadow-blue-600\/20 {
    box-shadow: 0 12px 20px rgba(37, 99, 235, 0.2);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    font-family: 'Inter', sans-serif;
    background-color: var(--dash-bg);
    color: var(--dash-text);
    padding: 0;
    max-width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dashboard-body {
    padding: 0;
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

html.dark .dashboard-header {
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(51, 65, 85, 0.7);
}

.dashboard-navbar {
    min-height: 80px;
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--dash-text);
    letter-spacing: -0.02em;
}

.dashboard-brand span span {
    color: var(--dash-accent);
}

.dashboard-nav-link {
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-weight: 600;
    color: var(--dash-muted) !important;
    transition: all 0.2s ease;
}

.dashboard-nav-link:hover,
.dashboard-nav-link.active {
    color: var(--dash-text) !important;
    background: #f1f5f9;
}

html.dark .dashboard-nav-link:hover,
html.dark .dashboard-nav-link.active {
    background: #334155;
}

.dashboard-action {
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.dashboard-action.btn-primary {
    background: var(--dash-accent);
    border-color: var(--dash-accent);
}

.dashboard-action.btn-primary:hover {
    background: var(--dash-accent-strong);
    border-color: var(--dash-accent-strong);
}

.dashboard-page {
    max-width: 1920px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.dashboard-hero .page-title h2 {
    margin-bottom: 0.35rem;
}

.dashboard-hero .page-title p {
    margin: 0;
    color: var(--dash-muted);
    font-weight: 500;
}

.dashboard-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 999px;
    padding: 0.4rem 0.5rem 0.4rem 1rem;
    box-shadow: var(--dash-shadow);
    min-width: 280px;
}

.dashboard-search .form-control {
    border: none;
    box-shadow: none;
    font-weight: 600;
}

.dashboard-search .btn {
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.page-title h2 {
    font-weight: 800;
    font-size: 2.1rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.filters-card {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 18px;
    padding: 1.5rem 1.5rem 1.1rem;
    box-shadow: var(--dash-shadow);
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.filters-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dash-text);
}

.filters-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #eef2ff;
    color: var(--dash-accent);
}

.filters-clear {
    font-weight: 600;
    text-decoration: none;
}

#filtros label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dash-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#filtros .form-select,
#filtros .form-control {
    border-radius: 12px;
    border: 1px solid var(--dash-border);
    font-weight: 600;
    font-size: 0.9rem;
}

#filtros .form-control:focus,
#filtros .form-select:focus {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

#filtros .btn {
    border-radius: 999px;
    font-weight: 600;
}

.range-filter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.range-filter-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.range-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--dash-accent);
    font-weight: 600;
    font-size: 0.75rem;
}

.range-track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        #e5e7eb var(--range-min, 0%),
        var(--dash-accent) var(--range-min, 0%),
        var(--dash-accent) var(--range-max, 100%),
        #e5e7eb var(--range-max, 100%)
    );
}

.range-slider {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: auto;
}

.range-slider::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
    border: 2px solid var(--dash-accent);
}

.range-slider::-moz-range-track {
    height: 6px;
    background: transparent;
}

.range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid var(--dash-accent);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.range-min {
    z-index: 2;
}

.range-max {
    z-index: 3;
}

.btn-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.table-card {
    background: var(--dash-card);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: var(--dash-shadow);
    border: 1px solid var(--dash-border);
}

#mapContainer #map {
    border-radius: 18px;
    border: 1px solid var(--dash-border);
    box-shadow: var(--dash-shadow);
}

.property-list {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: auto;
}

html.dark .property-list {
    background: var(--dash-card);
}

    .property-list th {
        text-align: left;
        padding: 1rem;
        font-weight: 600;
        font-size: 12px;
        color: #64748b;
        border-bottom: 1px solid #eef2f7;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

html.dark .property-list th {
    color: var(--dash-muted);
    border-bottom: 1px solid var(--dash-border);
}

    .property-list td {
        padding: 1rem;
        vertical-align: middle;
        border-bottom: 1px solid #f1f5f9;
        font-size: 13px;
        color: #1f2937;
    }

html.dark .property-list td {
    border-bottom: 1px solid var(--dash-border);
    color: var(--dash-text);
}

.property-list th,
.property-list td {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
}

.property-list th:first-child,
.property-list td:first-child {
    width: 72px;
}

.property-list th:last-child,
.property-list td:last-child {
    width: 180px;
}

.actions-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.streetview-thumb-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.streetview-thumb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.streetview-thumb-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
}

.streetview-thumb-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #22c55e;
    border: 2px solid #ffffff;
}

.action-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 10px;
}

.property-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 0.75rem;
}

.property-header {
    display: flex;
    align-items: center;
}

.property-info {
    display: flex;
    flex-direction: column;
}

.property-title {
    font-weight: 600;
    color: #222;
}

html.dark .property-title {
    color: var(--dash-text);
}

.property-subtext {
    font-size: 0.85rem;
    color: #666;
}

html.dark .property-subtext {
    color: var(--dash-muted);
}

.rentabilidad {
    background-color: #ffd500;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    color: #000;
    display: inline-block;
}

.stars {
    color: #ffc107;
    font-size: 1rem;
}

    .stars .inactive {
        color: #ccc;
    }

.actions {
    font-size: 1.2rem;
    color: #999;
    display: flex;
    gap: 0.75rem;
}

img,
svg,
video,
canvas {
    height: auto;
}

.dataTables_wrapper {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dataTables_wrapper > .dataTables_filter {
    display: none;
}

.dataTables_wrapper > .dataTables_length {
    order: 4;
    margin-top: 0.25rem;
    color: var(--dash-muted);
}

.dataTables_wrapper > table {
    order: 1;
}

.dataTables_wrapper > .dataTables_info {
    order: 5;
    color: var(--dash-muted);
}

.dataTables_wrapper > .dataTables_paginate {
    order: 6;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    float: none;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 999px;
    border: 1px solid var(--dash-border);
    padding: 0.45rem 0.9rem;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 12px;
    border: 1px solid var(--dash-border);
    padding: 0.35rem 0.6rem;
}

@media (max-width: 991.98px) {
    body {
        padding: 0;
    }

    .dashboard-page {
        padding: 1.5rem 1rem 2rem;
    }

    #filtros .row {
        row-gap: 0.75rem;
    }

    #filtros .row .d-flex.align-items-end {
        flex-wrap: wrap;
        align-items: stretch;
    }

    #filtros .row .d-flex.align-items-end .btn,
    #filtros .row .d-flex.align-items-end form {
        width: 100%;
    }

    #filtros .row .d-flex.align-items-end form .btn {
        width: 100%;
    }

    #filtros .select2-container {
        width: 100% !important;
    }

    #filtros .input-group,
    #filtros .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .table,
    .property-list {
        table-layout: fixed;
    }

    .table th,
    .table td,
    .property-list th,
    .property-list td {
        padding: 0.5rem;
        font-size: 0.85rem;
        word-break: break-word;
    }
}

/* Dark mode styles for Bootstrap components */
html.dark .card {
    background-color: var(--dash-card);
    border-color: var(--dash-border);
    color: var(--dash-text);
}

html.dark .card-header {
    background-color: rgba(51, 65, 85, 0.5);
    border-color: var(--dash-border);
    color: var(--dash-text);
}

html.dark .card-body {
    color: var(--dash-text);
}

html.dark .form-control,
html.dark .form-select {
    background-color: var(--dash-card);
    border-color: var(--dash-border);
    color: var(--dash-text);
}

html.dark .form-control:focus,
html.dark .form-select:focus {
    background-color: var(--dash-card);
    border-color: var(--dash-accent);
    color: var(--dash-text);
}

html.dark .form-control::placeholder {
    color: var(--dash-muted);
}

html.dark .form-label {
    color: var(--dash-text);
}

html.dark .modal-content {
    background-color: var(--dash-card);
    border-color: var(--dash-border);
}

html.dark .modal-header,
html.dark .modal-footer {
    border-color: var(--dash-border);
}

html.dark .modal-title {
    color: var(--dash-text);
}

html.dark .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

html.dark .table {
    color: var(--dash-text);
}

html.dark .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(51, 65, 85, 0.3);
}

html.dark .table-hover > tbody > tr:hover {
    background-color: rgba(51, 65, 85, 0.5);
}

html.dark .alert {
    border-color: var(--dash-border);
}

html.dark .alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

html.dark .alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

html.dark .alert-warning {
    background-color: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fde68a;
}

html.dark .alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

html.dark .dropdown-menu {
    background-color: var(--dash-card);
    border-color: var(--dash-border);
}

html.dark .dropdown-item {
    color: var(--dash-text);
}

html.dark .dropdown-item:hover,
html.dark .dropdown-item:focus {
    background-color: rgba(51, 65, 85, 0.5);
    color: var(--dash-text);
}

html.dark .navbar-light .navbar-nav .nav-link {
    color: var(--dash-muted);
}

html.dark .navbar-light .navbar-brand {
    color: var(--dash-text);
}

html.dark .text-dark {
    color: var(--dash-text) !important;
}

html.dark .text-muted {
    color: var(--dash-muted) !important;
}

html.dark .bg-white {
    background-color: var(--dash-card) !important;
}

html.dark .border-top {
    border-color: var(--dash-border) !important;
}

html.dark .footer {
    background-color: var(--dash-card);
    border-color: var(--dash-border);
    color: var(--dash-muted);
}

/* Dark mode styles for DataTables */
html.dark .dataTables_wrapper {
    color: var(--dash-text);
}

html.dark .dataTables_wrapper .dataTables_length,
html.dark .dataTables_wrapper .dataTables_info {
    color: var(--dash-muted);
}

html.dark .dataTables_wrapper .dataTables_filter input {
    background-color: var(--dash-card);
    border-color: var(--dash-border);
    color: var(--dash-text);
}

html.dark .dataTables_wrapper .dataTables_filter input:focus {
    background-color: var(--dash-card);
    border-color: var(--dash-accent);
}

html.dark .dataTables_wrapper .dataTables_length select {
    background-color: var(--dash-card);
    border-color: var(--dash-border);
    color: var(--dash-text);
}

html.dark .dataTables_wrapper .dataTables_length select:focus {
    background-color: var(--dash-card);
    border-color: var(--dash-accent);
}

html.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--dash-text) !important;
}

html.dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--dash-card);
    border-color: var(--dash-border);
    color: var(--dash-text) !important;
}

html.dark .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html.dark .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--dash-accent);
    border-color: var(--dash-accent);
    color: white !important;
}

html.dark .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
html.dark .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: var(--dash-muted) !important;
}

html.dark table.dataTable {
    background-color: var(--dash-card);
    color: var(--dash-text);
    border-color: var(--dash-border);
}

html.dark table.dataTable thead th,
html.dark table.dataTable thead td {
    background-color: var(--dash-card);
    color: var(--dash-muted);
    border-bottom-color: var(--dash-border);
}

html.dark table.dataTable tbody td {
    background-color: var(--dash-card);
    color: var(--dash-text);
    border-bottom-color: var(--dash-border);
}

html.dark table.dataTable tbody tr {
    background-color: var(--dash-card);
}

html.dark table.dataTable tbody tr:hover {
    background-color: rgba(51, 65, 85, 0.5) !important;
}

html.dark table.dataTable.stripe tbody tr.odd,
html.dark table.dataTable.display tbody tr.odd {
    background-color: rgba(51, 65, 85, 0.3);
}

html.dark table.dataTable.stripe tbody tr.odd:hover,
html.dark table.dataTable.display tbody tr.odd:hover {
    background-color: rgba(51, 65, 85, 0.5) !important;
}

html.dark table.dataTable.hover tbody tr:hover,
html.dark table.dataTable.display tbody tr:hover {
    background-color: rgba(51, 65, 85, 0.5) !important;
}

html.dark table.dataTable.order-column tbody tr > .sorting_1,
html.dark table.dataTable.order-column tbody tr > .sorting_2,
html.dark table.dataTable.order-column tbody tr > .sorting_3 {
    background-color: rgba(51, 65, 85, 0.3);
}

html.dark table.dataTable.display tbody tr:hover > .sorting_1,
html.dark table.dataTable.display tbody tr:hover > .sorting_2,
html.dark table.dataTable.display tbody tr:hover > .sorting_3 {
    background-color: rgba(51, 65, 85, 0.5) !important;
}

html.dark .dataTables_wrapper .dataTables_processing {
    background-color: var(--dash-card);
    color: var(--dash-text);
    border-color: var(--dash-border);
}

html.dark .dataTables_wrapper .dataTables_scroll {
    background-color: var(--dash-card);
}

html.dark .dataTables_wrapper .dataTables_scrollHead table {
    background-color: var(--dash-card);
}

html.dark .dataTables_wrapper .dataTables_scrollBody table {
    background-color: var(--dash-card);
}
