/*
 * Dark Futuristic Theme (Tailwind Dark Slate / Midnight UI)
 * Global settings and Bootstrap overrides
 */

:root,
html.dark,
body.dark-theme {
    --shell-bg: #0f172a;
    --bg-main: #0b0f17;
    --bg-surface: #0f172a;
    --bg-panel: rgba(17, 24, 39, 0.88);
    --bg-panel-solid: #111827;
    --bg-panel-hover: #1e293b;
    --text-main: #F8FAFC;
    --text-muted: #CBD5E1;
    --accent-blue: #3B82F6;
    --accent-blue-hover: #2563EB;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-solid: #1E293B;
    --accent-indigo: #4F46E5;
}

html.dark {
    background-color: #0b0f17 !important;
}

html.dark body,
body,
body.dark-theme {
    background-color: transparent !important;
    color: #F8FAFC !important;
    font-family: 'Inter', sans-serif !important;
}

/* Unified App Shell (Header + Sidebar + Footer without borders/seams) */
body.dark-theme #app-header,
body.dark-theme #sidebar-wrapper,
body.dark-theme #app-footer {
    background-color: #0f172a !important;
    border: none !important;
    box-shadow: none !important;
    color: #F8FAFC !important;
}

body.dark-theme #page-content-wrapper {
    background-color: transparent !important;
    color: #F8FAFC !important;
}

body.dark-theme h1, body.dark-theme h2, body.dark-theme h3,
body.dark-theme h4, body.dark-theme h5, body.dark-theme h6,
body.dark-theme .h1, body.dark-theme .h2, body.dark-theme .h3,
body.dark-theme .h4, body.dark-theme .h5, body.dark-theme .h6,
body.dark-theme label, body.dark-theme .form-label,
body.dark-theme .col-form-label, body.dark-theme .form-check-label {
    color: #F8FAFC !important;
}

body.dark-theme hr,
body.dark-theme .border,
body.dark-theme .border-top,
body.dark-theme .border-bottom,
body.dark-theme .border-start,
body.dark-theme .border-end {
    border-color: #1E293B !important;
}

.wrapper {
    position: relative;
    z-index: 10;
}

/* Scrollbar Customization Global */
html ::-webkit-scrollbar, body ::-webkit-scrollbar, *::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
}

html ::-webkit-scrollbar-track, body ::-webkit-scrollbar-track, *::-webkit-scrollbar-track {
    background: #0b0f17 !important;
    border-radius: 4px;
}

