/* Behsaa CRM Keen-like dark (16:00–08:00). Scope: html.behsaa-theme-dark only. */
html.behsaa-theme-dark {
  color-scheme: dark;
  --bs-navy: #0D1B2A;
  --bs-slate: #1B263B;
  --bs-steel: #415A77;
  --bs-mist: #778DA9;
  --bs-sand: #E0E1DD;
  --bs-text: #E0E1DD;
  --bs-muted: #778DA9;
  --bs-border: #415A77;
  --bs-surface: #1B263B;
  --bs-elevated: #243447;
  --bs-input: #0D1B2A;
  --bs-primary: #778DA9;
  --bs-primary-hover: #E0E1DD;
  --bs-danger: #e57373;
  --bs-success: #81c784;
  --bs-warning: #ffb74d;
  --bs-info: #64b5f6;
}

html.behsaa-theme-dark,
html.behsaa-theme-dark body,
html.behsaa-theme-dark #wrapper,
html.behsaa-theme-dark #content,
html.behsaa-theme-dark .content,
html.behsaa-theme-dark .page-bg,
html.behsaa-theme-dark .content-wrapper {
  background-color: var(--bs-navy) !important;
  color: var(--bs-text) !important;
}

html.behsaa-theme-dark a {
  color: #a8c0d8;
}
html.behsaa-theme-dark a:hover,
html.behsaa-theme-dark a:focus {
  color: var(--bs-sand);
}

/* Sidebar / header */
html.behsaa-theme-dark #side-menu,
html.behsaa-theme-dark .sidebar,
html.behsaa-theme-dark aside.sidebar,
html.behsaa-theme-dark .navbar-default,
html.behsaa-theme-dark .navbar-static-side,
html.behsaa-theme-dark #menu,
html.behsaa-theme-dark .nav-tabs-horizontal,
html.behsaa-theme-dark .header-wrapper,
html.behsaa-theme-dark header.navbar,
html.behsaa-theme-dark .top-navbar,
html.behsaa-theme-dark .navbar-custom {
  background-color: var(--bs-slate) !important;
  border-color: var(--bs-border) !important;
  color: var(--bs-text) !important;
}

html.behsaa-theme-dark #side-menu li a,
html.behsaa-theme-dark .sidebar a,
html.behsaa-theme-dark .nav > li > a,
html.behsaa-theme-dark .navbar-nav > li > a,
html.behsaa-theme-dark .navbar-default .nav > li > a {
  color: var(--bs-mist) !important;
}

