/**
 * Coraula — Estilo 4: Coral
 * Sidebar claro, layout aireado, borde visible entre zonas.
 * En modo oscuro, todo se oscurece al unísono.
 * Color principal: #FF8559 (coral)
 */

/* ============================================
   FUENTE
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;
    --viewbar-height: 40px;
    /* Colores estructura */
    --sidebar-bg: #ffffff;
    --sidebar-hover: #fff0eb;
    --sidebar-active: rgba(255, 133, 89, 0.12);
    --sidebar-text: #3d3d4e;
    --sidebar-text-muted: #8e8ea0;
    --sidebar-border: #e8e8ee;
    --body-bg: #f5f5f8;
    --header-bg: #ffffff;
    --header-border: #e8e8ee;
    --viewbar-bg: #1a1a2e;
    --tenant-bg: #fff0eb;
    --tenant-color: #d9623a;
}

[data-bs-theme="dark"] {
    --body-bg: #111118;
    --header-bg: #1a1a24;
    --header-border: #2a2a36;
    --viewbar-bg: #0a0a12;
    --sidebar-bg: #16161f;
    --sidebar-hover: rgba(255, 133, 89, 0.08);
    --sidebar-active: rgba(255, 133, 89, 0.15);
    --sidebar-text: #c8c8d4;
    --sidebar-text-muted: #6b6b7e;
    --sidebar-border: #2a2a36;
    --tenant-bg: #2d1a12;
    --tenant-color: #ffaa8a;
}

/* ============================================
   BASE
   ============================================ */
body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.92rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--body-bg);
    letter-spacing: -0.005em;
}

:root:not([data-bs-theme="dark"]) body {
    color: #2d2d3a;
}

/* ============================================
   LAYOUT: VIEWBAR
   ============================================ */
#viewbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--viewbar-height);
    background: var(--viewbar-bg);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1100;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#viewbar .view-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    font-size: 0.72rem;
    padding: 0.35rem 1rem;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    height: var(--viewbar-height);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 0;
    margin-bottom: -1px;
}

#viewbar .view-btn:hover {
    color: rgba(255,255,255,0.85);
}

#viewbar .view-btn.active {
    color: #fff;
    border-bottom-color: #FF8559;
}

#viewbar .view-label {
    color: rgba(255,255,255,0.2);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-right: 0.75rem;
    font-weight: 600;
}

/* Dropdown del selector de estilos en viewbar */
#viewbar .dropdown-toggle::after {
    display: none;
}

#viewbar .style-dropdown .dropdown-menu {
    background: #1a1a24;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 0.35rem;
    min-width: 180px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

#viewbar .style-dropdown .dropdown-header {
    color: rgba(255,255,255,0.3);
    font-size: 0.58rem;
    letter-spacing: 1.5px;
    padding: 0.4rem 0.75rem 0.25rem;
}

#viewbar .style-dropdown .dropdown-item {
    color: rgba(255,255,255,0.65);
    font-size: 0.78rem;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    transition: background 0.15s;
}

#viewbar .style-dropdown .dropdown-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

#viewbar .style-dropdown .dropdown-item.active {
    background: rgba(255, 133, 89, 0.2);
    color: #ffaa8a;
    font-weight: 500;
}

/* ============================================
   LAYOUT: SIDEBAR — CLARO en light, oscuro en dark
   ============================================ */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    z-index: 1000;
    border-right: 1.5px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
}

#sidebar .sidebar-nav-links { flex: 1; overflow-y: auto; }

#sidebar .sidebar-bottom {
    display: flex; gap: 4px; padding: 8px 10px;
    border-top: 1px solid var(--sidebar-border);
}
#sidebar .sidebar-bottom-btn {
    color: var(--sidebar-text-muted); border: 1px solid var(--sidebar-border);
    font-size: 0.78rem; padding: 5px 10px; border-radius: 8px; background: transparent;
}
#sidebar .sidebar-bottom-btn:hover { color: var(--sidebar-text); background: var(--sidebar-hover); border-color: var(--sidebar-border); }
#sidebar .sidebar-bottom .dropdown-menu {
    background: var(--sidebar-bg); border: 1px solid var(--sidebar-border); border-radius: 10px;
    padding: 0.35rem; min-width: 200px; box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
