/* Theme variables based on the RentStat Logo (Professional Blue & Slate Gray) */
:root {
    --brand-primary: #2E5FA1;
    /* Dominant Blue from logo */
    --brand-primary-light: #4A88C1;
    --brand-primary-dark: #1D3E66;
    --brand-gray: #64748b;
    /* Neutral Slate for text on white */
    --brand-gray-dark: #475569;
    --sidebar-bg: #ffffff;
    --sidebar-border: #f1f5f9;
    --brand-accent: #3b82f6;
}

/* Fallback for buttons to ensure they are ALWAYS visible without overriding utility classes */
button,
[type='button'],
[type='reset'],
[type='submit'] {
    cursor: pointer;
    font-family: inherit;
}

/* Default fallback ONLY when no explicit background or text color class is defined */
button:not([class*='bg-']):not([class*='text-']),
[type='button']:not([class*='bg-']):not([class*='text-']),
[type='reset']:not([class*='bg-']):not([class*='text-']),
[type='submit']:not([class*='bg-']):not([class*='text-']) {
    background-color: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
}

/* Reglas de Alto Contraste Garantizado (Accesibilidad WCAG AA/AAA) */
/* Botones con fondo blanco, claro o neutro siempre tienen texto oscuro de alto contraste */
button[class*='bg-white'],
button[class*='bg-slate-50'],
button[class*='bg-slate-100'],
button[class*='bg-slate-200'],
button[class*='bg-gray-50'],
button[class*='bg-gray-100'],
button[class*='bg-transparent'],
[type='button'][class*='bg-white'],
[type='button'][class*='bg-slate-50'],
[type='button'][class*='bg-slate-100'],
[type='button'][class*='bg-slate-200'],
[type='button'][class*='bg-gray-50'],
[type='button'][class*='bg-gray-100'],
[type='button'][class*='bg-transparent'],
.btn-filter,
.btn-secondary,
.btn-light {
    color: #1e293b; /* Slate 800: contraste superior a 12:1 sobre fondo claro */
}

/* Clases de texto explícitas en botones para asegurar contraste y prioridad sobre fondos claros */
button[class*="text-slate-900"], [type='button'][class*="text-slate-900"] { color: #0f172a !important; }
button[class*="text-slate-800"], [type='button'][class*="text-slate-800"] { color: #1e293b !important; }
button[class*="text-slate-700"], [type='button'][class*="text-slate-700"] { color: #334155 !important; }
button[class*="text-slate-600"], [type='button'][class*="text-slate-600"] { color: #475569 !important; }
button[class*="text-slate-500"], [type='button'][class*="text-slate-500"] { color: #64748b !important; }
button[class*="text-blue-600"], [type='button'][class*="text-blue-600"] { color: #2563eb !important; }
button[class*="text-blue-700"], [type='button'][class*="text-blue-700"] { color: #1d4ed8 !important; }
button[class*="text-blue-800"], [type='button'][class*="text-blue-800"] { color: #1e40af !important; }
button[class*="text-red-600"], [type='button'][class*="text-red-600"] { color: #dc2626 !important; }
button[class*="text-emerald-600"], [type='button'][class*="text-emerald-600"] { color: #059669 !important; }
button[class*="text-amber-600"], [type='button'][class*="text-amber-600"] { color: #d97706 !important; }

/* Botones con fondo oscuro garantizan texto blanco */
.bg-slate-900,
.bg-slate-800,
button.bg-slate-900,
button.bg-slate-800,
button.bg-blue-600,
button.bg-blue-700,
button.bg-emerald-600,
button.bg-red-600,
[type='submit'].bg-blue-600,
[type='submit'].bg-slate-900 {
    background-color: #0f172a !important;
    color: #ffffff !important;
}

.bg-blue-600,
.bg-blue-500 {
    background-color: var(--brand-primary) !important;
    color: #ffffff !important;
}

.bg-blue-700:hover,
.bg-blue-600:hover,
.bg-slate-800:hover {
    background-color: var(--brand-primary-dark) !important;
    color: #ffffff !important;
}

/* Estilo estándar de alto contraste para botones de filtro y desplegables */
.btn-filter {
    background-color: #ffffff;
    border: 1px solid #cbd5e1; /* slate-300 */
    color: #1e293b !important; /* slate-800 */
    font-weight: 700;
    font-size: 0.75rem; /* text-xs */
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease-in-out;
}

.btn-filter:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a !important;
}

.btn-filter.active,
.btn-filter-active {
    background-color: #eff6ff !important; /* blue-50 */
    border-color: #93c5fd !important; /* blue-300 */
    color: #1e40af !important; /* blue-800 */
}

/* Ensure that links in the dashboard don't inherit weird colors */
/* Custom scrollbars for side navigation & content area */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

/* Nav links for WHITE SIDEBAR */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.85rem;
    color: var(--brand-gray);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin-bottom: 0.125rem;
}

.nav-link:hover {
    color: var(--brand-primary);
    background-color: #f8fafc;
}

.nav-link.active {
    color: var(--brand-primary);
    background-color: #eff6ff;
    /* light blue */
    font-weight: 600;
}

.nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    color: inherit;
    /* inherit color from parent */
}

/* Utilities */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom classes for brand consistency */
.bg-brand-primary {
    background-color: var(--brand-primary);
}

.text-brand-primary {
    color: var(--brand-primary);
}

.border-brand-primary {
    border-color: var(--brand-primary);
}