/*
 * AURA — tema oscuro
 * Solo para usuarias autenticadas (html[data-app="auth"]). Marron cacao calido, sin negro,
 * con el rosa y el dorado de la marca como acentos. Bootstrap aporta data-bs-theme="dark".
 */

html[data-app="auth"][data-theme="dark"] {
    color-scheme: dark;

    --d-bg: #211812;
    --d-surface: #2c211b;
    --d-surface-2: #362922;
    --d-line: #4e3b30;
    --d-text: #f4e8dd;
    --d-muted: #d0baa9;
    --d-rose: #e0a98c;

    --aura-plum: #f4e8dd;
    --aura-orchid: #e0a98c;
    --aura-orchid-deep: #e0a98c;
    --aura-mist: #3d2e26;
    --aura-mist-soft: #33261f;
    --aura-mist-wash: #261c16;
    --aura-line: #4e3b30;
    --aura-muted: #d0baa9;
    --aura-gold-deep: #e3c27a;
    --aura-champagne: #f3e5c4;
    --aura-ink: #f4e8dd;
    --salon-gold-deep: #e3c27a;
    --salon-cocoa: #f4e8dd;
    --salon-ink: #f4e8dd;
    --salon-mocha: #d0baa9;
    --salon-border: #4e3b30;
    --bs-body-bg: #211812;
    --bs-body-color: #f4e8dd;
    --bs-border-color: #4e3b30;
    --bs-emphasis-color: #f4e8dd;
    --bs-emphasis-color-rgb: 244, 232, 221;
    --bs-secondary-color: rgba(244, 232, 221, 0.78);
    --bs-link-color: #e0a98c;
    --bs-link-hover-color: #f3c9b0;

    --sidebar-bg: linear-gradient(180deg, #2a1d17 0%, #1a110d 100%);
    --sidebar-line: rgba(255, 255, 255, 0.1);
    --topbar-bg: rgba(33, 24, 18, 0.92);
    --topbar-line: #4e3b30;
    --search-bg: #2c211b;
    --search-border: #5a443a;
    --search-text: #f4e8dd;
    --search-muted: #d0baa9;
    --pop-bg: #2c211b;
    --pop-line: #4e3b30;
    --pop-hover: #3d2e26;
    --pop-shadow: 0 1.2rem 2.4rem rgba(0, 0, 0, 0.5);
}

/* ---------- Base ---------- */
html[data-app="auth"][data-theme="dark"] body {
    background: var(--d-bg);
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .page-header {
    border-bottom-color: var(--d-line);
}

html[data-app="auth"][data-theme="dark"] .text-muted,
html[data-app="auth"][data-theme="dark"] small.text-muted,
html[data-app="auth"][data-theme="dark"] .small.text-muted,
html[data-app="auth"][data-theme="dark"] .page-subtitle,
html[data-app="auth"][data-theme="dark"] .worker-subtitle,
html[data-app="auth"][data-theme="dark"] .form-text {
    color: var(--d-muted) !important;
}

html[data-app="auth"][data-theme="dark"] ::selection {
    background: #7a4f3c;
    color: #fff;
}

/* ---------- Tarjetas y tablas ---------- */
html[data-app="auth"][data-theme="dark"] .card,
html[data-app="auth"][data-theme="dark"] .app-card,
html[data-app="auth"][data-theme="dark"] .dashboard-card {
    background: var(--d-surface);
    border-color: var(--d-line);
    color: var(--d-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 0.9rem 2rem -0.8rem rgba(0, 0, 0, 0.5);
}

html[data-app="auth"][data-theme="dark"] .dashboard-card {
    box-shadow: none;
}

html[data-app="auth"][data-theme="dark"] .dashboard-card.is-attention {
    background: #4a3517;
    border-color: #e08a1a;
}

html[data-app="auth"][data-theme="dark"] .dashboard-card.is-attention .display-6 {
    color: #ffb85c;
}

html[data-app="auth"][data-theme="dark"] .app-card .card-header,
html[data-app="auth"][data-theme="dark"] .card-footer {
    background: var(--d-surface-2);
    border-bottom-color: var(--d-line);
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .app-card .card-header small {
    color: var(--d-muted);
}

html[data-app="auth"][data-theme="dark"] .table {
    --bs-table-color: var(--d-text);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #34271f;
    --bs-table-hover-color: var(--d-text);
    --bs-table-border-color: var(--d-line);
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .table thead th,
html[data-app="auth"][data-theme="dark"] .table tfoot td {
    background: var(--d-surface-2);
    color: var(--d-muted);
    border-bottom-color: #c7a35a;
}

html[data-app="auth"][data-theme="dark"] .table tfoot td {
    border-top: 2px solid #c7a35a;
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .table > :not(caption) > * > * {
    border-bottom-color: #3f3028;
    background-color: transparent;
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .table td > a:not(.btn):not(.dropdown-item) {
    color: var(--d-rose);
}

/* ---------- Botones ---------- */
html[data-app="auth"][data-theme="dark"] .btn-soft,
html[data-app="auth"][data-theme="dark"] .btn-soft:focus {
    background: var(--d-surface-2);
    border-color: #5d463a;
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .btn-soft:hover,
html[data-app="auth"][data-theme="dark"] .btn-soft:active {
    background: #44342b;
    border-color: var(--d-rose);
    color: #fff;
}

html[data-app="auth"][data-theme="dark"] .btn-outline-info {
    --bs-btn-color: #e3c27a;
    --bs-btn-border-color: #b8964f;
    --bs-btn-hover-bg: #e3c27a;
    --bs-btn-hover-border-color: #e3c27a;
    --bs-btn-hover-color: #2a1a12;
}

html[data-app="auth"][data-theme="dark"] .btn-primary:disabled,
html[data-app="auth"][data-theme="dark"] .btn-primary.disabled {
    background: var(--d-surface-2);
    border-color: var(--d-line);
    color: #9a8576;
}

html[data-app="auth"][data-theme="dark"] .btn-outline-danger {
    color: #f0a39d;
    border-color: #c8605a;
}

/* ---------- Formularios ---------- */
html[data-app="auth"][data-theme="dark"] .form-control,
html[data-app="auth"][data-theme="dark"] .form-select,
html[data-app="auth"][data-theme="dark"] .input-group-text {
    background-color: #241a15;
    border-color: #5a443a;
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .form-control:focus,
html[data-app="auth"][data-theme="dark"] .form-select:focus {
    background-color: #241a15;
    border-color: var(--d-rose);
    box-shadow: 0 0 0 0.22rem rgba(224, 169, 140, 0.25);
    color: #fff;
}

html[data-app="auth"][data-theme="dark"] .form-control::placeholder {
    color: #a99282;
}

html[data-app="auth"][data-theme="dark"] .form-control:disabled,
html[data-app="auth"][data-theme="dark"] .form-select:disabled {
    background-color: #2c211b;
    color: #a99282;
}

html[data-app="auth"][data-theme="dark"] .form-label,
html[data-app="auth"][data-theme="dark"] .form-check-label {
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .form-check .form-check-input {
    background-color: #241a15;
    border-color: #8c7364;
}

html[data-app="auth"][data-theme="dark"] .form-check .form-check-input:checked {
    background-color: #a86b51;
    border-color: #e0a98c;
}

/* ---------- Menus desplegables, paginacion, avisos ---------- */
html[data-app="auth"][data-theme="dark"] .dropdown-menu,
html[data-app="auth"][data-theme="dark"] .table-actions-menu {
    background: var(--d-surface);
    border-color: var(--d-line);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.5);
}

html[data-app="auth"][data-theme="dark"] .dropdown-item {
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .dropdown-item:hover,
html[data-app="auth"][data-theme="dark"] .dropdown-item:focus {
    background: #44342b;
    color: #fff;
}

html[data-app="auth"][data-theme="dark"] .dropdown-item.text-danger {
    color: #f0a39d !important;
}

html[data-app="auth"][data-theme="dark"] .dropdown-divider {
    border-color: var(--d-line);
}

html[data-app="auth"][data-theme="dark"] .list-pagination .page-link {
    background: var(--d-surface-2);
    border-color: var(--d-line);
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .list-pagination .page-item.active .page-link {
    background: #9a5d44;
    border-color: #e0a98c;
    color: #fff;
}

html[data-app="auth"][data-theme="dark"] .list-pagination .page-item.disabled .page-link {
    color: #8c7364;
}

html[data-app="auth"][data-theme="dark"] .list-pagination-summary {
    color: var(--d-muted);
}

html[data-app="auth"][data-theme="dark"] .alert-info {
    background: #33261f;
    border-color: #5a453a;
    color: #f4e8dd;
}

html[data-app="auth"][data-theme="dark"] .alert-success {
    background: #25382b;
    border-color: #3f6a4c;
    color: #d3eadb;
}

html[data-app="auth"][data-theme="dark"] .alert-danger {
    background: #4a2623;
    border-color: #8f3f3a;
    color: #f7d4d0;
}

html[data-app="auth"][data-theme="dark"] .alert-warning {
    background: #4a3517;
    border-color: #a8761c;
    color: #fbe3b5;
}

html[data-app="auth"][data-theme="dark"] .badge.bg-primary,
html[data-app="auth"][data-theme="dark"] .badge.text-bg-primary {
    background: #4a3a31 !important;
    color: #fbe9dc !important;
    border-color: #e0a98c;
}

html[data-app="auth"][data-theme="dark"] .badge.bg-info-subtle {
    background: #3a2f1c !important;
    color: #f3e5c4 !important;
    border-color: #6b5a33 !important;
}

html[data-app="auth"][data-theme="dark"] .badge.bg-light {
    background: #3d2e26 !important;
    color: #f4e8dd !important;
    border-color: #5a453a !important;
}

html[data-app="auth"][data-theme="dark"] .report-nav-link {
    background: var(--d-surface);
    border-color: var(--d-line);
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .report-nav-link.active {
    background: #44342b;
    border-color: #c7a35a;
}

/* ---------- Estructura: selector de tema y buscador ---------- */
html[data-app="auth"][data-theme="dark"] .app-site-footer-inner {
    border-top-color: var(--d-line);
    color: var(--d-muted);
}

html[data-app="auth"][data-theme="dark"] .topbar-btn:hover {
    border-color: var(--d-rose);
}

html[data-app="auth"][data-theme="dark"] .search-all {
    color: var(--d-rose);
}

html[data-app="auth"][data-theme="dark"] .search-option.is-selected {
    outline-color: var(--d-rose);
}

html[data-app="auth"][data-theme="dark"] .topbar-search-input:focus {
    border-color: var(--d-rose);
    box-shadow: 0 0 0 0.22rem rgba(224, 169, 140, 0.25);
}

html[data-app="auth"][data-theme="dark"] .theme-switch-btn[aria-pressed="true"] {
    background: #9a5d44;
    color: #fff;
}

/* ---------- TPV / flujo de trabajadoras ---------- */
html[data-app="auth"][data-theme="dark"] .worker-title,
html[data-app="auth"][data-theme="dark"] .worker-employee-name {
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .worker-chip {
    background: #4a3a31;
    border-color: #c7a35a;
    color: #f4e8dd;
}

html[data-app="auth"][data-theme="dark"] .worker-home-btn,
html[data-app="auth"][data-theme="dark"] .worker-employee-card {
    background: var(--d-surface-2);
    border-color: #5d463a;
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .worker-home-btn:hover,
html[data-app="auth"][data-theme="dark"] .worker-employee-card:hover {
    background: #44342b;
    color: #fff;
}

html[data-app="auth"][data-theme="dark"] .cash-display,
html[data-app="auth"][data-theme="dark"] .cash-summary,
html[data-app="auth"][data-theme="dark"] .cash-key {
    background: var(--d-surface-2);
    border-color: #5d463a;
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .cash-key-action {
    background: #4a3a31;
    border-color: #c7a35a;
}

html[data-app="auth"][data-theme="dark"] .cash-summary small,
html[data-app="auth"][data-theme="dark"] .cash-note {
    color: var(--d-muted);
}

html[data-app="auth"][data-theme="dark"] .cash-summary strong {
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .cash-change strong {
    color: #8fd1a2;
}

html[data-app="auth"][data-theme="dark"] .quick-client-status,
html[data-app="auth"][data-theme="dark"] .quick-last-service,
html[data-app="auth"][data-theme="dark"] .quick-cita-preview,
html[data-app="auth"][data-theme="dark"] .quick-client-suggestions {
    background: var(--d-surface-2);
    border-color: #5d463a;
    color: var(--d-text);
}

/* ---------- Calendario / agenda ---------- */
html[data-app="auth"][data-theme="dark"] .timeline-card,
html[data-app="auth"][data-theme="dark"] .timeline-scroll,
html[data-app="auth"][data-theme="dark"] .timeline-hour-slot,
html[data-app="auth"][data-theme="dark"] .timeline-employee-col,
html[data-app="auth"][data-theme="dark"] .week-day-card,
html[data-app="auth"][data-theme="dark"] .month-day-card {
    background: var(--d-surface);
    border-color: var(--d-line);
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .timeline-corner,
html[data-app="auth"][data-theme="dark"] .timeline-employee-head,
html[data-app="auth"][data-theme="dark"] .timeline-hours-col,
html[data-app="auth"][data-theme="dark"] .timeline-hour-label,
html[data-app="auth"][data-theme="dark"] .week-day-card header,
html[data-app="auth"][data-theme="dark"] .month-day-card header,
html[data-app="auth"][data-theme="dark"] .month-grid-head span {
    background: var(--d-surface-2);
    border-color: var(--d-line);
    color: var(--d-muted);
}

html[data-app="auth"][data-theme="dark"] .timeline-employee-head.is-current {
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .month-day-card.is-other-month {
    background: #251b16;
    opacity: 0.7;
}

html[data-app="auth"][data-theme="dark"] .calendar-slot-clickable:hover {
    background: #3a2c24;
}

/* ---------- Componentes con estilos propios en plantillas ---------- */
html[data-app="auth"][data-theme="dark"] .text-bg-dark,
html[data-app="auth"][data-theme="dark"] .badge.text-bg-dark,
html[data-app="auth"][data-theme="dark"] .bg-dark,
html[data-app="auth"][data-theme="dark"] .btn-dark {
    background-color: #5a4337 !important;
    border-color: #5a4337 !important;
    color: #fff !important;
}

html[data-app="auth"][data-theme="dark"] .text-success {
    color: #86d6a1 !important;
}

html[data-app="auth"][data-theme="dark"] .text-danger {
    color: #f0a39d !important;
}

html[data-app="auth"][data-theme="dark"] .cita-day-row td {
    background: var(--d-surface-2);
    color: #e3c27a;
}

html[data-app="auth"][data-theme="dark"] .cita-stat-link,
html[data-app="auth"][data-theme="dark"] .cita-filter-chip {
    background: var(--d-surface-2);
    border-color: #5d463a;
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .cita-stat-link:hover {
    color: #fff;
    border-color: var(--d-rose);
}

html[data-app="auth"][data-theme="dark"] .cita-stat-number {
    background: #9a5d44;
    color: #fff;
}

html[data-app="auth"][data-theme="dark"] .cita-filter-chip a {
    background: rgba(255, 255, 255, 0.12);
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .calendar-custom-select__trigger,
html[data-app="auth"][data-theme="dark"] .calendar-custom-select__menu,
html[data-app="auth"][data-theme="dark"] .calendar-custom-select__arrow {
    background: #241a15;
    border-color: #5a443a;
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .calendar-custom-select__label,
html[data-app="auth"][data-theme="dark"] .calendar-custom-select__option {
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .calendar-custom-select__arrow::before {
    border-color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .calendar-custom-select__option:hover,
html[data-app="auth"][data-theme="dark"] .calendar-custom-select__option:focus-visible,
html[data-app="auth"][data-theme="dark"] .calendar-custom-select__option.is-selected {
    background: #44342b;
    color: #fff;
}

html[data-app="auth"][data-theme="dark"] .calendar-custom-select.is-disabled .calendar-custom-select__trigger {
    background: #2c211b;
    color: #a99282;
}

html[data-app="auth"][data-theme="dark"] .calendar-more-link,
html[data-app="auth"][data-theme="dark"] .calendar-day-link:hover {
    color: var(--d-rose);
}

html[data-app="auth"][data-theme="dark"] .admin-cita-header .page-title,
html[data-app="auth"][data-theme="dark"] .quick-cita-hero__title {
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .admin-cita-header .page-subtitle,
html[data-app="auth"][data-theme="dark"] .quick-cita-hero__subtitle,
html[data-app="auth"][data-theme="dark"] .quick-cita-hero__employee small {
    color: var(--d-muted);
}

html[data-app="auth"][data-theme="dark"] .quick-cita-hero,
html[data-app="auth"][data-theme="dark"] .quick-sticky-bar,
html[data-app="auth"][data-theme="dark"] .quick-cita-hero__employee {
    background: var(--d-surface);
    border-color: var(--d-line);
    color: var(--d-text);
}

html[data-app="auth"][data-theme="dark"] .quick-section-divider {
    border-top-color: var(--d-line);
}