#sidebar .sidebar-bottom .dropdown-header { color: var(--sidebar-text-muted); font-size: 0.6rem; letter-spacing: 1px; padding: 0.4rem 0.75rem 0.25rem; }
#sidebar .sidebar-bottom .dropdown-item { color: var(--sidebar-text); font-size: 0.82rem; padding: 0.45rem 0.75rem; border-radius: 6px; transition: background 0.1s; }
#sidebar .sidebar-bottom .dropdown-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
#sidebar .sidebar-bottom .dropdown-item.active { background: var(--sidebar-active); color: #d9623a; font-weight: 500; }
#sidebar .sidebar-bottom .dropdown-divider { border-color: var(--sidebar-border); }

#sidebar .brand {
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#sidebar .brand h5 {
    margin: 0;
    font-weight: 800;
    font-size: 1.25rem;
    color: #FF8559;
    letter-spacing: 1.5px;
}

#sidebar .brand small {
    display: block;
    font-size: 0.72rem;
    color: var(--sidebar-text-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
}

#sidebar .nav-section {
    padding: 1.1rem 1.35rem 0.35rem;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--sidebar-text-muted);
    opacity: 0.6;
    font-weight: 600;
    margin-top: 0.25rem;
}

#sidebar .nav-link {
    color: var(--sidebar-text-muted);
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: all 0.2s ease;
    margin: 2px 15px;
    border-radius: 10px;
    font-weight: 400;
}

#sidebar .nav-link:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
}

#sidebar .nav-link.active {
    color: #d9623a;
    background: var(--sidebar-active);
    font-weight: 600;
}

#sidebar .nav-link i {
    font-size: 0.9rem;
    width: 1.25rem;
    text-align: center;
    opacity: 0.65;
}

#sidebar .nav-link.active i {
    opacity: 1;
    color: #FF8559;
}

/* ============================================
   LAYOUT: HEADER
   ============================================ */
#header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 999;
}

#header .breadcrumb {
    margin: 0;
    font-size: 1rem;
}

/* ============================================
   LAYOUT: CONTENT
   ============================================ */
#content {
    margin-left: var(--sidebar-width);
    padding: calc(var(--header-height) + 2.25rem) 3rem 2.25rem;
}

/* Loading spinner */
.page-loading {
    display: flex;
    justify-content: center;
    padding: 4rem;
}

/* ============================================
   TIPOGRAFIA
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

:root:not([data-bs-theme="dark"]) h1,
:root:not([data-bs-theme="dark"]) h2,
:root:not([data-bs-theme="dark"]) h3,
:root:not([data-bs-theme="dark"]) h4,
:root:not([data-bs-theme="dark"]) h5,
:root:not([data-bs-theme="dark"]) h6 {
    color: #1a1a2e;
}

h4 {
    font-size: 1.3rem;
}

h6 {
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0;
}

.small, small {
    font-size: 0.82rem;
}

strong {
    font-weight: 600;
}

.text-muted {
    color: #8e8ea0 !important;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border-radius: 14px;
    border: 1px solid #e8e8ee;
    overflow: hidden;
    transition: all 0.25s ease;
}

.card.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.04) !important;
    border-color: #e8e8ee;
}

.card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.03) !important;
    transform: translateY(-1px);
}

.card-header {
    padding: 1.1rem 1.35rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.card-header.bg-white {
    background: #fff !important;
    border-bottom: 1px solid #ececf2;
}

.card-body {
    padding: 1.35rem;
}

.card-footer {
    padding: 0.85rem 1.35rem;
    border-top: 1px solid #ececf2;
}

.card-footer.bg-white {
    background: #fafafc !important;
}

/* ============================================
   TABLAS
   ============================================ */
.table {
    font-size: 0.87rem;
}

.table > :not(caption) > * > * {
    padding: 0.9rem 1.1rem;
    border-bottom-color: #ececf2;
}

.table-hover > tbody > tr:hover > * {
    background-color: #faf8f7;
}

