/* Dark Mode Overrides */
[data-theme="dark"] body {
  background-color: #0d1117;
}

[data-theme="dark"] header {
  background-color: #21262d !important;
  border-color: #30363d;
}

/* Mobile header fixes */
@media (max-width: 767px) {
  [data-theme="dark"] header .navbar-default {
    min-height: 50px;
    height: auto;
    padding: 5px 0;
  }

  [data-theme="dark"] .navbar-brand {
    padding: 10px 0;
    max-width: 180px;
    font-size: 16px;
  }

  [data-theme="dark"] .theme-toggle--brand {
    margin: 4px 0 0 4px;
  }
}

[data-theme="dark"] #content,
[data-theme="dark"] [role="main"],
[data-theme="dark"] .col-sm-9#content {
  background-color: #161b22 !important;
  color: #c9d1d9;
}

[data-theme="dark"] footer {
  background-color: #21262d !important;
  border-color: #30363d;
}

[data-theme="dark"] footer a {
  color: #f0f6fc;
}

[data-theme="dark"] footer a:hover,
[data-theme="dark"] footer a:focus {
  color: #20c997;
}

[data-theme="dark"] body ::selection,
[data-theme="dark"] body ::-moz-selection {
  background-color: #20c997 !important;
  color: #0d1117 !important;
}

[data-theme="dark"] input::selection,
[data-theme="dark"] textarea::selection,
[data-theme="dark"] select::selection {
  background-color: #20c997 !important;
  color: #0d1117 !important;
}

[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #0d1117 inset !important;
  -webkit-text-fill-color: #c9d1d9 !important;
  transition: background-color 5000s ease-in-out 0s;
}

[data-theme="dark"] input:-moz-autofill,
[data-theme="dark"] input:-moz-autofill:hover,
[data-theme="dark"] input:-moz-autofill:focus,
[data-theme="dark"] input:-moz-autofill:active {
  box-shadow: 0 0 0 30px #0d1117 inset !important;
  -moz-text-fill-color: #c9d1d9 !important;
  transition: background-color 5000s ease-in-out 0s;
}

[data-theme="dark"] input:autofill,
[data-theme="dark"] input:autofill:hover,
[data-theme="dark"] input:autofill:focus,
[data-theme="dark"] input:autofill:active {
  box-shadow: 0 0 0 30px #0d1117 inset !important;
  text-fill-color: #c9d1d9 !important;
  transition: background-color 5000s ease-in-out 0s;
}

[data-theme="dark"] datalist {
  background-color: #0d1117 !important;
  color: #c9d1d9 !important;
}

[data-theme="dark"] datalist option {
  background-color: #0d1117 !important;
  color: #c9d1d9 !important;
}

[data-theme="dark"] input:-webkit-autofill::selection,
[data-theme="dark"] input:-webkit-autofill ::selection {
  background-color: #20c997 !important;
  color: #0d1117 !important;
}

[data-theme="dark"] a {
  color: #20c997;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: #0d1117;
  border-color: #20c997;
  color: #c9d1d9;
}

/* Autofill overrides (dark mode) */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] input:-webkit-autofill:active {
  -webkit-box-shadow: inset 0 0 0 30px #0d1117;
  box-shadow: inset 0 0 0 30px #0d1117;
  -webkit-text-fill-color: #c9d1d9;
  color: #c9d1d9;
  transition: background-color 0s;
}

@supports (-webkit-appearance: none) {
  [data-theme="dark"] input:-moz-placeholder {
    color: #c9d1d9;
  }
}
/* Firefox */
[data-theme="dark"] input:-moz-autofill {
  box-shadow: inset 0 0 0 30px #0d1117;
  -moz-text-fill-color: #c9d1d9;
}

[data-theme="dark"] .col-sm-3 > nav,
[data-theme="dark"] .navbar-default,
[data-theme="dark"] .navbar-default .navbar-collapse {
  background-color: #21262d !important;
}

[data-theme="dark"] .col-sm-3 > nav {
  border: none !important;
  border-radius: 0 !important;
}

[data-theme="dark"] .col-sm-3 {
  border-right: 1px solid #30363d !important;
}