html ::-webkit-scrollbar-thumb, body ::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb {
    background: #1e293b !important;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

html ::-webkit-scrollbar-thumb:hover, body ::-webkit-scrollbar-thumb:hover, *::-webkit-scrollbar-thumb:hover {
    background: #334155 !important;
}

/* Glow & Glass Classes (Tailwind Parity) */
.glow-effect {
    box-shadow: 0 0 25px -5px rgba(59, 130, 246, 0.25) !important;
}
.glow-indigo {
    box-shadow: 0 0 25px -5px rgba(99, 102, 241, 0.25) !important;
}

body.dark-theme .glass-card,
.glass-card {
    background: rgba(17, 24, 39, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    border-radius: 1rem !important;
    color: #F8FAFC !important;
    box-shadow: 0 4px 20px -2px rgba(14, 165, 233, 0.15), 0 0 15px -3px rgba(56, 189, 248, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

a .glass-card:hover,
.glass-card:hover,
.glass-card.cursor-pointer:hover {
    border-color: rgba(56, 189, 248, 0.85) !important;
    box-shadow: 0 8px 30px -4px rgba(14, 165, 233, 0.3), 0 0 25px rgba(56, 189, 248, 0.35) !important;
    transform: translateY(-3px) !important;
}

/* Cards & Panels */
body.dark-theme .card,
body.dark-theme .modal-content,
.card, .modal-content {
    background-color: #111827 !important;
    backdrop-filter: blur(12px) !important;
    color: #F8FAFC !important;
    border: 1px solid #1E293B !important;
    border-radius: 1rem !important;
}

body.dark-theme .card-header,
body.dark-theme .modal-header,
.card-header, .modal-header {
    border-bottom: 1px solid #1E293B !important;
    background-color: rgba(15, 23, 42, 0.6) !important;
    color: #F8FAFC !important;
}

body.dark-theme .card-footer,
body.dark-theme .modal-footer,
.card-footer, .modal-footer {
    border-top: 1px solid #1E293B !important;
    background-color: rgba(15, 23, 42, 0.6) !important;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}

/* Settings Navigation & Content */
body.dark-theme #v-pills-tab,
#v-pills-tab {
    background: #111827 !important;
    border: 1px solid #1E293B !important;
    border-radius: 1rem !important;
    padding: 0.75rem !important;
}

body.dark-theme #settings-content,
#settings-content {
    background: #111827 !important;
    border: 1px solid #1E293B !important;
    border-radius: 1rem !important;
    color: #F8FAFC !important;
}

.nav-pills .nav-link {
    color: #CBD5E1 !important;
    border-radius: 0.75rem !important;
    transition: all 0.2s ease;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    background: rgba(15, 23, 42, 0.6) !important;
}

.nav-pills .nav-link:hover {
    background-color: #1e293b !important;
    color: #FFFFFF !important;
    border-color: rgba(6, 182, 212, 0.4) !important;
}

.nav-pills .nav-link.active {
    background-image: linear-gradient(135deg, #0891b2, #0284c7) !important;
    color: #ffffff !important;
    border-color: #22d3ee !important;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35) !important;
}

.nav-tabs {
    border-bottom-color: #1E293B !important;
}

.nav-tabs .nav-link {
    color: #CBD5E1 !important;
    border: 1px solid transparent !important;
    border-top-left-radius: 0.75rem !important;
    border-top-right-radius: 0.75rem !important;
}

.nav-tabs .nav-link:hover {
    color: #FFFFFF !important;
    border-color: #334155 !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.nav-tabs .nav-link.active {
    background-color: #111827 !important;
    color: #38BDF8 !important;
    border-color: #334155 #334155 #111827 !important;
    font-weight: 600;
}

/* Tables */
table, .table {
    color: #F8FAFC !important;
    background-color: transparent !important;
    border-collapse: separate;
    border-spacing: 0;
    --bs-table-bg: transparent;
    --bs-table-color: #F8FAFC;
    --bs-table-border-color: #1E293B;
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}
.table-hover tbody tr {
    transition: background-color 0.2s ease;
}
.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #F8FAFC !important;
}
.table-light, .table-light > th, .table-light > td {
    background-color: #0f172a !important;
    color: #E2E8F0 !important;
}
.table-warning, tr.table-warning > td, tr.table-warning > th {
    background-color: rgba(245, 158, 11, 0.14) !important;
    color: #fde68a !important;
}
.table th, .table td {
    border-color: rgba(255, 255, 255, 0.06) !important;
    background-color: transparent !important;
    color: #F8FAFC !important;
    padding: 0.85rem 1rem !important;
    vertical-align: middle;
}
.table thead th {
    border-bottom: 1px solid #1E293B !important;
    background-color: #0f172a !important;
    color: #E2E8F0 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding-top: 0.9rem !important;
    padding-bottom: 0.9rem !important;
}

/* Inputs & Form Controls */
body.dark-theme .form-control,
body.dark-theme .form-select,
.form-control, .form-select {
    background-color: #0f172a !important;
    color: #F8FAFC !important;
    border: 1px solid #1E293B !important;
    border-radius: 0.75rem !important;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus,
.form-control:focus, .form-select:focus {
    background-color: #1e293b !important;
    color: #F8FAFC !important;
    border-color: #3B82F6 !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

.form-control::placeholder {
    color: #94A3B8 !important;
}

.form-control:disabled, .form-control[readonly], .form-select:disabled {
    background-color: rgba(15, 23, 42, 0.6) !important;
    color: #CBD5E1 !important;
}

input[type="file"].form-control::file-selector-button {
    background-color: #1e293b !important;
    color: #F8FAFC !important;
    border-right: 1px solid #334155 !important;
}

.input-group-text {
    background-color: #1e293b !important;
    border: 1px solid #1E293B !important;
    color: #CBD5E1 !important;
}

.input-group > :first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 0.75rem !important;
    border-bottom-left-radius: 0.75rem !important;
}

.input-group > :not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

.input-group > :last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
}

.form-check-input {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

.form-check-input:checked {
    background-color: #3B82F6 !important;
    border-color: #3B82F6 !important;
}

/* Classic PV inline inputs & readonly boxes */
#pv-form .border-bottom {
    border-bottom: 1px solid #475569 !important;
    border-radius: 0 !important;
}

.readonly-data {
    background-color: #0f172a !important;
    border: 1px solid #1E293B !important;
    color: #F8FAFC !important;
    border-radius: 0.75rem !important;
}

/* Keep Signature Pad Canvas White for PDF accuracy */
.signature-pad {
    background-color: #ffffff !important;
    border: 1px dashed #475569 !important;
    border-radius: 0.5rem !important;
}

/* Wizard Step Indicators */
.step-indicator::before {
    background: #1E293B !important;
}
.step-circle {
    background: #111827 !important;
    color: #CBD5E1 !important;
    border: 2px solid #1E293B !important;
}
.step-item.active .step-circle {
    background: #3B82F6 !important;
    border-color: #3B82F6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4) !important;
}
.step-item.completed .step-circle {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

/* Dropdowns & Pagination */
.dropdown-menu {
    background-color: #111827 !important;
    border: 1px solid #1E293B !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}
.dropdown-item {
    color: #F8FAFC !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}
.dropdown-item:hover, .dropdown-item:focus {
    background-color: #1e293b !important;
    color: #3B82F6 !important;
}

.pagination .page-link {
    background-color: #111827 !important;
    border-color: #1E293B !important;
    color: #F8FAFC !important;
}
.pagination .page-link:hover {
    background-color: #1e293b !important;
    color: #3B82F6 !important;
}
.pagination .page-item.active .page-link {
    background-image: linear-gradient(to right, #3B82F6, #4F46E5) !important;
    border-color: #3B82F6 !important;
    color: #ffffff !important;
}
.pagination .page-item.disabled .page-link {
    background-color: rgba(17, 24, 39, 0.4) !important;
    color: #94A3B8 !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

/* Alerts */
.alert {
    border-radius: 0.75rem !important;
    backdrop-filter: blur(8px);
}
.alert-info {
    background-color: rgba(59, 130, 246, 0.14) !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
    color: #93c5fd !important;
}
.alert-success {
    background-color: rgba(16, 185, 129, 0.14) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: #6ee7b7 !important;
}
.alert-warning {
    background-color: rgba(245, 158, 11, 0.14) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #fde68a !important;
}
.alert-warning .text-dark, .alert-warning .alert-heading {
    color: #fde68a !important;
}
.alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: #fca5a5 !important;
}
.alert-secondary {
    background-color: rgba(148, 163, 184, 0.12) !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
    color: #F8FAFC !important;
}

/* Select2 Overrides */
.select2-container--bootstrap-5 .select2-selection {
    background-color: #0f172a !important;
    color: #F8FAFC !important;
    border: 1px solid #1E293B !important;
    border-radius: 0.75rem !important;
}
.select2-container--bootstrap-5 .select2-selection__rendered {
    color: #F8FAFC !important;
}
.select2-dropdown {
    background-color: #111827 !important;
    border-color: #1E293B !important;
}
.select2-results__option {
    color: #F8FAFC !important;
}
.select2-results__option--highlighted {
    background-color: #3B82F6 !important;
}
.select2-search__field {
    background-color: #0f172a !important;
    color: #F8FAFC !important;
    border: 1px solid #1E293B !important;
}

/* Utilities overrides */
body.dark-theme .bg-white,
.bg-white {
    background-color: #111827 !important;
    color: #F8FAFC !important;
}
body.dark-theme .bg-light,
.bg-light {
    background-color: #0f172a !important;
    color: #F8FAFC !important;
}
body.dark-theme .text-dark,
.text-dark {
    color: #F8FAFC !important;
}
body.dark-theme .text-muted,
.text-muted {
    color: #CBD5E1 !important;
}

/* List Groups (Excluding Sidebar Shell) */
.list-group-item:not(#sidebar-wrapper .list-group-item) {
    background-color: #111827 !important;
    color: #F8FAFC !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}
.list-group-item-action:not(#sidebar-wrapper .list-group-item):hover,
.list-group-item-action:not(#sidebar-wrapper .list-group-item):focus {
    background-color: #1e293b !important;
    color: #F8FAFC !important;
}
.list-group-item.active:not(#sidebar-wrapper .list-group-item) {
    background-color: rgba(59, 130, 246, 0.2) !important;
    border-color: #3B82F6 !important;
    color: #ffffff !important;
}

/* Sidebar Menu & Submenu Items in Dark Futuristic */
body.dark-theme #sidebar-wrapper .list-group-item {
    background-color: transparent !important;
    color: #CBD5E1 !important;
    border: none !important;
}
body.dark-theme #sidebar-wrapper .list-group-item:hover,
body.dark-theme #sidebar-wrapper .list-group-item:focus {
    background-color: rgba(30, 41, 59, 0.85) !important;
    color: #F8FAFC !important;
}
body.dark-theme #sidebar-wrapper .list-group-item.active {
    background-color: rgba(59, 130, 246, 0.18) !important;
    color: #60a5fa !important;
    font-weight: 600;
}
body.dark-theme #sidebar-wrapper .sidebar-submenu {
    border-left: 2px solid rgba(59, 130, 246, 0.35) !important;
}
body.dark-theme #sidebar-wrapper .sidebar-submenu .list-group-item {
    color: #cbd5e1 !important;
}
body.dark-theme #sidebar-wrapper .sidebar-submenu .list-group-item:hover {
    background-color: rgba(59, 130, 246, 0.14) !important;
    color: #ffffff !important;
}

/* Fix Tailwind .collapse vs Bootstrap .collapse */
.collapse {
    visibility: visible !important;
}
.collapse:not(.show) {
    display: none;
}
.collapsing {
    visibility: visible !important;
}

/* Badges */
.badge.bg-light {
    background-color: #1E293B !important;
    color: #F8FAFC !important;
}

/* ==========================================================================
   BUTTONS: FULL DARK FUTURISTIC HIGH-CONTRAST PALETTE
   ========================================================================== */
.btn {
    border-radius: 0.75rem !important;
    font-weight: 600 !important;
    color: #F8FAFC !important;
    transition: all 0.2s ease-in-out !important;
}

.btn:not(.d-none):not(.d-lg-none):not(.d-md-none):not(.d-sm-none) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* Enforce responsive display utilities against any button overrides */
.d-none, .btn.d-none { display: none !important; }
@media (min-width: 992px) {
    .d-lg-none, .btn.d-lg-none { display: none !important; }
    .d-lg-block, .btn.d-lg-block { display: block !important; }
    .d-lg-inline-flex, .btn.d-lg-inline-flex { display: inline-flex !important; }
}
@media (max-width: 991.98px) {
    .d-lg-block, .btn.d-lg-block { display: none !important; }
}
@media (min-width: 768px) {
    .d-md-none, .btn.d-md-none { display: none !important; }
}
@media (max-width: 767.98px) {
    .d-md-block, .btn.d-md-block { display: none !important; }
}

.btn:hover, .btn:focus {
    color: #ffffff !important;
}

/* Primary */
.btn-primary {
    background: linear-gradient(135deg, #3B82F6, #4F46E5) !important;
    border: 1px solid #3b82f6 !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
    color: #ffffff !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB, #4338CA) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5) !important;
    color: #ffffff !important;
}

/* Cyan */
.btn-outline-cyan {
    color: #22d3ee !important;
    border: 1.5px solid #06b6d4 !important;
    background: rgba(6, 182, 212, 0.12) !important;
}
.btn-outline-cyan:hover, .btn-outline-cyan:focus, .btn-outline-cyan:active {
    color: #ffffff !important;
    background: #0891b2 !important;
    border-color: #22d3ee !important;
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.45) !important;
}
.btn-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    color: #020617 !important;
    font-weight: 700 !important;
    border: 1px solid #22d3ee !important;
}
.btn-cyan:hover {
    background: #22d3ee !important;
    color: #020617 !important;
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.5) !important;
}