.table thead th {
    font-weight: 600;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8e8ea0;
    border-bottom: 1px solid #e8e8ee !important;
    white-space: nowrap;
    padding-bottom: 0.75rem;
}

.table-light {
    --bs-table-bg: #faf8f7;
}

.table-sm > :not(caption) > * > * {
    padding: 0.55rem 0.75rem;
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
    font-size: 0.87rem;
    font-weight: 500;
    border-radius: 10px;
    padding: 0.5rem 1.15rem;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
}

.btn-primary {
    background: #FF8559;
    border-color: #FF8559;
}

.btn-primary:hover {
    background: #e8724a;
    border-color: #e8724a;
    box-shadow: 0 4px 14px rgba(255, 133, 89, 0.35);
}

.btn-outline-primary {
    color: #d9623a;
    border-color: #ffc9b5;
}

.btn-outline-primary:hover {
    background: #FF8559;
    border-color: #FF8559;
    color: #fff;
}

.btn-outline-secondary {
    color: #6b6b7e;
    border-color: #dcdce5;
}

.btn-outline-secondary:hover {
    background: #f5f5f8;
    border-color: #c4c4d0;
    color: #3d3d4e;
}

.btn-outline-danger {
    border-color: #fecdd3;
    color: #e11d48;
}

.btn-outline-danger:hover {
    background: #fff1f2;
    border-color: #fda4af;
    color: #e11d48;
}

/* ============================================
   FORMULARIOS
   ============================================ */
.form-control,
.form-select {
    border-radius: 10px;
    border-color: #dcdce5;
    font-size: 0.88rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: #2d2d3a;
}

.form-control {
    padding: 0.6rem 0.95rem;
}

.form-select {
    padding: 0.6rem 2.2rem 0.6rem 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #ffaa8a;
    box-shadow: 0 0 0 3px rgba(255, 133, 89, 0.1);
}

.form-control-sm {
    padding: 0.42rem 0.75rem;
    font-size: 0.82rem;
}

.form-select-sm {
    padding: 0.42rem 2rem 0.42rem 0.75rem;
    font-size: 0.82rem;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #4d4d5e;
    margin-bottom: 0.4rem;
    letter-spacing: 0;
}

.form-text {
    font-size: 0.77rem;
    color: #8e8ea0;
    margin-top: 0.4rem;
}

.form-check-input {
    border-color: #c4c4d0;
    border-radius: 5px;
}

.form-check-input:checked {
    background-color: #FF8559;
    border-color: #FF8559;
}

.form-check-label {
    color: #4d4d5e;
}

.form-control-color {
    border-radius: 10px 0 0 10px;
}

