/* 
 * ==========================================
 * Premium Dark Mode Stylesheet for Perfex CRM
 * ==========================================
 */

html.dark,
html.dark body,
html.dark #wrapper {
    background-color: #0f172a !important; /* Slate 900 */
    color: #cbd5e1 !important; /* Slate 300 */
}

/* Headings and primary text */
html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6,
html.dark .text-neutral-800,
html.dark .tw-text-neutral-800,
html.dark .bold {
    color: #f8fafc !important; /* Slate 50 */
}

/* Secondary & muted text colors */
html.dark p,
html.dark span,
html.dark label,
html.dark .text-neutral-700,
html.dark .tw-text-neutral-700 {
    color: #cbd5e1 !important; /* Slate 300 */
}

html.dark .text-muted,
html.dark .text-neutral-500,
html.dark .tw-text-neutral-500,
html.dark .text-neutral-600,
html.dark .tw-text-neutral-600,
html.dark .control-label {
    color: #94a3b8 !important; /* Slate 400 */
}

/* Base Link Styles */
html.dark a,
html.dark #wrapper a:not(.btn),
html.dark table a,
html.dark .table a,
html.dark tbody td a {
    color: #818cf8 !important; /* Light Indigo */
    text-decoration: none;
}
html.dark a:hover,
html.dark a:focus,
html.dark #wrapper a:not(.btn):hover,
html.dark table a:hover,
html.dark .table a:hover,
html.dark tbody td a:hover {
    color: #a5b4fc !important; /* Lighter Indigo on hover */
    text-decoration: underline;
}

/* Top Navbar / Header styling */
html.dark #header {
    background-color: #1e293b !important; /* Slate 800 */
    border-bottom: 1px solid #334155 !important; /* Slate 700 */
}
html.dark #header nav {
    background-color: #1e293b !important;
}
html.dark #header .navbar-nav > li > a {
    color: #cbd5e1 !important;
}
html.dark #header .navbar-nav > li > a:hover {
    color: #f8fafc !important;
    background-color: #334155 !important;
}
html.dark #search_input {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}
html.dark #search_input::placeholder {
    color: #64748b !important;
}