/* Emerald / Success */
.btn-outline-emerald, .btn-outline-success {
    color: #34d399 !important;
    border: 1.5px solid #10b981 !important;
    background: rgba(16, 185, 129, 0.12) !important;
}
.btn-outline-emerald:hover, .btn-outline-emerald:focus, .btn-outline-emerald:active,
.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active {
    color: #ffffff !important;
    background: #059669 !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.45) !important;
}
.btn-emerald, .btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid #34d399 !important;
}
.btn-emerald:hover, .btn-success:hover {
    background: #059669 !important;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.5) !important;
    color: #ffffff !important;
}

/* Purple */
.btn-outline-purple {
    color: #c084fc !important;
    border: 1.5px solid #a855f7 !important;
    background: rgba(168, 85, 247, 0.12) !important;
}
.btn-outline-purple:hover, .btn-outline-purple:focus, .btn-outline-purple:active {
    color: #ffffff !important;
    background: #9333ea !important;
    border-color: #c084fc !important;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.45) !important;
}
.btn-purple {
    background: linear-gradient(135deg, #a855f7, #9333ea) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid #c084fc !important;
}
.btn-purple:hover {
    background: #9333ea !important;
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.5) !important;
    color: #ffffff !important;
}

/* Amber / Warning */
.btn-outline-amber, .btn-outline-warning {
    color: #fbbf24 !important;
    border: 1.5px solid #f59e0b !important;
    background: rgba(245, 158, 11, 0.12) !important;
}
.btn-outline-amber:hover, .btn-outline-amber:focus, .btn-outline-warning:hover, .btn-outline-warning:focus {
    color: #020617 !important;
    background: #f59e0b !important;
    border-color: #fbbf24 !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.45) !important;
}
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #020617 !important;
    font-weight: 700 !important;
    border: 1px solid #fbbf24 !important;
}
.btn-warning:hover {
    background: #d97706 !important;
    color: #ffffff !important;
}