.input-group-text {
    border-color: #dcdce5;
    background: #f5f5f8;
    font-size: 0.88rem;
    color: #6b6b7e;
    border-radius: 10px;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

textarea.form-control {
    line-height: 1.7;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-weight: 500;
    font-size: 0.74rem;
    padding: 0.35em 0.75em;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.bg-success-subtle {
    background-color: #ecfdf5 !important;
}
.text-success {
    color: #059669 !important;
}

.bg-danger-subtle {
    background-color: #fff1f2 !important;
}
.text-danger {
    color: #e11d48 !important;
}

.bg-warning-subtle {
    background-color: #fffbeb !important;
}
.text-warning {
    color: #d97706 !important;
}

.bg-primary-subtle {
    background-color: #fff0eb !important;
}
.text-primary {
    color: #d9623a !important;
}

.bg-info-subtle {
    background-color: #eff6ff !important;
}
.text-info {
    color: #2563eb !important;
}

.bg-secondary-subtle {
    background-color: #f5f5f8 !important;
}

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown-menu {
    border-radius: 12px;
    border: 1px solid #e8e8ee;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);
    padding: 0.5rem;
    font-size: 0.86rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    color: #3d3d4e;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: #f5f5f8;
    color: #1a1a2e;
}

.dropdown-item.text-danger:hover {
    background: #fff1f2;
}

.dropdown-divider {
    border-color: #ececf2;
    margin: 0.35rem 0;
}

/* ============================================
   NAV TABS
   ============================================ */
.nav-tabs {
    border-bottom: 1px solid #e8e8ee;
    gap: 0.5rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: #8e8ea0;
    font-weight: 500;
    font-size: 0.87rem;
    padding: 0.7rem 1rem;
    border-radius: 0;
    transition: color 0.2s, border-color 0.2s;
}

.nav-tabs .nav-link:hover {
    color: #4d4d5e;
    border-bottom-color: #c4c4d0;
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: #d9623a;
    border-bottom-color: #FF8559;
    background: transparent;
    font-weight: 600;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 12px;
    border: none;
    font-size: 0.86rem;
}

.alert-info {
    background: #fff0eb;
    color: #a0452a;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-item {
    font-size: 1rem;
    color: #8e8ea0;
}

.breadcrumb-item a {
    color: #8e8ea0;
}

.breadcrumb-item a:hover {
    color: #6b6b7e;
}

.breadcrumb-item.active {
    color: #2d2d3a;
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #c4c4d0;
}

/* ============================================
   CODE
   ============================================ */
code {
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #fff0eb;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    color: #d9623a;
}

/* ============================================
   COMPONENTES DE PAGINA
   ============================================ */

/* KPI cards del dashboard */
.card-body h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.03em;
}

/* Tenant badge */
.tenant-badge {
    background: var(--tenant-bg);
    color: var(--tenant-color);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 500;
}

/* Upload drag zone */
.border-dashed {
    border-style: dashed !important;
    border-color: #c4c4d0 !important;
    background: #fafafc;
    transition: all 0.25s ease;
    border-radius: 14px;
}

.border-dashed:hover {
    border-color: #ffaa8a !important;
    background: #fff0eb;
}

/* bg-light refinado */
.bg-light {
    background-color: #f5f5f8 !important;
}

/* Rounded helper */
.rounded {
    border-radius: 10px !important;
}

/* Avatares de iniciales */
.card-body .rounded[style*="width:32px"],
.card-body .rounded[style*="width:64px"] {
    border-radius: 10px !important;
}

/* Separadores */
hr {
    border-color: #e8e8ee;
    opacity: 0.5;
}

/* Links */
a {
    color: #d9623a;
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: #a0452a;
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress {
    height: 5px;
    border-radius: 999px;
    background: #e8e8ee;
}

.progress-bar:not([class*="bg-"]) {
    background: linear-gradient(90deg, #FF8559, #ffaa8a);
}

/* ============================================
   SCROLLBAR
   ============================================ */
#sidebar::-webkit-scrollbar {
    width: 3px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
}

/* ============================================
   TRANSICIONES
   ============================================ */
.card,
.btn,
.form-control,
.form-select,
.nav-link,
.badge {
    transition: all 0.2s ease;
}

/* ============================================
   DARK MODE (Bootstrap 5.3 data-bs-theme)
   ============================================ */
[data-bs-theme="dark"] body {
    background: var(--body-bg);
    color: #c8c8d4;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: #e8e8f0;
}

[data-bs-theme="dark"] .text-muted {
    color: #6b6b7e !important;
}

/* Cards */
[data-bs-theme="dark"] .card {
    background: #1a1a24;
    border-color: #2a2a36;
}

[data-bs-theme="dark"] .card.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .card-header.bg-white,
[data-bs-theme="dark"] .card-header {
    background: #1a1a24 !important;
    border-bottom-color: #2a2a36;
}

[data-bs-theme="dark"] .card-footer.bg-white,
[data-bs-theme="dark"] .card-footer {
    background: #141420 !important;
    border-top-color: #2a2a36;
}

/* Tables */
[data-bs-theme="dark"] .table {
    color: #c8c8d4;
}

[data-bs-theme="dark"] .table > :not(caption) > * > * {
    border-bottom-color: #2a2a36;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: #1f1f2a;
}

[data-bs-theme="dark"] .table thead th {
    color: #6b6b7e;
    border-bottom-color: #353542 !important;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #1f1f2a;
    color: #c8c8d4;
}

/* Forms */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #222230;
    border-color: #353542;
    color: #e8e8f0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background: #222230;
    border-color: #FF8559;
    color: #e8e8f0;
    box-shadow: 0 0 0 3px rgba(255, 133, 89, 0.15);
}

[data-bs-theme="dark"] .form-label {
    color: #a8a8b8;
}

[data-bs-theme="dark"] .form-text {
    color: #6b6b7e;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: #222230;
    border-color: #353542;
}

[data-bs-theme="dark"] .input-group-text {
    background: #222230;
    border-color: #353542;
    color: #6b6b7e;
}

/* Buttons */
[data-bs-theme="dark"] .btn-outline-secondary {
    color: #a8a8b8;
    border-color: #353542;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background: #222230;
    border-color: #4a4a5a;
    color: #e8e8f0;
}

/* Badges */
[data-bs-theme="dark"] .bg-success-subtle {
    background-color: #064e3b !important;
}
[data-bs-theme="dark"] .bg-success-subtle.text-success,
[data-bs-theme="dark"] .bg-success-subtle .text-success {
    color: #34d399 !important;
}
[data-bs-theme="dark"] .text-success {
    color: #34d399 !important;
}

[data-bs-theme="dark"] .bg-danger-subtle {
    background-color: #4c0519 !important;
}
[data-bs-theme="dark"] .bg-danger-subtle.text-danger,
[data-bs-theme="dark"] .bg-danger-subtle .text-danger,
[data-bs-theme="dark"] .text-danger {
    color: #fb7185 !important;
}

[data-bs-theme="dark"] .bg-warning-subtle {
    background-color: #451a03 !important;
}
[data-bs-theme="dark"] .bg-warning-subtle.text-warning,
[data-bs-theme="dark"] .bg-warning-subtle .text-warning,
[data-bs-theme="dark"] .text-warning {
    color: #fbbf24 !important;
}

[data-bs-theme="dark"] .bg-primary-subtle {
    background-color: #2d1a12 !important;
}
[data-bs-theme="dark"] .bg-primary-subtle.text-primary,
[data-bs-theme="dark"] .bg-primary-subtle .text-primary,
[data-bs-theme="dark"] .text-primary {
    color: #ffaa8a !important;
}

[data-bs-theme="dark"] .bg-info-subtle {
    background-color: #172554 !important;
}
[data-bs-theme="dark"] .bg-info-subtle.text-info,
[data-bs-theme="dark"] .bg-info-subtle .text-info,
[data-bs-theme="dark"] .text-info {
    color: #93c5fd !important;
}

[data-bs-theme="dark"] .bg-secondary-subtle {
    background-color: #222230 !important;
}
[data-bs-theme="dark"] .bg-secondary-subtle.text-secondary,
[data-bs-theme="dark"] .bg-secondary-subtle .text-secondary,
[data-bs-theme="dark"] .text-secondary {
    color: #a8a8b8 !important;
}

/* Dropdowns */
[data-bs-theme="dark"] .dropdown-menu {
    background: #1a1a24;
    border-color: #2a2a36;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .dropdown-item {
    color: #a8a8b8;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background: #222230;
    color: #e8e8f0;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #2a2a36;
}

/* Alerts */
[data-bs-theme="dark"] .alert-info {
    background: #2d1a12;
    color: #ffaa8a;
}

/* Nav tabs */
[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: #2a2a36;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #6b6b7e;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    color: #a8a8b8;
    border-bottom-color: #4a4a5a;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    color: #ffaa8a;
    border-bottom-color: #FF8559;
}

/* Progress */
[data-bs-theme="dark"] .progress {
    background: #222230;
}

[data-bs-theme="dark"] .progress-bar:not([class*="bg-"]) {
    background: linear-gradient(90deg, #FF8559, #ffaa8a);
}

/* Breadcrumb */
[data-bs-theme="dark"] .breadcrumb-item {
    color: #6b6b7e;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
    color: #c8c8d4;
}

[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: #4a4a5a;
}

/* Code */
[data-bs-theme="dark"] code,
[data-bs-theme="dark"] .table code,
[data-bs-theme="dark"] td code {
    background: #2d1a12;
    color: #ffaa8a !important;
}

/* Separadores */
[data-bs-theme="dark"] hr {
    border-color: #2a2a36;
}

/* Links */
[data-bs-theme="dark"] a {
    color: #ffaa8a;
}

[data-bs-theme="dark"] a:hover {
    color: #ffc9b5;
}

/* KPI cards */
[data-bs-theme="dark"] .card-body h3 {
    color: #e8e8f0;
}

/* Upload zone */
[data-bs-theme="dark"] .border-dashed {
    border-color: #353542 !important;
    background: #1f1f2a;
}

[data-bs-theme="dark"] .border-dashed:hover {
    border-color: #FF8559 !important;
    background: #2d1a12;
}

/* bg-light */
[data-bs-theme="dark"] .bg-light {
    background-color: #1f1f2a !important;
}

/* bg-white */
[data-bs-theme="dark"] .bg-white {
    background-color: #1a1a24 !important;
}

/* Sidebar dark mode — se oscurece junto al contenido */
[data-bs-theme="dark"] #sidebar {
    background: var(--sidebar-bg);
    border-right-color: var(--sidebar-border);
}

[data-bs-theme="dark"] #sidebar .brand {
    border-bottom-color: var(--sidebar-border);
}

