@media (prefers-color-scheme: dark) {
  
  body {
    color: #ffffff !important;
    font-weight: 400;
    width: auto;
    height: 100vh;
    background-color: #323232;
    background-size: 400% 400%;
    -webkit-animation: Gradient 90s ease infinite;
    -moz-animation: Gradient 90s ease infinite;
    animation: Gradient 90s ease infinite;
  
  }
  
  .red11,
  .standard {
    color: #e2e2e2 !important;
  }
  
  pre,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: #e2e2e2 !important;
  }
  
  table.text,
  td.text,
  tr.text {
    color: #e2e2e2 !important;
  }
  
  
  select,
  select.form {
    background-color: #3a3a3a;
    border-color: #555;
    color: #e2e2e2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  }

  select:focus,
  select.form:focus {
    border-color: #E8BA49;
    box-shadow: 0 0 0 2px rgba(232, 186, 73, 0.15);
  }

  .select2-selection__choice__display {
    color: #666;
  }

  .select2-results__options {
    color: #666 !important;
  }
  
  fieldset {
    border: 1px solid #444 !important;
    background-color: #2a2a2a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  
  .topBar {
    border: none;
    background-color: #3a3a3a !important;
    border-radius: 8px;
  }

  .topBar:hover {
    background-color: #444 !important;
  }

  .topBar.open {
    border-radius: 8px 8px 0 0;
  }

  .panelContent {
    background-color: #333;
  }

  #dhtmlgoodies_xpPane .dhtmlgoodies_panel .topBar span {
    color: #e2e2e2;
  }

  a.menu {
    color: #ccc !important;
  }

  a.menu:hover {
    color: #E8BA49 !important;
  }
  
  .SmallWordsBlack {
    color: #FFF;
  }
  
  legend {
    border: none !important;
    border-left: 3px solid #E8BA49 !important;
    background-color: #363636 !important;
    color: #e2e2e2 !important;
  }
  
  div#search_for_auto_complete {
    background-color: #464646;
    border: 1px #CCC solid;
    -khtml-box-shadow: rgba(255, 255, 255, 0.5) 0 0 10px;
    -ms-box-shadow: rgba(255, 255, 255, 0.5) 0 0 10px;
    -o-box-shadow: rgba(255, 255, 255, 0.5) 0 0 10px;
    -moz-box-shadow: rgba(255, 255, 255, 0.5) 0 0 10px;
    -webkit-box-shadow: rgba(255, 255, 255, 0.5) 0 0 10px;
    box-shadow: rgba(255, 255, 255, 0.5) 0 0 10px;
  }
  
  li.contact {
    background-color: #464646;
  }
  
  li.contact a {
    color: #fff !important;
  }
  
  li.contact a:hover {
    color: #E8BA49 !important;
  }
  
  a:link {
    color: #E8BA49;
  }

  a:visited {
    color: #E8BA49;
  }

  a:hover {
    color: #cc9710;
  }

  a.blue11 {
    background: rgba(232, 186, 73, 0.15);
    color: #E8BA49 !important;
  }

  a.blue11:hover {
    background: #E8BA49;
    color: #000 !important;
  }
  
  .standardtext {
    color: #ffffff;
  }
  
  .menu_title {
    color: #ffffff;
    text-shadow: 1px 1px 2px #000;
  }
  
  /*
        table.text tr {
            background-color: #2d2d2d
        }
    */
  
  .qq-gallery.qq-uploader {
    background-color: #1E1E1E;
  }
  
  .black11b {
    color: #FFF;
    text-shadow: none;
  }
  
  .black12 {
    color: #FFF;
  }
  
  
  /* Dark Gray */
  .standard {
    background-color: #363636;
  }
  
  .fill03 {
    color: #fff !important;
  }
  
  /* Dark Gray */
  .fill03 {
    background-color: #2a2a2a;
  }
  
  /* Black */
  .fill04 {
    background-color: #2a2a2a;
  }
  
  /* Client replied / attention */
  .fill05 {
    color: #fff !important;
    background-color: rgba(232, 186, 73, 0.1) !important;
    border-left: 3px solid #E8BA49;
  }

  .fill05:nth-child(odd) {
    color: #fff !important;
    background-color: rgba(232, 186, 73, 0.15) !important;
    border-left: 3px solid #E8BA49;
  }
  
  /* Green */
  .fill06 {
    color: #fff !important;
    background-color: green !important;
  }
  
  /* Blue */
  .fill07 {
    color: #fff !important;
    background-color: #000573 !important;
  }
  
  /* Yellow */
  .fill08 {
    color: #000 !important;
    background-color: #E8BA49 !important;
  }
  
  /* Green */
  .help {
    color: #00ff56 !important;
  }
  
  
  
  #content table.standard .fill05 a:link,
  #content table.standard .fill05 a:visited,
  .fill05 a,
  .fill05 a:hover,
  .fill05 a:visited {
    color: #fff !important;
  }
  
  
  #content table.standard .fill06 a:link,
  #content table.standard .fill06 a:visited,
  .fill06 a,
  .fill06 a:hover,
  .fill06 a:visited {
    color: #fff !important;
  }
  
  .style1 {
    color: #FFF
  }
  
  
  
  table.standard th,
  table.standard tr.table_header td {
    text-shadow: none !important;
    background-image: none !important;
    background-color: #2a2a2a !important;
    font-weight: 700;
    color: #888 !important;
    border-bottom-color: #555 !important;
  }

  table.standard tr.table_header,
  table.standard tr.table_header:nth-child(even),
  table.standard tr.table_header:nth-child(odd) {
    background-color: #2a2a2a !important;
  }
  
  #content ul:not(no_bullets) li:before {
    color: #fff !important;
  }
  
  .alert_error_container {
    background-color: #820c0c;
    border: 1px #820c0c solid;
    color: #fff !important;
  }
  
  .alert_message_container {
    background-color: green !important;
    border: 1px green solid;
    color: #fff !important;
  }
  
  .alert_message:before {
    color: #FFF;
  }
  
  .alert_error:before {
    color: #FFF;
  }
  
  .vrow_a {
    background-color: #1E1E1E;
  }
  
  .vrow_b {
    background-color: #3f3f3f;
  }
  
  .vrow_separator {
    background-color: #1E1E1E;
  }
  
  .vrow_total {
    background-color: #820c0c;
  }
  
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  textarea {
    color: #000;
    border: 1px solid #CCC;
    background-color: #FFF;
    border-radius: 4px;
    outline: none;
  }
  
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  textarea {
    color: #FFF;
    border: #6E6E6E solid 2px;
    background-color: #6E6E6E;
    border-radius: 4px;
    margin: 3px;
  }
  
  input:focus,
  input[type="password"]:focus,
  textarea:focus {
    background-color: #989898;
    border: 2px solid #E8BA49;
  }
  
  input[type="submit"],
  input[type="reset"],
  button[type="submit"],
  button,
  a.button,
  .qq-upload-button {
    background-color: #E8BA49;
    background-image: none;
    color: #000;
    border: 1px solid #E8BA49;
    border-radius: 6px;
    font-weight: 600;
  }

  input[type="submit"]:hover,
  input[type="reset"]:hover,
  button[type="submit"]:hover,
  button:hover,
  a.button:hover,
  .qq-upload-button:hover {
    background-image: none;
    background-color: #cc9710;
    border-color: #cc9710;
    color: #000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }

  input[type="submit"]:focus,
  button:focus {
    box-shadow: 0 0 0 3px rgba(232, 186, 73, 0.3);
  }

  .btn-outline,
  input[type="reset"] {
    background-color: transparent;
    border-color: #666;
    color: #ccc;
  }

  .btn-outline:hover,
  input[type="reset"]:hover {
    background-color: #444;
    border-color: #777;
    color: #fff;
  }
  
  ::placeholder {
    color: #fff;
  }
  
  ::selection {
    background: #E8BA49;
    color: #000;
  }
  
  ::-moz-selection {
    background: #E8BA49;
    color: #000;
  }
  
  table.hover tr:not(.nohover):hover {
    background-color: rgba(232, 186, 73, 0.12) !important;
    color: inherit !important;
  }

  table.hover tr:not(.nohover):hover a {
    color: inherit !important;
  }

  table.hover tr:first-child:hover {
    background-color: transparent !important;
    color: #FFF !important;
  }
  
  .standard_billed {
    color: #FFF;
    background-color: #0b0b0b;
    background-image: linear-gradient(#563d3d, #0b0b0b 60px);
  }
  
  #ajax_window,
  #overlay_container {
    background-color: rgba(10, 10, 10, 0.66);
  }
  
  #overlay {
    background-color: rgba(10, 10, 10, 1);
  }
  
  /* Dark Gray */
  .alternate_a,
  table.standard {
    background-color: #313131
  }
  
  
  
  .alternate_a,
  table.standard tr:nth-child(odd):not(.fill05) {
    background-color: #2C2B31
  }
  
  .alternate_b,
  table.standard tr:nth-child(even):not(.fill05) {
    background-color: #26222C
  }
  
  
  table.standard_support tr:nth-child(odd):not(.fill05) {
    background-color: rgba(179, 132, 43, 0.52)
  }
  
  table.standard_sales tr:nth-child(odd):not(.fill05) {
    background-color: #151754
  }
  
  table.standard_design tr:nth-child(odd):not(.fill05) {
    background-color: #0D3613
  }
  
  
  table.standard_support {
    color: #FFF;
    background-color: #2f2f2f;
  }
  
  table.standard_sales {
    color: #FFF;
    background-color: #2f2f2f;
  }
  
  fieldset#sales_container {
    background-color: #151754 !important;
  }
  
  table.standard_sales {
    border: 1px #00bcff solid;
    border-radius: 5px;
    background-color: #151754;
  }
  
  table.standard_billing, fieldset.standard_billing {
    border: 1px rgba(189, 84, 230, 1) solid !important;
    background-color: #351554 !important;
  }
  
  table.standard_billed {
    color: #FFF;
    background-color: #363636;
    background-image: none;
  }
  
  .top-bar {
    background-color: #E8BA49;
  }
  
  .middle-bar {
    background-color: #E8BA49;
  }
  
  .bottom-bar {
    background-color: #E8BA49;
  }
  
  .toggle-name {
    color: #E8BA49;
  }
  
  hr {
    border-top: medium double #808080;
    color: #808080;
  }
  
  #logo_lightmode {
    display: none;
  }
  
  #logo_darkmode {
    display: block;
  }
  
  i.venue_copy {
    color: #FFF;
  }
  
  .staff_note,
  table.standard tr:nth-child(odd).staff_note,
  table.standard tr:nth-child(even).staff_note {
    background-color: rgba(121, 0, 0, .5) !important;
  }
  
  /* Purple */
  table.standard tr.highlight,
  .highlight {
    background-color: rgba(232, 186, 73, 0.25) !important;
  }
  
  /* Orange */
  table.standard tr.highlight_2,
  .highlight_2 {
    /* background-color: rgba(255, 117, 4, 0.25) !important; */
    background-color: #000 !important;
  }
  
  .stage_container {
    border: 1px #2F3241 solid;
  }
  
  .cal-day-weekend span[data-cal-date] {
    color: #dcdcdc !important;
  }
  
  .cal-day-holiday span[data-cal-date] {
    color: #dcdcdc !important;
  }
  
  .cal-year-box .row-fluid:hover,
  .cal-row-fluid:hover {
    background: #000 !important;
  }
  
  
  .highlight_2,
  .highlight_3 {
    color: #FFF !important;
  }
  
  
  
  #popup {
    background-color: #252525;
    box-shadow: 1px 1px 15px rgba(255, 255, 255, 0.81);
  }
  
  #popupheader {
    background-color: #000;
    color: #FFF;
  }
  
  #cal-day-box .cal-day-hour:nth-child(odd) {
    background-color: transparent;
  }
  
  .cal-year-box .row-fluid:hover,
  .cal-row-fluid:hover {
    background-color: #000;
  }
  
  .cal-day-today span[data-cal-date] {
    color: #fff;
  }
  
  .cal-day-today {
    background-color: #000;
  }
  
  
  .bgcalandar {
    background-color: #2C2B31 !important;
  }
  
  
  .alldaycalandar {
    background-color: #26222C !important;
  }
  
  .alldaycalandar td:first-child {
    background-color: #2C2B31 !important;
  }
  
  [class*="cal-cell"]:hover {
    background-color: #000;
  }
  
  .loading_placeholder_20 {
    background-color: #000;
  }
  
  .loading_placeholder_100 {
    background-color: #000;
  }
  
  @-webkit-keyframes Gradient {
    0% {
      background-position: 0 50%;
    }
  
    50% {
      background-position: 100% 50%;
    }
  
    100% {
      background-position: 0 50%;
    }
  }
  
  @-moz-keyframes Gradient {
    0% {
      background-position: 0 50%;
    }
  
    50% {
      background-position: 100% 50%;
    }
  
    100% {
      background-position: 0 50%;
    }
  }
  
  @-o-keyframes Gradient {
    0% {
      background-position: 0 50%;
    }
  
    50% {
      background-position: 100% 50%;
    }
  
    100% {
      background-position: 0 50%;
    }
  }
  
  @keyframes Gradient {
    0% {
      background-position: 0 50%;
    }
  
    50% {
      background-position: 100% 50%;
    }
  
    100% {
      background-position: 0 50%;
    }
  }
  
  .dropdown a:hover{color:#cc9710 !important}
  .dropdown-menu{background-color:#3b3b3b !important}
  .dropdown-menu a:hover{background-color:#2a2a2a !important}
  
  .noti-content {
    width:100%;padding:10px;box-shadow:0 0 20px rgba(0,0,0,0.15);border:1px solid rgba(137,179,255,1);border-radius:10px;background-color: #26222c; box-sizing: border-box
  }
  
  #pushmessage {
    color:#FFF;font-size:14px;line-height:20px;text-align:left;display:block;margin:0
  }

  /* CKEditor Source View Dark Mode Fix */
  .cke_source {
    color: #e2e2e2 !important;
    background-color: #1e1e1e !important;
  }

  .cke_dialog_body {
    background-color: #2a2a2a !important;
    color: #e2e2e2 !important;
  }

  .cke_dialog_contents {
    background-color: #2a2a2a !important;
  }

  .cke_dialog_contents_body {
    background-color: #2a2a2a !important;
  }

  .cke_dialog textarea.cke_source {
    color: #e2e2e2 !important;
    background-color: #1e1e1e !important;
  }

  /* Staff Note checkbox highlight - dark mode */
  .staff-note-checkbox {
    background: #4a3000 !important;
    border-color: #ff9800 !important;
  }
  .staff-note-checkbox strong {
    color: #ffb74d !important;
  }
  .staff-note-checkbox .fa-eye-slash {
    color: #ffb74d !important;
  }

  /* After Hours Auto-Response Notice - dark mode */
  .after-hours-notice {
    background: linear-gradient(135deg, #e65100 0%, #bf360c 100%) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4) !important;
  }

  /* Menu Section Headers - dark mode */
  .menu-section-header {
    color: #e2e2e2 !important;
  }
  .menu-section-subheader {
    color: #b0b0b0 !important;
  }

  /* Code blocks - dark mode */
  pre.code-block {
    background: #2d2d2d !important;
    border-color: #444 !important;
    color: #e2e2e2 !important;
  }

  /* Table section headers - dark mode */
  tr.section-header td {
    background: #3a3a3a !important;
  }

  /* Status indicators - dark mode */
  .status-complete {
    color: #5cb85c !important;
  }
  .status-pending {
    color: #aaa !important;
  }
  h3.status-complete {
    color: #5cb85c !important;
  }
  h3.status-pending {
    color: #5bc0de !important;
  }

  /* Accounting page common styles - dark mode */
  .text-muted {
    color: #aaa !important;
  }
  .text-muted-light {
    color: #888 !important;
  }
  .text-success {
    color: #5cb85c !important;
  }
  .text-danger {
    color: #ff6b6b !important;
  }
  .text-warning {
    color: #f0ad4e !important;
  }
  .text-info {
    color: #5bc0de !important;
  }
  .status-active {
    color: #5cb85c !important;
  }
  .status-inactive {
    color: #888 !important;
  }
  .btn-secondary {
    background: #444 !important;
    color: #e2e2e2 !important;
  }
  .info-box {
    background: #3a3a3a !important;
    color: #e2e2e2 !important;
  }
  .empty-message {
    color: #aaa !important;
  }

  /* Accounting form styles - dark mode */
  .acct-form {
    background: #3a3a3a !important;
  }
  .acct-form input[type="text"],
  .acct-form input[type="email"],
  .acct-form input[type="number"],
  .acct-form input[type="date"],
  .acct-form select,
  .acct-form textarea {
    background: #2d2d2d !important;
    border-color: #555 !important;
    color: #e2e2e2 !important;
  }
  .acct-form label {
    color: #e2e2e2 !important;
  }

  /* Attachment styles - dark mode */
  .attachment-item {
    background: #3a3a3a !important;
  }
  .attachment-item a {
    color: #6ea8fe !important;
  }

  /* Accounting report and section styles - dark mode */
  .summary-box,
  .summary-grid,
  .recon-section,
  .settings-section {
    background: #3a3a3a !important;
  }
  .report-table .total-row {
    background: #3a3a3a !important;
    border-top-color: #666 !important;
  }
  .type-badge {
    background: #555 !important;
  }

  /* Color picker and tag styles - dark mode */
  .preset-colors span:hover {
    border-color: #fff !important;
  }
  .stat-box .label {
    color: #aaa !important;
  }

  /* Journal entry styles - dark mode */
  .je-table th, .je-table td {
    border-color: #555 !important;
  }
  .je-table input, .je-table select {
    background: #2d2d2d !important;
    border-color: #555 !important;
    color: #e2e2e2 !important;
  }
  .balance-indicator.balanced {
    background: #1e4620 !important;
    color: #a3d9a5 !important;
  }
  .balance-indicator.unbalanced {
    background: #4a1c1c !important;
    color: #f5c6cb !important;
  }

  /* Expense form styles - dark mode */
  .form-group input, .form-group select, .form-group textarea {
    background: #2d2d2d !important;
    border-color: #555 !important;
    color: #e2e2e2 !important;
  }
  .tag-checkbox {
    background: #444 !important;
    color: #e2e2e2 !important;
  }
  .summary-bar {
    background: #3a3a3a !important;
  }

  /* Journal entry line styles - dark mode */
  .je-lines th {
    background: #3a3a3a !important;
  }
  .je-lines .line-total {
    background: #3a3a3a !important;
  }
  .je-lines input, .je-lines select {
    background: #2d2d2d !important;
    border-color: #555 !important;
    color: #e2e2e2 !important;
  }

  /* Settings page styles - dark mode */
  .settings-section h3 {
    border-bottom-color: #555 !important;
  }
  .settings-section input, .settings-section select {
    background: #2d2d2d !important;
    border-color: #555 !important;
    color: #e2e2e2 !important;
  }
  .stat-box {
    background: #3a3a3a !important;
    border-color: #555 !important;
  }
  .stat-box .number {
    color: #e2e2e2 !important;
  }
  .warning-box {
    background: #4a3f00 !important;
    border-color: #ffc107 !important;
    color: #ffc107 !important;
  }

  /* Reconciliation styles - dark mode */
  .matched {
    background: #1e4620 !important;
  }
  .unmatched {
    background: #4a3f00 !important;
  }
  .action-btn {
    background: #444 !important;
    border-color: #666 !important;
    color: #e2e2e2 !important;
  }
  .action-btn:hover {
    background: #555 !important;
  }

  /* Modal styles - dark mode */
  .modal-content {
    background: #3a3a3a !important;
    color: #e2e2e2 !important;
  }
  .modal-header {
    border-bottom-color: #555 !important;
  }
  .match-option {
    border-color: #555 !important;
  }
  .match-option:hover {
    background: #444 !important;
  }

  /* Report styles - dark mode */
  .report-header .date-range {
    color: #aaa !important;
  }
  .report-filters {
    background: #3a3a3a !important;
  }
  .report-filters label {
    color: #aaa !important;
  }
  button.preset-btn {
    background-color: #444 !important;
    border-color: #666 !important;
    color: #e2e2e2 !important;
  }
  button.preset-btn:hover {
    background-color: #555 !important;
    color: #e2e2e2 !important;
  }
  .report-filters input[type="submit"] {
    padding: 5px 15px !important;
    font-size: 12px !important;
  }
  .report-filters button.text {
    background-color: #444 !important;
    color: #e2e2e2 !important;
    border-color: #666 !important;
    font-weight: normal !important;
  }
  .report-filters button.text:hover {
    background-color: #555 !important;
    color: #e2e2e2 !important;
  }
  .report-section h3 {
    border-bottom-color: #666 !important;
  }
  .report-table td {
    border-bottom-color: #444 !important;
  }
  .report-table .subtotal-row {
    background: #3a3a3a !important;
  }
  .summary-item .label {
    color: #aaa !important;
  }
  .no-data {
    color: #888 !important;
  }
  .equation {
    color: #aaa !important;
  }
  .balance-check.balanced {
    background: #1e4620 !important;
    color: #a3d9a5 !important;
  }
  .balance-check.unbalanced {
    background: #4a1c1c !important;
    color: #f5c6cb !important;
  }

  /* Budget report styles - dark mode */
  .report-table th {
    color: #ddd !important;
    background: #3a3a3a !important;
    border-bottom-color: #555 !important;
  }
  .neutral {
    color: #aaa !important;
  }
  .variance-bar {
    background: #444 !important;
  }
  .summary-row .label {
    color: #aaa !important;
  }
  .no-budget {
    color: #888 !important;
  }

  /* 1099 report styles - dark mode */
  .year-btn {
    background: #444 !important;
    border-color: #666 !important;
    color: #e2e2e2 !important;
  }
  .year-btn:hover {
    background: #555 !important;
  }
  .vendor-address {
    color: #aaa !important;
  }
  .tax-id {
    background: #3a3a3a !important;
    color: #e2e2e2 !important;
  }
  .threshold-note {
    background: #4a3f00 !important;
    color: #ffc107 !important;
  }
  .section-header {
    border-bottom-color: #666 !important;
  }

  /* Server details page - dark mode */
  .sd-back a {
    color: #e2e2e2 !important;
  }
  .sd-card {
    background: #3a3a3a !important;
    border-color: #555 !important;
  }
  .sd-card-label {
    color: #aaa !important;
  }
  .sd-card-bar {
    background: #555 !important;
  }
  .sd-info-row {
    border-bottom-color: #444 !important;
  }
  .sd-info-label {
    color: #aaa !important;
  }
  .sd-info-value {
    color: #e2e2e2 !important;
  }
  .sd-table th {
    color: #aaa !important;
    border-bottom-color: #555 !important;
  }
  .sd-table td {
    color: #e2e2e2 !important;
    border-bottom-color: #444 !important;
  }
  .sd-usage-bar {
    background: #555 !important;
  }
  .sd-loading {
    color: #aaa !important;
  }
  .sd-error {
    color: #ff6b6b !important;
  }
  .sd-footer {
    color: #aaa !important;
  }
  .sd-sparkline-card {
    background: #3a3a3a !important;
    border-color: #555 !important;
  }
  .sd-sparkline-title {
    color: #aaa !important;
  }
  .sd-history-note {
    color: #888 !important;
  }

  /* AI prompt and suggestion areas */
  #ai-instructions-wrapper { border-color: #555 !important; }
  #ai-instructions-wrapper textarea { background: #2a2a2a !important; color: #e0e0e0 !important; border-color: #555 !important; }
  #ai-suggestion-box { border-color: #555 !important; }

}