/* Danger / Red */
.btn-outline-danger {
    color: #f87171 !important;
    border: 1.5px solid #ef4444 !important;
    background: rgba(239, 68, 68, 0.12) !important;
}
.btn-outline-danger:hover, .btn-outline-danger:focus {
    color: #ffffff !important;
    background: #dc2626 !important;
    border-color: #f87171 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.45) !important;
}
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid #f87171 !important;
}

/* Secondary / Slate / Dark / Light */
.btn-outline-secondary, .btn-outline-slate {
    color: #e2e8f0 !important;
    border: 1.5px solid #64748b !important;
    background: rgba(100, 116, 139, 0.2) !important;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-slate:hover {
    color: #ffffff !important;
    background: #475569 !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 0 16px rgba(148, 163, 184, 0.3) !important;
}
.btn-secondary {
    background: #334155 !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
}
.btn-secondary:hover {
    background: #475569 !important;
    color: #ffffff !important;
    border-color: #64748b !important;
}
.btn-dark {
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}
.btn-dark:hover {
    background: #334155 !important;
    color: #ffffff !important;
}
.btn-light {
    background: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid #475569 !important;
}
.btn-light:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

/* Primary Outline & Info & Teal */
.btn-outline-primary {
    color: #60a5fa !important;
    border: 1.5px solid #3b82f6 !important;
    background: rgba(59, 130, 246, 0.12) !important;
}
.btn-outline-primary:hover {
    color: #ffffff !important;
    background: #2563eb !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.45) !important;
}
.btn-outline-info {
    color: #38bdf8 !important;
    border: 1.5px solid #0284c7 !important;
    background: rgba(2, 132, 199, 0.12) !important;
}
.btn-outline-info:hover {
    color: #ffffff !important;
    background: #0284c7 !important;
    border-color: #38bdf8 !important;
}
.btn-info {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid #38bdf8 !important;
}
.btn-outline-teal {
    color: #2dd4bf !important;
    border: 1.5px solid #14b8a6 !important;
    background: rgba(20, 184, 166, 0.12) !important;
}
.btn-outline-teal:hover {
    color: #ffffff !important;
    background: #0d9488 !important;
    border-color: #2dd4bf !important;
}

/* Size Helpers */
.btn-xs {
    font-size: 0.72rem !important;
    padding: 0.2rem 0.55rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
}
.btn-sm {
    font-size: 0.8125rem !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 0.65rem !important;
    font-weight: 600 !important;
}

/* Autocomplete live search lists (e.g. Beneficiaries) */
.list-group.autocomplete-results .list-group-item {
    background-color: #111827 !important;
    color: #F8FAFC !important;
    border-color: #1E293B !important;
}
.list-group.autocomplete-results .list-group-item:hover {
    background-color: #1e293b !important;
}

/* SweetAlert2 Dark Mode Overrides - Ultra Contrast & Visibility */
.swal2-popup {
    background-color: #0f172a !important;
    color: #F8FAFC !important;
    border: 1px solid rgba(6, 182, 212, 0.3) !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(6, 182, 212, 0.2) !important;
}
.swal2-title {
    color: #FFFFFF !important;
    font-weight: 800 !important;
}
.swal2-html-container, .swal2-content {
    color: #F1F5F9 !important;
}
.swal2-input, .swal2-select, .swal2-textarea {
    background-color: #020617 !important;
    color: #F8FAFC !important;
    border: 1.5px solid #334155 !important;
}
.swal2-select option {
    background-color: #0f172a !important;
    color: #F8FAFC !important;
}
.swal2-actions {
    gap: 10px !important;
    margin-top: 1.5rem !important;
}
.swal2-actions button,
.swal2-actions .btn,
.swal2-styled {
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    border-radius: 0.75rem !important;
    padding: 0.6rem 1.4rem !important;
    transition: all 0.2s ease !important;
}
.swal2-styled.swal2-confirm {
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%) !important;
    color: #FFFFFF !important;
    border: 1px solid #22d3ee !important;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4) !important;
}
.swal2-styled.swal2-confirm:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0369a1 100%) !important;
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.6) !important;
}
.swal2-styled.swal2-deny {
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%) !important;
    color: #FFFFFF !important;
    border: 1px solid #c084fc !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4) !important;
}
.swal2-styled.swal2-deny:hover {
    background: linear-gradient(135deg, #9333ea 0%, #6b21a8 100%) !important;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6) !important;
}
.swal2-styled.swal2-cancel {
    background: #1e293b !important;
    color: #F8FAFC !important;
    border: 1.5px solid #475569 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}
.swal2-styled.swal2-cancel:hover {
    background: #334155 !important;
    color: #FFFFFF !important;
    border-color: #64748b !important;
}
.swal2-close {
    color: #94a3b8 !important;
}
.swal2-close:hover {
    color: #FFFFFF !important;
}
.swal2-html-container p,
.swal2-html-container div,
.swal2-html-container span {
    color: #E2E8F0;
}

/* CKEditor 5 Dark Mode Overrides */
.ck.ck-editor__main > .ck-editor__editable {
    background-color: #0f172a !important;
    color: #F8FAFC !important;
    border-color: #1E293B !important;
}
.ck.ck-toolbar {
    background-color: #1e293b !important;
    border-color: #1E293B !important;
}
.ck.ck-toolbar .ck-button {
    color: #F8FAFC !important;
}
.ck.ck-toolbar .ck-button:hover,
.ck.ck-toolbar .ck-button.ck-on {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #ffffff !important;
}

/* Amplified Cyber Grid & Faster 4-Corner Light Games (Full Viewport top:0..bottom:0) */
body.dark-theme.bg-grid-pattern,
.bg-grid-pattern {
    background-size: 40px 40px, 40px 40px, 200px 200px, 200px 200px !important;
    background-image:
        linear-gradient(to right, rgba(96, 165, 250, 0.10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(96, 165, 250, 0.10) 1px, transparent 1px),
        linear-gradient(to right, rgba(99, 102, 241, 0.16) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(99, 102, 241, 0.16) 1px, transparent 1px) !important;
}

@keyframes orb-dance-1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.68; }
    33% { transform: translate3d(65px, 45px, 0) scale(1.22); opacity: 0.96; }
    66% { transform: translate3d(-25px, 70px, 0) scale(0.92); opacity: 0.56; }
}
@keyframes orb-dance-2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.62; }
    40% { transform: translate3d(-75px, 55px, 0) scale(1.25); opacity: 0.96; }
    75% { transform: translate3d(-30px, -45px, 0) scale(0.90); opacity: 0.56; }
}
@keyframes orb-dance-3 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.58; }
    50% { transform: translate3d(70px, -60px, 0) scale(1.24); opacity: 0.92; }
}
@keyframes orb-dance-4 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.60; }
    45% { transform: translate3d(-65px, -55px, 0) scale(1.20); opacity: 0.94; }
}