[data-theme="dark"] .col-sm-9 {
  border-left: 1px solid #30363d !important;
}

[data-theme="dark"] .navbar-default .navbar-nav > li > a,
[data-theme="dark"] .AspNet-Menu a,
[data-theme="dark"] .AspNet-MenuTop a,
[data-theme="dark"] .AspNet-MenuLink a {
  color: #f0f6fc !important;
}

[data-theme="dark"] .navbar-default .navbar-nav > li > a:hover,
[data-theme="dark"] .navbar-default .navbar-nav > li > a:focus,
[data-theme="dark"] .AspNet-Menu a:hover,
[data-theme="dark"] .AspNet-Menu a:focus,
[data-theme="dark"] .AspNet-MenuLink a:hover,
[data-theme="dark"] .AspNet-MenuLink a:focus {
  color: #f0f6fc !important;
  background-color: #30363d !important;
}

[data-theme="dark"] .AspNet-Menu li:hover,
[data-theme="dark"] .AspNet-MenuVertical li:hover {
  background-color: transparent;
}

[data-theme="dark"] .AspNet-Menu li:hover > a,
[data-theme="dark"] .AspNet-MenuVertical li:hover > a {
  background-color: transparent;
}

[data-theme="dark"] table th {
  color: #20c997;
}

[data-theme="dark"] .btn-primary {
  background-color: #20c997;
  border-color: #20c997;
  color: #0d1117;
}

[data-theme="dark"] .btn-danger {
  background-color: #20c997;
  border-color: #20c997;
  color: #0d1117;
}

[data-theme="dark"] .btn-default,
[data-theme="dark"] .btn-default:hover,
[data-theme="dark"] .btn-default:focus,
[data-theme="dark"] .btn-default:active,
[data-theme="dark"] .btn-default.active,
[data-theme="dark"] .open > .dropdown-toggle.btn-default,
[data-theme="dark"] .btn-default.disabled,
[data-theme="dark"] .btn-default[disabled],
[data-theme="dark"] fieldset[disabled] .btn-default {
  background-color: #21262d !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-theme="dark"] .navbar-toggle,
[data-theme="dark"] .navbar-default .navbar-toggle {
  background-color: #30363d !important;
  border-color: #484f58 !important;
}

[data-theme="dark"] .navbar-default .navbar-toggle .icon-bar {
  background-color: #f0f6fc !important;
}

[data-theme="dark"] .navbar-default .navbar-toggle:hover,
[data-theme="dark"] .navbar-default .navbar-toggle:focus {
  background-color: #484f58 !important;
  border-color: #6e7681 !important;
}

/* Dark Mode Scrollbars */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #0d1117;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 5px;
  border: 2px solid #0d1117;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

[data-theme="dark"] ::-webkit-scrollbar-corner {
  background: #0d1117;
}

/* Firefox scrollbar */
[data-theme="dark"] * {
  scrollbar-color: #30363d #0d1117;
  scrollbar-width: thin;
}

[data-theme="dark"] html,
[data-theme="dark"] body {
  scrollbar-color: #30363d #0d1117;
}

[data-theme="dark"] body .btn-default:hover,
[data-theme="dark"] body .btn-default:focus,
[data-theme="dark"] body .btn-default:active {
  background-color: #30363d !important;
  border-color: #484f58 !important;
  color: #f0f6fc !important;
}

[data-theme="dark"] .form-element label {
  color: #c9d1d9;
}

[data-theme="dark"] legend {
  color: #20c997;
}

[data-theme="dark"] .table-bordered,
[data-theme="dark"] .table-bordered > thead > tr > th,
[data-theme="dark"] .table-bordered > tbody > tr > th,
[data-theme="dark"] .table-bordered > tbody > tr > td {
  border-color: #30363d;
}

[data-theme="dark"] .table.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: #21262d !important;
}

[data-theme="dark"] .table.table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: #161b22 !important;
}

[data-theme="dark"] .nav-tabs > li > a,
[data-theme="dark"] .nav-tabs > li > a:hover,
[data-theme="dark"] .nav-tabs > li > a:focus {
  color: #c9d1d9;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid #20c997;
  margin-bottom: -2px;
}