[data-bs-theme="dark"] #sidebar .sidebar-bottom {
    border-top-color: var(--sidebar-border);
}

[data-bs-theme="dark"] #sidebar .sidebar-bottom .dropdown-menu {
    background: #1a1a24;
    border-color: #2a2a36;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

[data-bs-theme="dark"] #sidebar .sidebar-bottom .dropdown-item { color: #a8a8b8; }
[data-bs-theme="dark"] #sidebar .sidebar-bottom .dropdown-item:hover { background: rgba(255,255,255,0.06); color: #e8e8f0; }
[data-bs-theme="dark"] #sidebar .sidebar-bottom .dropdown-item.active { background: rgba(255, 133, 89, 0.15); color: #ffaa8a; }
[data-bs-theme="dark"] #sidebar .sidebar-bottom .dropdown-header { color: #6b6b7e; }

[data-bs-theme="dark"] #sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
}

/* Header */
[data-bs-theme="dark"] #header {
    border-bottom-color: #2a2a36;
}

/* Viewbar */
[data-bs-theme="dark"] #viewbar {
    border-bottom-color: rgba(255, 255, 255, 0.03);
}

/* Tenant badge */
[data-bs-theme="dark"] .tenant-badge {
    background: var(--tenant-bg);
    color: var(--tenant-color);
}