/* Full viewport fixed behind content at z-index:-1 so zero black band on scroll & zero modal stacking issues */
#ambient-glow-container {
    position: fixed;
    inset: 0;
    top: 0;
    left: 250px;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    transition: left 0.3s ease;
}

html.sidebar-mini-active #ambient-glow-container,
body.sidebar-mini-active #ambient-glow-container {
    left: 70px;
}

body:not(.logged-in) #ambient-glow-container {
    left: 0;
}

@media (max-width: 991.98px) {
    #ambient-glow-container,
    body.logged-in #ambient-glow-container {
        top: 0 !important;
        left: 0 !important;
    }
}

#ambient-glow-container .orb-1 {
    position: absolute;
    top: -6rem;
    left: -6rem;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background-color: rgba(59, 130, 246, 0.36);
    filter: blur(100px);
    animation: orb-dance-1 4.2s infinite ease-in-out;
}

#ambient-glow-container .orb-2 {
    position: absolute;
    top: -5rem;
    right: -6rem;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background-color: rgba(99, 102, 241, 0.36);
    filter: blur(100px);
    animation: orb-dance-2 4.6s infinite ease-in-out;
}

#ambient-glow-container .orb-3 {
    position: absolute;
    bottom: -6rem;
    left: -5rem;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background-color: rgba(6, 182, 212, 0.28);
    filter: blur(105px);
    animation: orb-dance-3 3.8s infinite ease-in-out;
}