[data-theme="dark"] .nav-tabs > li > a:hover {
  background-color: #21262d;
}

[data-theme="dark"] .nav-tabs > li.active > a,
[data-theme="dark"] .nav-tabs > li.active > a:hover,
[data-theme="dark"] .nav-tabs > li.active > a:focus {
  background-color: #20c997;
  color: #ffffff !important;
  border: none;
  border-bottom: 2px solid #20c997;
}

[data-theme="dark"] .panel {
  background-color: #21262d;
  border-color: #30363d;
}

[data-theme="dark"] .panel-heading {
  background-color: #161b22;
  border-color: #30363d;
  color: #f0f6fc;
}

[data-theme="dark"] .modal-content {
  background-color: #161b22;
  color: #c9d1d9;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: #30363d;
}

[data-theme="dark"] .modal-footer {
  border-top-color: #30363d;
}

[data-theme="dark"] .alert {
  background-color: #21262d;
  border-color: #30363d;
  color: #c9d1d9;
}

[data-theme="dark"] .pagination > .active > a,
[data-theme="dark"] .pagination > .active > a:focus,
[data-theme="dark"] .pagination > .active > a:hover,
[data-theme="dark"] .pagination > .active > span,
[data-theme="dark"] .pagination > .active > span:focus,
[data-theme="dark"] .pagination > .active > span:hover {
  background-color: #21262d;
  border-color: #20c997;
}

[data-theme="dark"] #skippy {
  background-color: #161b22;
}

/* Headings */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: #f0f6fc;
}

/* Page header border */
[data-theme="dark"] .page-header {
  border-bottom-color: #30363d;
}

/* Form labels */
[data-theme="dark"] .control-label,
[data-theme="dark"] label {
  color: #c9d1d9;
}

/* Validation feedback markers */
[data-theme="dark"] .form-control-feedback {
  color: #f85149;
}

/* Checkbox and radio labels */
[data-theme="dark"] .checkbox label,
[data-theme="dark"] .radio label {
  color: #c9d1d9;
}

/* Modal close button */
[data-theme="dark"] .close {
  color: #f0f6fc;
  opacity: 0.6;
  text-shadow: none;
}

[data-theme="dark"] .close:hover,
[data-theme="dark"] .close:focus {
  color: #f0f6fc;
  opacity: 1;
}

/* Modal title */
[data-theme="dark"] .modal-title {
  color: #f0f6fc;
}

/* Input group (search bars) */
[data-theme="dark"] .input-group-addon {
  background-color: #21262d;
  border-color: #30363d;
  color: #c9d1d9;
}

[data-theme="dark"] .input-group .form-control {
  border-color: #30363d;
}

[data-theme="dark"] .input-group-btn .btn {
  border-color: #30363d;
}

/* Validation summary / error class */
[data-theme="dark"] .error {
  color: #f85149;
}

[data-theme="dark"] .validation-summary-errors {
  color: #f85149;
}

[data-theme="dark"] .validation-summary-errors ul {
  color: #f85149;
}

/* Generic form-control */
[data-theme="dark"] .form-control {
  background-color: #0d1117;
  border-color: #30363d;
  color: #c9d1d9;
}

[data-theme="dark"] .form-control:focus {
  border-color: #20c997;
  box-shadow: 0 0 0 1px #20c997;
}

/* ASP.NET GridView pagination (CSS Adapters) */
[data-theme="dark"] .AspNet-GridView-Pagination a,
[data-theme="dark"] .AspNet-GridView-Bottom a {
  color: #20c997;
}

[data-theme="dark"] .AspNet-GridView-Pagination span,
[data-theme="dark"] .AspNet-GridView-Bottom span {
  color: #f0f6fc;
}

/* ASP.NET DetailsView (CSS Adapters) */
[data-theme="dark"] .AspNet-DetailsView,
[data-theme="dark"] .AspNet-DetailsView-Data {
  background-color: #161b22;
  color: #c9d1d9;
}