/* Sidebar styling */
html.dark .sidebar,
html.dark aside#menu {
    background-color: #090d16 !important; /* Very dark rich blue */
    border-right: 1px solid #1e293b !important;
}
html.dark aside#menu #side-menu li a {
    color: #94a3b8 !important;
}
html.dark aside#menu #side-menu li a:hover,
html.dark aside#menu #side-menu li.active a,
html.dark aside#menu #side-menu li.active {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}
html.dark aside#menu #side-menu li ul.nav-second-level {
    background-color: #0d1321 !important;
}
html.dark .sidebar-user-profile a {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Card, Panel, Widget, Stats styling */
html.dark .panel,
html.dark .panel-body,
html.dark .card,
html.dark .tw-bg-white,
html.dark .bg-white,
html.dark .widget,
html.dark .top_stats_wrapper {
    background-color: #1e293b !important; /* Slate 800 */
    border: 1px solid #334155 !important; /* Slate 700 */
    color: #cbd5e1 !important;
}
html.dark .panel-default,
html.dark .panel-heading {
    background-color: #182235 !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
html.dark .top_stats_wrapper {
    padding: 15px !important;
    border-radius: 8px !important;
}

/* Tailwind utility backgrounds override to dark cards */
html.dark .tw-bg-neutral-50,
html.dark .tw-bg-neutral-100,
html.dark .tw-bg-slate-50,
html.dark .tw-bg-slate-100,
html.dark .tw-bg-gray-50,
html.dark .tw-bg-gray-100,
html.dark .tw-bg-zinc-50,
html.dark .tw-bg-zinc-100 {
    background-color: #1e293b !important;
}

/* Form inputs & controls & input groups */
html.dark .form-control,
html.dark input[type="text"],
html.dark input[type="search"],
html.dark input[type="number"],
html.dark input[type="password"],
html.dark input[type="email"],
html.dark input[type="url"],
html.dark input[type="date"],
html.dark select,
html.dark textarea {
    background-color: #0f172a !important; /* Slate 900 */
    border: 1px solid #334155 !important; /* Slate 700 */
    color: #f8fafc !important;
}
html.dark .form-control:focus,
html.dark select:focus,
html.dark textarea:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25) !important;
}
html.dark .bootstrap-select button {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

/* Input group addons (search icon backgrounds, etc.) */
html.dark .input-group-addon,
html.dark .input-group-btn,
html.dark .input-group-text {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

/* Buttons styling (Dashboard Options, Export, custom actions) */
html.dark .btn-default,
html.dark .btn-light,
html.dark button.btn-default,
html.dark a.btn-default {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}
html.dark .btn-default:hover,
html.dark .btn-default:focus,
html.dark button.btn-default:hover,
html.dark a.btn-default:hover {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

/* DataTable specific buttons (Export / Refresh / PDF etc.) */
html.dark .dt-button,
html.dark .buttons-collection,
html.dark .buttons-html5,
html.dark .buttons-print,
html.dark .dt-buttons a {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    background-image: none !important;
}
html.dark .dt-button:hover,
html.dark .dt-buttons a:hover {
    background-color: #334155 !important;
    border-color: #475569 !important;
}

/* Tables styling */
html.dark .table,
html.dark table {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
html.dark th,
html.dark thead th {
    background-color: #182235 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}
html.dark td,
html.dark table tbody td {
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
html.dark .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #182235 !important;
}

/* Pagination controls (DataTables) */
html.dark .dataTables_paginate .paginate_button {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}
html.dark .dataTables_paginate .paginate_button:hover {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}
html.dark .dataTables_paginate .paginate_button.current,
html.dark .dataTables_paginate .paginate_button.current:hover {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #fff !important;
}
html.dark .dataTables_paginate .paginate_button.disabled,
html.dark .dataTables_paginate .paginate_button.disabled:hover {
    background-color: #1e293b !important;
    color: #64748b !important;
    opacity: 0.5;
}

/* Tabs & horizontal tabs containers styling */
html.dark .nav-tabs,
html.dark .horizontal-tabs,
html.dark .nav-tabs-horizontal {
    background-color: #182235 !important;
    border-bottom: 2px solid #334155 !important;
    border-radius: 6px !important;
}
html.dark .nav-tabs > li > a {
    color: #94a3b8 !important;
    background-color: transparent !important;
    border: none !important;
}
html.dark .nav-tabs > li.active > a,
html.dark .nav-tabs > li.active > a:hover,
html.dark .nav-tabs > li.active > a:focus {
    color: #f8fafc !important;
    background-color: #0f172a !important;
    border-bottom: 3px solid #6366f1 !important;
}

/* Dropdown menus styling */
html.dark .dropdown-menu {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}
html.dark .dropdown-menu > li > a {
    color: #cbd5e1 !important;
}
html.dark .dropdown-menu > li > a:hover,
html.dark .dropdown-menu > li.active > a {
    background-color: #334155 !important;
    color: #f8fafc !important;
}

/* Modals styling */
html.dark .modal-content {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}
html.dark .modal-header,
html.dark .modal-footer {
    border-color: #334155 !important;
    background-color: #182235 !important;
}

/* Alerts and statuses */
html.dark .alert {
    border-width: 1px !important;
    background-image: none !important;
}
html.dark .alert-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}
html.dark .alert-warning {
    background-color: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: #fcd34d !important;
}
html.dark .alert-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: #6ee7b7 !important;
}
html.dark .alert-info {
    background-color: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
    color: #93c5fd !important;
}

/* Custom badge elements & default labels */
html.dark .label-default,
html.dark .badge-default {
    background-color: #334155 !important;
    color: #cbd5e1 !important;
    border: 1px solid #475569 !important;
}

/* Horizontal rule override */
html.dark hr {
    border-top: 1px solid #334155 !important;
}

/* Custom CSS classes for Dark Toggle hover states */
html.dark .header-dark-mode-toggle a {
    color: #fbbf24 !important; /* Amber / Sun icon color */
}
.header-dark-mode-toggle a {
    color: #64748b; /* Slate 500 / Moon icon color default */
}
.header-dark-mode-toggle a:hover {
    color: #475569;
}
html.dark .header-dark-mode-toggle a:hover {
    color: #f59e0b !important;
}

/* Dashboard options panel styling */
html.dark .screen-options-area {
    background-color: #1e293b !important; /* Slate 800 */
    border-bottom: 1px solid #334155 !important; /* Slate 700 */
    color: #cbd5e1 !important;
}
html.dark .screen-options-area label,
html.dark .screen-options-area span,
html.dark .screen-options-area a {
    color: #cbd5e1 !important;
}
html.dark .screen-options-area h4 {
    color: #f8fafc !important;
}

/* FullCalendar styling overrides */
html.dark .fc-other-month,
html.dark .fc-day-other,
html.dark td.fc-day-other,
html.dark .fc-disabled-day,
html.dark .fc-nonbusiness,
html.dark .fc-cell-shaded,
html.dark .fc-bg {
    background-color: #0f172a !important; /* Slate 900 */
}
html.dark .fc-unthemed th,
html.dark .fc-unthemed td,
html.dark .fc-unthemed thead,
html.dark .fc-unthemed tbody,
html.dark .fc-unthemed .fc-divider,
html.dark .fc-unthemed .fc-row,
html.dark .fc-unthemed .fc-content {
    border-color: #334155 !important;
}
html.dark .fc-button,
html.dark .fc-button-primary {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
    background-image: none !important;
}
html.dark .fc-button:hover,
html.dark .fc-button-primary:hover {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}
html.dark .fc-button-active,
html.dark .fc-button-primary:not(:disabled).fc-button-active {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #fff !important;
}

/* Page content layouts & spacers */
html.dark .content,
html.dark #content,
html.dark .wrapper,
html.dark .main-content {
    background-color: #0f172a !important; /* Slate 900 */
}

/* Invoice item editor table row */
html.dark tr.main,
html.dark tr.main td,
html.dark table.items tr.main td {
    background-color: #1e293b !important; /* Slate 800 */
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

/* Bottom action toolbar (Save, Draft, etc.) */
html.dark .btn-bottom-toolbar,
html.dark .btn-bottom-pusher,
html.dark .footer-btn-group,
html.dark .panel-footer {
    background-color: #1e293b !important; /* Slate 800 */
    border-top: 1px solid #334155 !important;
}

/* Bootstrap Status Labels overrides */
html.dark .label-default {
    background-color: #334155 !important;
    color: #cbd5e1 !important;
    border: 1px solid #475569 !important;
}
html.dark .label-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
html.dark .label-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
html.dark .label-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
html.dark .label-info {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
html.dark .label-primary {
    background-color: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
}

/* Kanban / Milestone Task card states */
html.dark li.task,
html.dark .milestone-column li.kan-ban-col-wrapper {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}
html.dark li.overdue-task,
html.dark li.overdue-task .panel-body,
html.dark .overdue-task {
    background-color: #1e293b !important; /* Keep clean slate background */
    border: 1px solid #334155 !important;
    border-left: 4px solid #ef4444 !important; /* Add red accent border on left */
}
html.dark li.overdue-task a,
html.dark li.overdue-task .task_milestone,
html.dark li.overdue-task h4 a,
html.dark li.overdue-task span,
html.dark li.overdue-task p {
    color: #cbd5e1 !important; /* Normal readable text color */
}
html.dark li.overdue-task a:hover,
html.dark li.overdue-task .task_milestone:hover {
    color: #f8fafc !important;
}

/* Project header status badge override (overrides database color in dark mode) */
html.dark .project_status {
    background-color: #334155 !important;
    border: 1px solid #475569 !important;
    color: #cbd5e1 !important;
}

/* Kanban board columns & panel_s containers styling */
html.dark .panel_s,
html.dark .kan-ban-col,
html.dark .kan-ban-col-wrapper,
html.dark .kan-ban-content-wrapper,
html.dark .kan-ban-content,
html.dark .status,
html.dark .milestone-column {
    background-color: #182235 !important; /* Slightly darker slate-blue for columns */
    border-color: #334155 !important;
}
html.dark .kan-ban-col-wrapper {
    border: 1px solid #334155 !important;
    border-radius: 8px !important;
}
html.dark .panel_s {
    border: none !important;
    box-shadow: none !important;
}

/* List group elements & well containers styling */
html.dark .list-group-item {
    background-color: #1e293b !important; /* Slate 800 */
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}
html.dark .list-group-item:hover,
html.dark .list-group-item:focus {
    background-color: #334155 !important;
    color: #f8fafc !important;
}
html.dark .well {
    background-color: #182235 !important; /* Slate 850 */
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}