#ambient-glow-container .orb-4 {
    position: absolute;
    bottom: -6rem;
    right: -5rem;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background-color: rgba(139, 92, 246, 0.32);
    filter: blur(105px);
    animation: orb-dance-4 4.4s infinite ease-in-out;
}

header.fixed-top, nav.fixed-top, .navbar.fixed-top { z-index: 1030 !important; }
@media (max-width: 992px) {
    .header .navbar-nav { flex-direction: row; gap: 0.5rem; }
    .header .navbar-nav .nav-item { margin: 0; }
    .header .d-none.d-md-block { display: none !important; }
}

/* ==========================================================================
   CHENAR PENTRU SCRIS DIRECT PE FUNDALUL SITE-ULUI (TITLURI & HEADER-URI)
   ========================================================================== */
body.dark-theme .page-heading,
body.dark-theme .site-direct-title,
body.dark-theme .container > h1:first-child,
body.dark-theme .container > h2:first-child,
body.dark-theme .container > h3:first-child,
body.dark-theme .container-fluid > h1:first-child,
body.dark-theme .container-fluid > h2:first-child,
body.dark-theme .container-fluid > h3:first-child,
body.dark-theme :not(footer) > .container > .d-flex:first-child:not(.glass-card),
body.dark-theme :not(footer) > .container-fluid > .d-flex:first-child:not(.glass-card) {
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(56, 189, 248, 0.38) !important;
    border-radius: 1rem !important;
    padding: 0.75rem 1.25rem !important;
    margin-bottom: 1.25rem !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.12) !important;
    color: #ffffff !important;
}