/* Inline style overrides */
[data-bs-theme="dark"] [style*="background: #f8fafc"],
[data-bs-theme="dark"] [style*="background:#f8fafc"] {
    background: #1f1f2a !important;
}

[data-bs-theme="dark"] [style*="background: #f0f7ff"],
[data-bs-theme="dark"] [style*="background:#f0f7ff"] {
    background: #2d1a12 !important;
}

[data-bs-theme="dark"] [style*="background: #f0fdf4"],
[data-bs-theme="dark"] [style*="background:#f0fdf4"] {
    background: #064e3b !important;
}

[data-bs-theme="dark"] [style*="background: #fafbfc"],
[data-bs-theme="dark"] [style*="background:#fafbfc"] {
    background: #1f1f2a !important;
}

[data-bs-theme="dark"] [style*="background: #edf1f8"],
[data-bs-theme="dark"] [style*="background:#edf1f8"] {
    background: #2d1a12 !important;
}

/* text-dark */
[data-bs-theme="dark"] .text-dark {
    color: #c8c8d4 !important;
}

/* Icon color overrides */
[data-bs-theme="dark"] [style*="color:#14407F"],
[data-bs-theme="dark"] [style*="color: #14407F"] {
    color: #ffaa8a !important;
}

/* Pagination */
[data-bs-theme="dark"] .page-link {
    background: #1a1a24;
    border-color: #2a2a36;
    color: #a8a8b8;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background: #FF8559;
    border-color: #FF8559;
}
