/* BeeFleet Modern Design System & AdminLTE v4 Enhancements */
:root {
    --bee-warning: #ffc107;
    --bee-warning-hover: #ffca2c;
    --bee-dark: #1e232a;
    --bee-sidebar-bg: #15191d;
    --bee-sidebar-text: #c2c7d0;
    --bee-card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Glassmorphism & Card Hover Effects */
.card-hover {
    transition: transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.25s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

/* Offcanvas Sidebar for Mobile First Navigation */
.app-header .navbar-nav .nav-link {
    font-weight: 500;
}

.app-sidebar {
    width: 250px;
    transition: all 0.3s ease-in-out;
}

.tracking-tight {
    letter-spacing: -0.025em;
}

.form-floating > label {
    font-size: 0.875rem;
}

/* ==========================================================
   LIGHT MODE DESIGN TOKENS & TYPOGRAPHY ENHANCEMENTS
   ========================================================== */
:root,
[data-bs-theme="light"] {
    --bs-secondary-color: #64748b;
    --bs-tertiary-bg: #f8fafc;
}

[data-bs-theme="light"] .text-secondary,
:root:not([data-bs-theme="dark"]) .text-secondary {
    color: #64748b !important;
}

[data-bs-theme="light"] .text-muted,
:root:not([data-bs-theme="dark"]) .text-muted {
    color: #64748b !important;
}

/* Outline Buttons in Light Mode (High Contrast WCAG AA) */
[data-bs-theme="light"] .btn-outline-warning,
:root:not([data-bs-theme="dark"]) .btn-outline-warning {
    color: #b45309 !important;
    border-color: #d97706 !important;
}

[data-bs-theme="light"] .btn-outline-warning:hover,
:root:not([data-bs-theme="dark"]) .btn-outline-warning:hover {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .btn-outline-secondary,
:root:not([data-bs-theme="dark"]) .btn-outline-secondary {
    color: #475569 !important;
    border-color: #94a3b8 !important;
}

[data-bs-theme="light"] .btn-outline-secondary:hover,
:root:not([data-bs-theme="dark"]) .btn-outline-secondary:hover {
    background-color: #64748b !important;
    border-color: #64748b !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .btn-outline-info,
:root:not([data-bs-theme="dark"]) .btn-outline-info {
    color: #0284c7 !important;
    border-color: #0284c7 !important;
}

[data-bs-theme="light"] .btn-outline-info:hover,
:root:not([data-bs-theme="dark"]) .btn-outline-info:hover {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

/* Subtle Badges in Light Mode */
[data-bs-theme="light"] .bg-warning-subtle,
:root:not([data-bs-theme="dark"]) .bg-warning-subtle {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fde68a !important;
}

[data-bs-theme="light"] .bg-secondary-subtle,
:root:not([data-bs-theme="dark"]) .bg-secondary-subtle {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

[data-bs-theme="light"] .bg-success-subtle,
:root:not([data-bs-theme="dark"]) .bg-success-subtle {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    border-color: #a7f3d0 !important;
}

[data-bs-theme="light"] .bg-danger-subtle,
:root:not([data-bs-theme="dark"]) .bg-danger-subtle {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}

[data-bs-theme="light"] .bg-info-subtle,
:root:not([data-bs-theme="dark"]) .bg-info-subtle {
    background-color: #cffafe !important;
    color: #155e75 !important;
    border-color: #a5f3fc !important;
}

[data-bs-theme="light"] .bg-primary-subtle,
:root:not([data-bs-theme="dark"]) .bg-primary-subtle {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border-color: #bfdbfe !important;
}

/* ==========================================================
   DARK MODE DESIGN TOKENS & TYPOGRAPHY ENHANCEMENTS
   ========================================================== */
[data-bs-theme="dark"] {
    --bs-body-bg: #111418;
    --bs-body-color: #e2e8f0;
    --bs-secondary-color: #94a3b8;
    --bs-secondary-bg: #1e242d;
    --bs-tertiary-bg: #181d24;
    --bs-border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .card {
    background-color: #181d24;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .bg-body {
    background-color: #181d24 !important;
}

[data-bs-theme="dark"] .bg-body-secondary {
    background-color: #1e242d !important;
}

[data-bs-theme="dark"] .bg-body-tertiary {
    background-color: #14181f !important;
}

[data-bs-theme="dark"] .bg-body-subtle {
    background-color: #1c2129 !important;
}

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

/* Crisp Text Colors in Dark Mode (>6.5:1 Contrast) */
[data-bs-theme="dark"] .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] small.text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .text-secondary-emphasis {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .text-primary-emphasis {
    color: #93c5fd !important;
}

/* Universal Safety Guard: Prevent hardcoded black text on dark background,
   EXCEPT when directly on solid yellow elements where dark text is mandatory */
[data-bs-theme="dark"] .text-dark:not(.bg-warning):not(.btn-warning):not(.badge-warning):not(.alert-warning) {
    color: #f1f5f9 !important;
}

/* Outline Buttons in Dark Mode (Vibrant & Crisp) */
[data-bs-theme="dark"] .btn-outline-warning {
    color: #fcd34d !important;
    border-color: #f59e0b !important;
}

[data-bs-theme="dark"] .btn-outline-warning:hover,
[data-bs-theme="dark"] .btn-outline-warning:active {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1 !important;
    border-color: rgba(203, 213, 225, 0.35) !important;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: rgba(203, 213, 225, 0.15) !important;
    color: #ffffff !important;
    border-color: rgba(203, 213, 225, 0.6) !important;
}

[data-bs-theme="dark"] .btn-outline-info {
    color: #38bdf8 !important;
    border-color: #0284c7 !important;
}

[data-bs-theme="dark"] .btn-outline-info:hover {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #60a5fa !important;
    border-color: #3b82f6 !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-success {
    color: #4ade80 !important;
    border-color: #22c55e !important;
}

[data-bs-theme="dark"] .btn-outline-success:hover {
    background-color: #22c55e !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-danger {
    color: #f87171 !important;
    border-color: #ef4444 !important;
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

/* Subtle Badges in Dark Mode (Luminescent Glow & Crisp Text) */
[data-bs-theme="dark"] .bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.18) !important;
    color: #fde047 !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

[data-bs-theme="dark"] .text-warning-emphasis {
    color: #fde047 !important;
}

[data-bs-theme="dark"] .bg-secondary-subtle {
    background-color: rgba(148, 163, 184, 0.16) !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}

[data-bs-theme="dark"] .bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.18) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

[data-bs-theme="dark"] .bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.18) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

[data-bs-theme="dark"] .bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.18) !important;
    color: #67e8f9 !important;
    border-color: rgba(6, 182, 212, 0.4) !important;
}

[data-bs-theme="dark"] .bg-primary-subtle {
    background-color: rgba(59, 130, 246, 0.18) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

[data-bs-theme="dark"] .bg-dark-subtle {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Tables in Dark Mode */
[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #202630 !important;
    --bs-table-color: #e2e8f0 !important;
    --bs-table-border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .table {
    --bs-table-border-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .table thead th {
    font-weight: 600;
    color: #cbd5e1;
    border-bottom-width: 1px;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    --bs-table-hover-bg: rgba(255, 255, 255, 0.035) !important;
}

/* Dropdowns & Modals in Dark Mode */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1c2129;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.5) !important;
}

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

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #181d24;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #14181f;
    border-color: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #14181f;
    border-color: #ffc107;
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}

/* Custom Toastr tweaks */
#toast-container > div {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}