body.dark-theme footer .d-flex,
body.dark-theme footer .d-flex:first-child,
body.dark-theme #app-footer .footer-inner {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body.dark-theme .container > h1:first-child,
body.dark-theme .container > h2:first-child,
body.dark-theme .container > h3:first-child,
body.dark-theme .container-fluid > h1:first-child,
body.dark-theme .container-fluid > h2:first-child,
body.dark-theme .container-fluid > h3:first-child {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
}

body.dark-theme .border-blue-400\/35 {
    border-color: rgba(56, 189, 248, 0.35) !important;
}
body.dark-theme .border-blue-400\/40 {
    border-color: rgba(56, 189, 248, 0.40) !important;
}

/* ==========================================================================
   PWA & MOBILE OPTIMIZATIONS (RESPONSIVE FIXES)
   ========================================================================== */
@media (max-width: 767.98px) {
    /* Prevent buttons from breaking into vertical wrapped blocks */
    .btn:not(.d-none):not(.d-md-none):not(.d-sm-none) {
        white-space: nowrap !important;
        font-size: 0.8125rem !important;
        padding: 0.4rem 0.75rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.375rem !important;
    }
    
    .btn-sm {
        font-size: 0.75rem !important;
        padding: 0.3rem 0.6rem !important;
    }
    
    .btn i {
        font-size: 0.85rem !important;
    }

    /* Headings on mobile */
    h1, .fs-1 { font-size: 1.4rem !important; }
    h2, .fs-2 { font-size: 1.25rem !important; }
    h3, .fs-3 { font-size: 1.15rem !important; }
    h4, .fs-4 { font-size: 1.05rem !important; }
    h5, .fs-5 { font-size: 0.95rem !important; }

    /* Glass card padding on mobile */
    .glass-card {
        padding: 0.85rem 1rem !important;
        border-radius: 1rem !important;
    }

    /* Table adjustments */
    .table td, .table th {
        padding: 0.65rem 0.75rem !important;
        font-size: 0.8rem !important;
    }

    /* Modals on small screens */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    /* Notification and badge counts */
    .badge {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.45rem !important;
    }
}