[data-theme="dark"] .AspNet-DetailsView-Header {
  background-color: #21262d;
  color: #f0f6fc;
}

/* Fieldset (defensive) */
[data-theme="dark"] fieldset {
  border-color: #30363d;
}

/* File input */
[data-theme="dark"] input[type="file"] {
  color: #c9d1d9;
}

/* Horizontal rule */
[data-theme="dark"] hr {
  border-top-color: #30363d;
}

/* Generic btn-link */
[data-theme="dark"] .btn-link {
  color: #20c997;
}

[data-theme="dark"] .btn-link:hover,
[data-theme="dark"] .btn-link:focus {
  color: #3dd9a8;
}

/* Placeholder text */
[data-theme="dark"] ::-webkit-input-placeholder {
  color: #484f58;
}

[data-theme="dark"] ::-moz-placeholder {
  color: #484f58;
}

[data-theme="dark"] :-ms-input-placeholder {
  color: #484f58;
}

[data-theme="dark"] ::placeholder {
  color: #484f58;
}

/* Disabled form controls */
[data-theme="dark"] .form-control[disabled],
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] fieldset[disabled] .form-control {
  background-color: #21262d;
  color: #484f58;
  border-color: #30363d;
}

/* Theme Toggle - Icon Visibility */
[data-theme="light"] .theme-toggle .theme-icon .icon-sun {
  display: none;
  visibility: hidden;
  opacity: 0;
}

[data-theme="light"] .theme-toggle .theme-icon .icon-moon {
  display: block;
  visibility: visible;
  opacity: 1;
}

[data-theme="dark"] .theme-toggle .theme-icon .icon-sun {
  display: block;
  visibility: visible;
  opacity: 1;
}

[data-theme="dark"] .theme-toggle .theme-icon .icon-moon {
  display: none;
  visibility: hidden;
  opacity: 0;
}

/* Theme Toggle - GPU acceleration for mobile */
.theme-toggle .theme-icon {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: opacity;
}

/* Theme Toggle - Colors */
[data-theme="light"] .theme-toggle {
  color: #fff;
}

[data-theme="light"] .theme-toggle:hover,
[data-theme="light"] .theme-toggle:focus {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .theme-toggle {
  color: #c9d1d9;
}

[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .theme-toggle:focus {
  color: #f0f6fc;
  background-color: rgba(240, 246, 252, 0.1);
}

/* Pagination - non-active links */
[data-theme="dark"] .pagination > li > a,
[data-theme="dark"] .pagination > li > span {
  background-color: #161b22;
  border-color: #30363d;
  color: #20c997;
}

[data-theme="dark"] .pagination > li > a:hover,
[data-theme="dark"] .pagination > li > a:focus {
  background-color: #21262d;
  border-color: #30363d;
  color: #3dd9a8;
}

[data-theme="dark"] .pagination > .disabled > a,
[data-theme="dark"] .pagination > .disabled > a:hover,
[data-theme="dark"] .pagination > .disabled > a:focus,
[data-theme="dark"] .pagination > .disabled > span,
[data-theme="dark"] .pagination > .disabled > span:hover,
[data-theme="dark"] .pagination > .disabled > span:focus {
  background-color: #161b22;
  border-color: #30363d;
  color: #484f58;
}

/* Table base border colors */
[data-theme="dark"] .table > thead > tr > th,
[data-theme="dark"] .table > tbody > tr > th,
[data-theme="dark"] .table > tbody > tr > td,
[data-theme="dark"] .table > tfoot > tr > th,
[data-theme="dark"] .table > tfoot > tr > td {
  border-color: #30363d;
}

[data-theme="dark"] .table > thead > tr > th {
  border-bottom-color: #30363d;
}

[data-theme="dark"] .table > tbody + tbody {
  border-top-color: #30363d;
}

/* Table-responsive mobile border */
[data-theme="dark"] .table-responsive {
  border-color: #30363d;
}

/* Confirmation status label */
[data-theme="dark"] .confirmation {
  color: #3dd9a8;
}

/* Modal backdrop */
[data-theme="dark"] .modal-backdrop {
  background-color: #010409;
}