html.behsaa-theme-dark #side-menu li.active > a,
html.behsaa-theme-dark #side-menu li a:hover,
html.behsaa-theme-dark .sidebar a:hover,
html.behsaa-theme-dark .nav > li.active > a,
html.behsaa-theme-dark .nav > li > a:hover {
  background-color: var(--bs-elevated) !important;
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark .navbar-brand,
html.behsaa-theme-dark .logo,
html.behsaa-theme-dark .company-logo span {
  color: var(--bs-sand) !important;
}

/* Cards / panels / widgets */
html.behsaa-theme-dark .panel,
html.behsaa-theme-dark .panel-body,
html.behsaa-theme-dark .panel-heading,
html.behsaa-theme-dark .panel-footer,
html.behsaa-theme-dark .card,
html.behsaa-theme-dark .widget,
html.behsaa-theme-dark .widget-body,
html.behsaa-theme-dark .widget-header,
html.behsaa-theme-dark .ibox,
html.behsaa-theme-dark .ibox-content,
html.behsaa-theme-dark .ibox-title,
html.behsaa-theme-dark .modal-content,
html.behsaa-theme-dark .popover,
html.behsaa-theme-dark .dropdown-menu,
html.behsaa-theme-dark .list-group-item,
html.behsaa-theme-dark .well,
html.behsaa-theme-dark .alert-info,
html.behsaa-theme-dark .tab-content,
html.behsaa-theme-dark .nav-tabs > li > a,
html.behsaa-theme-dark .breadcrumb,
html.behsaa-theme-dark .page-header,
html.behsaa-theme-dark .invoice-preview,
html.behsaa-theme-dark .tc-content,
html.behsaa-theme-dark .client-profile,
html.behsaa-theme-dark .project-overview-right-b,
html.behsaa-theme-dark .top_stats_wrapper,
html.behsaa-theme-dark .dashboard-stats {
  background-color: var(--bs-surface) !important;
  color: var(--bs-text) !important;
  border-color: var(--bs-border) !important;
}

html.behsaa-theme-dark .panel-heading,
html.behsaa-theme-dark .ibox-title,
html.behsaa-theme-dark .modal-header,
html.behsaa-theme-dark .modal-footer,
html.behsaa-theme-dark .widget-header {
  background-color: var(--bs-elevated) !important;
  border-color: var(--bs-border) !important;
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark .panel-default > .panel-heading,
html.behsaa-theme-dark .panel-info > .panel-heading,
html.behsaa-theme-dark .panel-primary > .panel-heading {
  background-color: var(--bs-elevated) !important;
  color: var(--bs-sand) !important;
  border-color: var(--bs-border) !important;
}

html.behsaa-theme-dark h1,
html.behsaa-theme-dark h2,
html.behsaa-theme-dark h3,
html.behsaa-theme-dark h4,
html.behsaa-theme-dark h5,
html.behsaa-theme-dark h6,
html.behsaa-theme-dark .text-dark,
html.behsaa-theme-dark .text-muted,
html.behsaa-theme-dark label,
html.behsaa-theme-dark .control-label,
html.behsaa-theme-dark .form-group > label,
html.behsaa-theme-dark .bold,
html.behsaa-theme-dark strong {
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark .text-muted {
  color: var(--bs-mist) !important;
}

/* Tables / DataTables */
html.behsaa-theme-dark table,
html.behsaa-theme-dark .table,
html.behsaa-theme-dark .table > thead > tr > th,
html.behsaa-theme-dark .table > tbody > tr > td,
html.behsaa-theme-dark .table > tbody > tr > th,
html.behsaa-theme-dark .table > tfoot > tr > td,
html.behsaa-theme-dark .dataTables_wrapper,
html.behsaa-theme-dark table.dataTable,
html.behsaa-theme-dark .table-bordered {
  background-color: var(--bs-surface) !important;
  color: var(--bs-text) !important;
  border-color: var(--bs-border) !important;
}

html.behsaa-theme-dark .table > thead > tr > th,
html.behsaa-theme-dark table.dataTable thead th,
html.behsaa-theme-dark .table thead {
  background-color: var(--bs-elevated) !important;
  color: var(--bs-sand) !important;
  border-bottom-color: var(--bs-steel) !important;
}

html.behsaa-theme-dark .table-striped > tbody > tr:nth-of-type(odd),
html.behsaa-theme-dark table.dataTable.stripe tbody tr.odd,
html.behsaa-theme-dark table.dataTable.display tbody tr.odd {
  background-color: #162033 !important;
}

html.behsaa-theme-dark .table-hover > tbody > tr:hover,
html.behsaa-theme-dark table.dataTable.hover tbody tr:hover,
html.behsaa-theme-dark table.dataTable.display tbody tr:hover {
  background-color: var(--bs-elevated) !important;
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark .dataTables_info,
html.behsaa-theme-dark .dataTables_length,
html.behsaa-theme-dark .dataTables_filter,
html.behsaa-theme-dark .dataTables_paginate,
html.behsaa-theme-dark .pagination > li > a,
html.behsaa-theme-dark .pagination > li > span {
  color: var(--bs-mist) !important;
  background-color: transparent !important;
  border-color: var(--bs-border) !important;
}

html.behsaa-theme-dark .pagination > .active > a,
html.behsaa-theme-dark .pagination > .active > span,
html.behsaa-theme-dark .paginate_button.current {
  background-color: var(--bs-steel) !important;
  border-color: var(--bs-steel) !important;
  color: var(--bs-sand) !important;
}

/* Forms */
html.behsaa-theme-dark .form-control,
html.behsaa-theme-dark input[type="text"],
html.behsaa-theme-dark input[type="email"],
html.behsaa-theme-dark input[type="password"],
html.behsaa-theme-dark input[type="number"],
html.behsaa-theme-dark input[type="search"],
html.behsaa-theme-dark input[type="tel"],
html.behsaa-theme-dark input[type="url"],
html.behsaa-theme-dark input[type="date"],
html.behsaa-theme-dark textarea,
html.behsaa-theme-dark select,
html.behsaa-theme-dark .select2-container--default .select2-selection--single,
html.behsaa-theme-dark .select2-container--default .select2-selection--multiple,
html.behsaa-theme-dark .select2-dropdown,
html.behsaa-theme-dark .bootstrap-select .dropdown-toggle,
html.behsaa-theme-dark .input-group-addon,
html.behsaa-theme-dark .input-group-text {
  background-color: var(--bs-input) !important;
  color: var(--bs-text) !important;
  border-color: var(--bs-border) !important;
}

html.behsaa-theme-dark .form-control:focus,
html.behsaa-theme-dark input:focus,
html.behsaa-theme-dark textarea:focus,
html.behsaa-theme-dark select:focus {
  border-color: var(--bs-mist) !important;
  box-shadow: 0 0 0 2px rgba(119, 141, 169, 0.35) !important;
}

html.behsaa-theme-dark .form-control::placeholder,
html.behsaa-theme-dark input::placeholder,
html.behsaa-theme-dark textarea::placeholder {
  color: var(--bs-mist) !important;
  opacity: 0.85;
}

html.behsaa-theme-dark .select2-container--default .select2-results__option--highlighted[aria-selected],
html.behsaa-theme-dark .dropdown-menu > li > a:hover,
html.behsaa-theme-dark .dropdown-item:hover {
  background-color: var(--bs-steel) !important;
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark .dropdown-menu > li > a,
html.behsaa-theme-dark .dropdown-item {
  color: var(--bs-text) !important;
}

/* Buttons */
html.behsaa-theme-dark .btn-primary,
html.behsaa-theme-dark .btn-info,
html.behsaa-theme-dark a.btn-primary {
  background-color: var(--bs-steel) !important;
  border-color: var(--bs-mist) !important;
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark .btn-primary:hover,
html.behsaa-theme-dark .btn-info:hover,
html.behsaa-theme-dark a.btn-primary:hover {
  background-color: var(--bs-mist) !important;
  border-color: var(--bs-sand) !important;
  color: var(--bs-navy) !important;
}

html.behsaa-theme-dark .btn-default,
html.behsaa-theme-dark .btn-secondary,
html.behsaa-theme-dark .btn-light {
  background-color: var(--bs-elevated) !important;
  border-color: var(--bs-border) !important;
  color: var(--bs-text) !important;
}

html.behsaa-theme-dark .btn-success {
  background-color: #2e7d32 !important;
  border-color: #66bb6a !important;
  color: #fff !important;
}

html.behsaa-theme-dark .btn-danger {
  background-color: #c62828 !important;
  border-color: #ef5350 !important;
  color: #fff !important;
}

html.behsaa-theme-dark .btn-warning {
  background-color: #ef6c00 !important;
  border-color: #ffb74d !important;
  color: #fff !important;
}

html.behsaa-theme-dark .label,
html.behsaa-theme-dark .badge {
  color: #fff !important;
}

html.behsaa-theme-dark .label-default,
html.behsaa-theme-dark .badge-secondary {
  background-color: var(--bs-steel) !important;
}

/* Datepicker / Jalali plot */
html.behsaa-theme-dark .datepicker-plot-area,
html.behsaa-theme-dark .datepicker-plot-area .datepicker-day-view,
html.behsaa-theme-dark .datepicker-plot-area .datepicker-month-view,
html.behsaa-theme-dark .datepicker-plot-area .datepicker-year-view,
html.behsaa-theme-dark .xdsoft_datetimepicker,
html.behsaa-theme-dark .bootstrap-datetimepicker-widget {
  background: var(--bs-surface) !important;
  color: var(--bs-text) !important;
  border-color: var(--bs-border) !important;
}

html.behsaa-theme-dark .datepicker-plot-area .datepicker-day-view .table-days td span,
html.behsaa-theme-dark .datepicker-plot-area .datepicker-navigator .pwt-btn {
  color: var(--bs-text) !important;
}

html.behsaa-theme-dark .datepicker-plot-area .datepicker-day-view .table-days td.selected span,
html.behsaa-theme-dark .datepicker-plot-area .datepicker-day-view .table-days td span.selected {
  background: var(--bs-steel) !important;
  color: var(--bs-sand) !important;
}

/* FullCalendar v3 (client روزشمار) + v5+ */
html.behsaa-theme-dark .fc,
html.behsaa-theme-dark .fc-view,
html.behsaa-theme-dark .fc-view-container,
html.behsaa-theme-dark .fc-toolbar,
html.behsaa-theme-dark .fc-daygrid,
html.behsaa-theme-dark .fc-scrollgrid,
html.behsaa-theme-dark .fc-theme-standard td,
html.behsaa-theme-dark .fc-theme-standard th,
html.behsaa-theme-dark .fc-col-header-cell,
html.behsaa-theme-dark .fc-daygrid-day,
html.behsaa-theme-dark .fc-list,
html.behsaa-theme-dark .fc-popover,
html.behsaa-theme-dark .fc-unthemed th,
html.behsaa-theme-dark .fc-unthemed td,
html.behsaa-theme-dark .fc-widget-header,
html.behsaa-theme-dark .fc-widget-content,
html.behsaa-theme-dark .fc-head,
html.behsaa-theme-dark .fc-head-container,
html.behsaa-theme-dark .fc-body,
html.behsaa-theme-dark .fc-row,
html.behsaa-theme-dark .fc-row.fc-widget-header,
html.behsaa-theme-dark .fc-day-header,
html.behsaa-theme-dark th.fc-day-header,
html.behsaa-theme-dark .fc-bg,
html.behsaa-theme-dark .fc-bg table,
html.behsaa-theme-dark .fc-bg td,
html.behsaa-theme-dark .fc-content-skeleton,
html.behsaa-theme-dark .fc-content-skeleton table,
html.behsaa-theme-dark .fc-axis,
html.behsaa-theme-dark .fc-divider {
  background-color: var(--bs-surface) !important;
  color: var(--bs-text) !important;
  border-color: var(--bs-border) !important;
}

html.behsaa-theme-dark .fc-widget-header,
html.behsaa-theme-dark .fc-day-header,
html.behsaa-theme-dark th.fc-day-header,
html.behsaa-theme-dark .fc-head-container,
html.behsaa-theme-dark .fc-row.fc-widget-header,
html.behsaa-theme-dark .fc-col-header-cell {
  background-color: var(--bs-elevated) !important;
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark .fc-button,
html.behsaa-theme-dark .fc-button-primary,
html.behsaa-theme-dark .fc-state-default {
  background-color: var(--bs-steel) !important;
  border-color: var(--bs-mist) !important;
  color: var(--bs-sand) !important;
  background-image: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

html.behsaa-theme-dark .fc-state-active,
html.behsaa-theme-dark .fc-state-down {
  background-color: var(--bs-mist) !important;
  color: var(--bs-navy) !important;
}

html.behsaa-theme-dark .fc-day-today,
html.behsaa-theme-dark .fc-today,
html.behsaa-theme-dark .fc-state-highlight,
html.behsaa-theme-dark td.fc-today,
html.behsaa-theme-dark .fc-day.fc-today {
  background-color: rgba(65, 90, 119, 0.35) !important;
}

html.behsaa-theme-dark .fc-day-number,
html.behsaa-theme-dark .fc-ltr .fc-basic-view .fc-day-number,
html.behsaa-theme-dark .fc-rtl .fc-basic-view .fc-day-number {
  color: var(--bs-text) !important;
}

html.behsaa-theme-dark .fc-other-month .fc-day-number {
  color: var(--bs-mist) !important;
  opacity: 0.55;
}

html.behsaa-theme-dark .fc-event,
html.behsaa-theme-dark .fc-event-dot {
  border-color: var(--bs-mist) !important;
}

/* Chart.js canvas text contrast helper */
html.behsaa-theme-dark canvas {
  filter: none;
}
html.behsaa-theme-dark .chart-legend,
html.behsaa-theme-dark .chartjs-render-monitor + ul,
html.behsaa-theme-dark .highcharts-container text {
  color: var(--bs-text) !important;
  fill: var(--bs-text) !important;
}

/* Auth pages (Keen redesign) */
html.behsaa-theme-dark body.behsaa-auth-page,
html.behsaa-theme-dark body.login_admin.behsaa-auth-page,
html.behsaa-theme-dark body.authentication.behsaa-auth-page,
html.behsaa-theme-dark html.behsaa-auth-html body {
  background: var(--bs-navy) !important;
  color: var(--bs-text) !important;
}

html.behsaa-theme-dark .behsaa-keen-auth,
html.behsaa-theme-dark .behsaa-keen-auth__main,
html.behsaa-theme-dark .behsaa-keen-auth__card,
html.behsaa-theme-dark .behsaa-keen-auth__panel,
html.behsaa-theme-dark .authentication-form,
html.behsaa-theme-dark .company-logo {
  background-color: var(--bs-navy) !important;
  color: var(--bs-text) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html.behsaa-theme-dark .behsaa-keen-auth__card {
  background-color: transparent !important;
}

html.behsaa-theme-dark .behsaa-keen-auth h1,
html.behsaa-theme-dark .behsaa-keen-auth h2,
html.behsaa-theme-dark .behsaa-keen-auth label,
html.behsaa-theme-dark .behsaa-keen-auth .form-group label {
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark .behsaa-keen-auth .form-control,
html.behsaa-theme-dark .authentication-form .form-control {
  background-color: var(--bs-input) !important;
  color: var(--bs-text) !important;
  border-color: var(--bs-border) !important;
}

html.behsaa-theme-dark .behsaa-keen-auth .btn-primary,
html.behsaa-theme-dark .authentication-form .btn-info,
html.behsaa-theme-dark .authentication-form button[type="submit"] {
  background-color: var(--bs-steel) !important;
  border-color: var(--bs-mist) !important;
  color: var(--bs-sand) !important;
}

/* Client portal footer */
html.behsaa-theme-dark footer,
html.behsaa-theme-dark footer.navbar-fixed-bottom,
html.behsaa-theme-dark .navbar-fixed-bottom {
  background-color: var(--bs-slate) !important;
  border-color: var(--bs-border) !important;
  border-top: 1px solid var(--bs-border) !important;
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark footer a,
html.behsaa-theme-dark footer.navbar-fixed-bottom a {
  color: var(--bs-sand) !important;
}

/* Knowledge base top search band */
html.behsaa-theme-dark .jumbotron,
html.behsaa-theme-dark .kb-search-jumbotron,
html.behsaa-theme-dark .jumbotron.kb-search-jumbotron {
  background-color: var(--bs-slate) !important;
  color: var(--bs-text) !important;
  border-bottom: 1px solid var(--bs-border);
}

html.behsaa-theme-dark .kb-search-jumbotron h1,
html.behsaa-theme-dark .kb-search-jumbotron h2,
html.behsaa-theme-dark .kb-search-jumbotron h3,
html.behsaa-theme-dark .kb-search .form-control-feedback {
  color: var(--bs-sand) !important;
}

html.behsaa-theme-dark .panel_s,
html.behsaa-theme-dark .panel_s .panel-body,
html.behsaa-theme-dark .article_group_wrapper {
  background-color: var(--bs-surface) !important;
  color: var(--bs-text) !important;
  border-color: var(--bs-border) !important;
}

/* Misc chrome */
html.behsaa-theme-dark hr {
  border-top-color: var(--bs-border) !important;
}

html.behsaa-theme-dark .progress {
  background-color: var(--bs-elevated) !important;
}

html.behsaa-theme-dark .progress-bar {
  background-color: var(--bs-mist) !important;
}

html.behsaa-theme-dark .close,
html.behsaa-theme-dark button.close {
  color: var(--bs-sand) !important;
  text-shadow: none !important;
  opacity: 0.85;
}

html.behsaa-theme-dark .fa,
html.behsaa-theme-dark .glyphicon,
html.behsaa-theme-dark i.menu-icon {
  color: inherit;
}

html.behsaa-theme-dark .btn .fa,
html.behsaa-theme-dark .btn .glyphicon,
html.behsaa-theme-dark #side-menu .fa,
html.behsaa-theme-dark .navbar .fa {
  color: inherit !important;
}

html.behsaa-theme-dark ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
html.behsaa-theme-dark ::-webkit-scrollbar-track {
  background: var(--bs-navy);
}
html.behsaa-theme-dark ::-webkit-scrollbar-thumb {
  background: var(--bs-steel);
  border-radius: 6px;
}