/* ==========================================================================
   AUTO PV BENEFICIARY CARD HIGHLIGHT (PURPLE / MOV)
   ========================================================================== */
.glass-card.card-auto-pv,
a .glass-card.card-auto-pv,
a.glass-card.card-auto-pv,
.card-auto-pv {
    border: 1px solid rgba(168, 85, 247, 0.45) !important;
    border-color: rgba(168, 85, 247, 0.45) !important;
    position: relative;
}

/* Hover state: MUST strictly override a .glass-card:hover with MOV (PURPLE NEON GLOW)! */
a .glass-card.card-auto-pv:hover,
a:hover .glass-card.card-auto-pv,
.glass-card.card-auto-pv:hover,
a.glass-card.card-auto-pv:hover,
.card-auto-pv:hover {
    border-color: rgba(192, 132, 252, 1) !important;
    box-shadow: 0 8px 35px -2px rgba(147, 51, 234, 0.65), 0 0 35px rgba(168, 85, 247, 0.85), 0 0 18px rgba(216, 180, 254, 0.95) !important;
    transform: translateY(-4px) !important;
}

.badge-auto-pv {
    background: rgba(168, 85, 247, 0.25) !important;
    color: #e9d5ff !important;
    border: 1px solid rgba(192, 132, 252, 0.6) !important;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.45) !important;
}

/* ==========================================================================
   GLOBAL HIGH-CONTRAST TYPOGRAPHY & VISIBILITY BOOST
   ========================================================================== */
body.dark-theme,
body {
    color: #F8FAFC !important;
}

/* Universal text utility overrides for high readability */
.text-muted,
body.dark-theme .text-muted,
.text-secondary,
body.dark-theme .text-secondary,
.text-slate-400,
.text-gray-400,
.text-zinc-400 {
    color: #E2E8F0 !important;
}

.text-slate-500,
.text-gray-500,
.text-zinc-500 {
    color: #CBD5E1 !important;
}

.text-slate-600,
.text-gray-600,
.text-zinc-600 {
    color: #94A3B8 !important;
}

.text-slate-300,
.text-gray-300,
.text-zinc-300 {
    color: #F1F5F9 !important;
}

.text-slate-200,
.text-gray-200,
.text-zinc-200 {
    color: #FFFFFF !important;
}

small, .small {
    color: #CBD5E1 !important;
}

/* Form labels and helper text */
label, .form-label {
    color: #F8FAFC !important;
    font-weight: 600 !important;
}
.form-text {
    color: #CBD5E1 !important;
}

/* Code & Pre readability */
code {
    color: #38bdf8 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    border-radius: 0.375rem !important;
    padding: 0.15rem 0.4rem !important;
}
pre {
    color: #E2E8F0 !important;
}

/* Card titles and headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: #FFFFFF !important;
}


