:root {
  --kwik-bg: #f4f7fb;
  --kwik-surface: #ffffff;
  --kwik-surface-soft: #f8fafc;
  --kwik-border: #e5e7eb;
  --kwik-text: #0f172a;
  --kwik-label: #334155;
  --kwik-muted: #64748b;
  --kwik-primary: #0ea5e9;
  --kwik-primary-dark: #0284c7;
  --kwik-header-gradient: linear-gradient(90deg, #0ea5e9 0%, #0369a1 100%);
  --kwik-header-gradient-dark: linear-gradient(90deg, #0ea5e9 0%, #075985 100%);
  --kwik-success: #22c55e;
  --kwik-warning: #f59e0b;
  --kwik-danger: #ef4444;
  --kwik-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
  --kwik-radius: 16px;
}

html.kwik-theme-theme {
  background: var(--kwik-bg);
}

html.kwik-theme-theme body:not(.kwik-auth-bg) {
  background: var(--kwik-bg) !important;
  color: var(--kwik-text);
  font-size: 14px;
}

html.kwik-theme-theme .page-wrapper,
html.kwik-theme-theme .page-container,
html.kwik-theme-theme .main-content,
html.kwik-theme-theme .section__content {
  background: transparent !important;
}

html.kwik-theme-dark {
  --kwik-bg: #0f1216;
  --kwik-surface: #1c2128;
  --kwik-surface-soft: #252b33;
  --kwik-border: #3d444d;
  --kwik-text: #e6edf3;
  --kwik-label: #d8dee9;
  --kwik-muted: #adbac7;
  --kwik-primary: #58a6ff;
  --kwik-primary-dark: #388bfd;
  --kwik-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
  background: #0f1216;
}

html.kwik-theme-dark body:not(.kwik-auth-bg) {
  background: #0f1216 !important;
  color: #d8dee9;
  font-size: 14px;
}

html.kwik-theme-dark .page-container,
html.kwik-theme-dark .page-container2 {
  background: #161b22 !important;
}

html.kwik-theme-dark .main-content {
  background: linear-gradient(145deg, #12161c 0%, #1a2028 45%, #12161c 100%) !important;
}

html.kwik-theme-dark .page-wrapper,
html.kwik-theme-dark .section__content {
  background: transparent !important;
}

html.kwik-theme-unix body:not(.kwik-auth-bg) {
  background: #f5f8f2 !important;
  color: #263238;
  font-size: 14px;
}

html.kwik-theme-unix .page-container,
html.kwik-theme-unix .page-container2 {
  background: #f5f8f2 !important;
}

html.kwik-theme-unix .main-content {
  background: linear-gradient(180deg, #f7fbf4 0%, #edf4e6 100%) !important;
}

html.kwik-theme-unix .page-wrapper,
html.kwik-theme-unix .section__content {
  background: transparent !important;
}

.page-container .main-content {
  margin-top: 0;
  padding-top: 0;
}

@media (min-width: 992px) {
  .page-container .main-content {
    /* header-desktop is position:fixed; height:75px (theme.css) */
    padding-top: 85px;
  }
}

.section__content--p30 {
  padding: 24px 28px;
}

.container-fluid {
  max-width: 1440px;
}

.header-desktop {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--kwik-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

/* Desktop sidebar — match mobile drawer: gray main rows, white submenus */
html.kwik-theme-theme .menu-sidebar {
  background: #f8f8f8;
  border-right: 1px solid #e6e6e6;
  box-shadow: 4px 0 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

html.kwik-theme-theme .menu-sidebar .logo {
  background: #e1e1e1;
  border-bottom: 1px solid #e6e6e6;
  height: 78px;
  padding: 14px 22px;
}

html.kwik-theme-theme .menu-sidebar .logo img {
  max-height: 48px;
  object-fit: contain;
  width: auto !important;
}

html.kwik-theme-theme .menu-sidebar__content {
  background: #f8f8f8;
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 0;
}

html.kwik-theme-theme .menu-sidebar__content.kwik-menu-scroll {
  overflow: hidden;
}

html.kwik-theme-theme .navbar-sidebar {
  padding: 0;
  padding-bottom: 0;
}

html.kwik-theme-theme .navbar-sidebar .navbar__list > li > a {
  border-bottom: 1px solid #e6e6e6;
  border-radius: 0;
  color: #555555;
  font-size: 15px;
  line-height: inherit;
  margin: 0;
  padding: 12px 18px;
  text-transform: capitalize;
}

html.kwik-theme-theme .navbar-sidebar .navbar__list li a:hover,
html.kwik-theme-theme .navbar-sidebar .navbar__list > li.active > a {
  background: #f8f8f8;
  color: #4272d7;
}

html.kwik-theme-theme .navbar-sidebar .navbar__list li a i {
  margin-right: 19px;
  min-width: 22px;
}

html.kwik-theme-theme .navbar-sidebar .navbar__list li a i:not(.kwik-menu-icon) {
  color: inherit !important;
}

html.kwik-theme-theme .navbar-sidebar .navbar__list li a i.kwik-menu-icon,
html.kwik-theme-theme .navbar-sidebar .navbar__list li a:hover i.kwik-menu-icon,
html.kwik-theme-theme .navbar-sidebar .navbar__list > li.active > a i.kwik-menu-icon,
.header-mobile .navbar-mobile .navbar-mobile__list li a i.kwik-menu-icon,
.header-mobile .navbar-mobile .navbar-mobile-sub__list li a i.kwik-menu-icon,
.header-mobile .navbar-mobile .navbar-mobile__list li a:hover i.kwik-menu-icon,
.header-mobile .navbar-mobile .navbar-mobile__list > li.active > a i.kwik-menu-icon {
  color: var(--kwik-menu-icon-color, inherit) !important;
}

html.kwik-theme-theme .menu-sidebar .navbar__list .navbar__sub-list {
  background: #ffffff;
  border-radius: 0;
  display: none;
  margin: 0;
  padding-left: 0;
}

html.kwik-theme-theme .menu-sidebar .navbar__list li.has-sub > a .fa-caret-down {
  color: #888888 !important;
  float: right;
  margin-top: 3px;
  transition: transform 0.2s ease;
}

html.kwik-theme-theme .menu-sidebar .navbar__list li.has-sub > a.open .fa-caret-down {
  transform: rotate(180deg);
}

html.kwik-theme-theme .menu-sidebar .navbar__list .navbar__sub-list li a {
  background: #ffffff;
  border-bottom: 1px solid #e6e6e6;
  color: #555555;
  font-size: 14px;
  padding: 10px 18px 10px 34px !important;
}

html.kwik-theme-theme .menu-sidebar .navbar__list .navbar__sub-list li a:hover,
html.kwik-theme-theme .menu-sidebar .navbar__list .navbar__sub-list li.active > a {
  background: #ffffff;
  color: #4272d7;
}

.card,
.au-card,
.widget {
  background: var(--kwik-surface);
  border: 1px solid var(--kwik-border);
  border-radius: var(--kwik-radius) !important;
  box-shadow: var(--kwik-shadow);
  overflow: hidden;
}

.card-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--kwik-border);
  color: var(--kwik-text);
  font-weight: 700;
  padding: 14px 18px;
}

.page-wrapper .card > .card-header .card-header-text i.fa,
.page-wrapper .card > .card-header .card-header-text i[class*="fa-"] {
  display: inline-block;
  font-size: 2em;
  line-height: 1;
  margin-right: 0.25em;
  vertical-align: -0.15em;
}

.card-body {
  padding: 18px;
}

.title-1,
.title-2,
.title-3,
.title-4,
.title-5,
h1,
h2,
h3,
h4,
h5,
h6,
.card-header-text,
.card-header-text strong {
  color: var(--kwik-text);
}

.text-muted,
small.text-muted,
.form-text,
small,
.small,
p.text-muted {
  color: var(--kwik-muted) !important;
}

.form-control,
.au-input,
select.form-control,
textarea.form-control {
  background-color: var(--kwik-surface);
  border: 1px solid var(--kwik-border) !important;
  border-radius: 10px !important;
  color: var(--kwik-text);
  font-size: 14px;
  min-height: 38px;
  padding: 8px 11px;
}

.form-control:focus,
.au-input:focus {
  border-color: var(--kwik-primary) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15) !important;
}

label,
.control-label {
  color: var(--kwik-label);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.btn {
  border-radius: 999px !important;
  font-weight: 600;
  padding: 7px 14px;
}

.btn-sm {
  font-size: 12px;
  padding: 5px 11px;
}

/* Legacy markup: btn-sm + color class without base .btn */
a.btn-sm.btn-primary,
a.btn-sm.btn-success,
a.btn-sm.btn-warning,
a.btn-sm.btn-danger,
a.btn-sm.btn-info,
a.btn-sm.btn-secondary,
a.btn-sm.btn-outline-primary,
a.btn-sm.btn-outline-secondary,
a.btn-sm.btn-outline-danger,
a.btn-sm.btn-outline-warning,
a.btn-sm.btn-outline-success,
button.btn-sm.btn-primary,
button.btn-sm.btn-success,
button.btn-sm.btn-warning,
button.btn-sm.btn-danger,
button.btn-sm.btn-info,
button.btn-sm.btn-secondary {
  border-radius: 999px !important;
  display: inline-block;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
}

label.switch.switch-sm {
  height: 22px;
  width: 40px;
}

label.switch.switch-sm .slider:before {
  bottom: 3px;
  height: 16px;
  left: 3px;
  width: 16px;
}

label.switch.switch-sm input:checked + .slider:before {
  transform: translateX(18px);
}

label.switch.switch-sm .slider.round {
  border-radius: 22px;
}

/* Vertical rhythm for multi-row forms (e.g. inv_new). */
.card-body form > .row.mb-4,
.card-body form > .row.mb-3 {
  margin-bottom: 1.75rem !important;
}

.card-body form > .row.mb-3 {
  margin-bottom: 1.25rem !important;
}

.kwik-inv-lines-list {
  margin-top: 0.25rem;
}

.kwik-inv-lines-list > .kwik-inv-line-item {
  margin-bottom: 1.75rem !important;
}

.kwik-inv-lines-list > .kwik-inv-line-item + .kwik-inv-line-item {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  padding-top: 1.75rem;
}

html.kwik-theme-dark .kwik-inv-line-item + .kwik-inv-line-item {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.kwik-inv-lines-actions {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

html.kwik-theme-dark .kwik-inv-lines-actions {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* Standard checkbox size (toggle switches stay hidden inside label.switch). */
label.switch input[type="checkbox"] {
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

.page-wrapper input[type="checkbox"],
.page-container input[type="checkbox"] {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  cursor: pointer;
  vertical-align: middle;
}

.page-wrapper input[type="checkbox"].checkbox-lg.larger,
.page-container input[type="checkbox"].checkbox-lg.larger {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
}

/* Bootstrap .form-check uses absolute positioning; reset for large app checkboxes. */
.page-wrapper .form-check,
.page-container .form-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 32px;
  padding-left: 0 !important;
}

.page-wrapper .form-check .form-check-input,
.page-container .form-check .form-check-input {
  position: static !important;
  float: none !important;
  margin: 0 !important;
  flex-shrink: 0;
}

.page-wrapper .form-check .form-check-label,
.page-container .form-check .form-check-label {
  padding-left: 0 !important;
  margin-bottom: 0;
  line-height: 1.4;
}

.page-wrapper .form-check-inline.form-check,
.page-container .form-check-inline.form-check {
  display: inline-flex;
}

.page-wrapper .form-check-inline.form-check .form-check-label,
.page-container .form-check-inline.form-check .form-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary,
.btn-info,
.btn-success,
.btn-danger {
  color: #ffffff !important;
}

.btn-primary,
.btn-info {
  background: var(--kwik-primary) !important;
  border-color: var(--kwik-primary) !important;
}

.btn-primary:hover,
.btn-info:hover {
  background: var(--kwik-primary-dark) !important;
  border-color: var(--kwik-primary-dark) !important;
  color: #ffffff !important;
}

.btn-success {
  background: var(--kwik-success) !important;
  border-color: var(--kwik-success) !important;
}

.btn-success:hover {
  color: #ffffff !important;
}

.btn-warning {
  background: var(--kwik-warning) !important;
  border-color: var(--kwik-warning) !important;
  color: #111827 !important;
}

.btn-danger {
  background: var(--kwik-danger) !important;
  border-color: var(--kwik-danger) !important;
}

.btn-danger:hover {
  color: #ffffff !important;
}

.btn-secondary,
.btn-outline-secondary {
  border-color: #cbd5e1 !important;
}

.table {
  background: var(--kwik-surface);
  border-collapse: separate;
  border-spacing: 0;
  color: var(--kwik-text);
  font-size: 13px;
}

.table thead td,
.table thead th {
  background: var(--kwik-surface-soft);
  border-bottom: 1px solid var(--kwik-border) !important;
  color: var(--kwik-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.table td,
.table th {
  border-top: 1px solid var(--kwik-border) !important;
  vertical-align: middle !important;
}

html.kwik-theme-theme .table-striped tbody tr:nth-of-type(odd) {
  background-color: #fbfdff;
}

html.kwik-theme-theme .table-hover tbody tr:hover,
html.kwik-theme-theme .table-striped tbody tr:hover {
  background-color: #eef8ff;
}

.alert {
  border-radius: 14px;
  border-width: 1px;
}

.badge {
  border-radius: 999px;
  font-weight: 600;
  padding: 5px 8px;
}

.modal-content {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
}

.modal-header,
.modal-footer {
  border-color: var(--kwik-border);
}

.select2-container--default .select2-selection--single {
  border: 1px solid #d7dee8;
  border-radius: 10px;
  min-height: 38px;
}

.overview-item {
  background: linear-gradient(0deg, rgba(0, 177, 255, 1) 0%, rgba(0, 0, 0, 1) 100%) !important;
  border: none;
  border-radius: var(--kwik-radius) !important;
  box-shadow: var(--kwik-shadow);
  color: #ffffff;
  margin-bottom: 16px;
  overflow: hidden;
  padding: 0;
}

.overview__inner {
  padding: 14px 16px 12px;
}

.overview__inner > br {
  display: none;
}

.overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.overview-box {
  align-items: center;
  display: flex;
  gap: 12px;
}

.overview-box .icon {
  flex-shrink: 0;
  margin-right: 0;
}

.overview-box .icon i {
  align-items: center;
  border-radius: 12px;
  color: #ffffff !important;
  display: inline-flex;
  font-size: 22px;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.overview-item--c1 .overview-box .icon i {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.overview-item--c2 .overview-box .icon i {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.overview-item--c3 .overview-box .icon i {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

html.kwik-theme-theme .overview-item--c4 .overview-box .icon i,
html.kwik-theme-dark .overview-item--c4 .overview-box .icon i {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

html.kwik-theme-unix .overview-item--c4 .overview-box .icon i {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.row.m-t-25 > .col-lg-3:nth-child(4) .overview-box .icon i {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.overview-box .text {
  min-width: 0;
}

.overview-box .text h2 {
  color: #ffffff;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 2px;
}

.overview-box .text span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.3;
}

@media (min-width: 992px) and (max-width: 1199px) {
  .overview-box .icon i {
    font-size: 18px;
    height: 38px;
    width: 38px;
  }

  .overview-box .text h2 {
    font-size: 22px;
  }
}

#return-to-top {
  background: var(--kwik-primary) !important;
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.28);
}

@media (max-width: 991px) {
  .header-desktop {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: none !important;
    border: none !important;
  }

  .page-container .main-content {
    padding-top: 12px;
  }

  .section__content--p30 {
    padding: 18px 14px;
  }

  .card-body {
    padding: 15px;
  }
}

.header-mobile .logo img,
.header-mobile .kwik-mobile-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.header-mobile .header-mobile__bar {
  padding: 10px 0;
}

.navbar-mobile .kwik-mobile-account > a.js-arrow {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 6px;
  padding-top: 14px;
}

.navbar-mobile .kwik-mobile-account-meta {
  display: block;
  line-height: 1.4;
  padding: 10px 20px 6px;
  pointer-events: none;
}

.navbar-mobile .kwik-mobile-account-role {
  color: #94a3b8;
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.navbar-mobile .kwik-mobile-account-company {
  color: #cbd5e1;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

/* --- Dark theme: restore readable text and surfaces (app.css loads after dark.css) --- */
html.kwik-theme-dark .header-desktop {
  background: #1c2128 !important;
  border-bottom-color: var(--kwik-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html.kwik-theme-dark .menu-sidebar {
  background: #2d333b !important;
  border-right: 1px solid #3d444d !important;
  box-shadow: 4px 0 18px rgba(0, 0, 0, 0.35);
}

html.kwik-theme-dark .menu-sidebar .logo {
  background: #252b33 !important;
  border-bottom: 1px solid #3d444d !important;
}

html.kwik-theme-dark .menu-sidebar__content {
  background: #2d333b !important;
  padding: 0 !important;
}

html.kwik-theme-dark .navbar-sidebar {
  padding: 0 !important;
}

html.kwik-theme-dark .navbar-sidebar .navbar__list > li > a {
  background: #2d333b;
  border-bottom: 1px solid #3d444d;
  border-radius: 0;
  color: #c9d1d9 !important;
  margin: 0;
  padding: 12px 18px;
}

html.kwik-theme-dark .navbar-sidebar .navbar__list li a:hover,
html.kwik-theme-dark .navbar-sidebar .navbar__list > li.active > a {
  background: #2d333b !important;
  color: #58a6ff !important;
}

html.kwik-theme-dark .navbar-sidebar .navbar__list li a i:not(.kwik-menu-icon) {
  color: inherit !important;
}

html.kwik-theme-dark .navbar-sidebar .navbar__list li a i.kwik-menu-icon,
html.kwik-theme-dark .navbar-sidebar .navbar__list li a:hover i.kwik-menu-icon,
html.kwik-theme-dark .navbar-sidebar .navbar__list > li.active > a i.kwik-menu-icon,
html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile__list li a i.kwik-menu-icon,
html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile-sub__list li a i.kwik-menu-icon,
html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile__list li a:hover i.kwik-menu-icon,
html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile__list > li.active > a i.kwik-menu-icon {
  color: var(--kwik-menu-icon-color, inherit) !important;
}

html.kwik-theme-dark .menu-sidebar .navbar__list li.has-sub > a .fa-caret-down {
  color: #8b949e !important;
}

html.kwik-theme-dark .menu-sidebar .navbar__list .navbar__sub-list {
  background: #000000 !important;
  padding-left: 0 !important;
}

html.kwik-theme-dark .menu-sidebar .navbar__list .navbar__sub-list li a {
  background: #000000 !important;
  border-bottom: 1px solid #1f1f1f;
  color: #adbac7 !important;
  padding: 10px 18px 10px 34px !important;
}

html.kwik-theme-dark .menu-sidebar .navbar__list .navbar__sub-list li a:hover,
html.kwik-theme-dark .menu-sidebar .navbar__list .navbar__sub-list li.active > a {
  background: #000000 !important;
  color: #58a6ff !important;
}

html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile__list {
  background: #2d333b !important;
}

html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile__list li a {
  background: #2d333b;
  border-bottom-color: #3d444d;
  color: #c9d1d9;
}

html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile__list li a:hover,
html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile__list > li.active > a {
  color: #58a6ff;
}

html.kwik-theme-dark .navbar-mobile-sub__list {
  background: #000000 !important;
}

html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile-sub__list li a {
  background: #000000 !important;
  border-bottom-color: #1f1f1f;
  color: #adbac7;
}

html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile-sub__list li a:hover,
html.kwik-theme-dark .header-mobile .navbar-mobile .navbar-mobile-sub__list li.active > a {
  color: #58a6ff;
}

html.kwik-theme-dark .navbar-mobile .kwik-mobile-account > a.js-arrow {
  border-top-color: #3d444d;
}

html.kwik-theme-dark .navbar-mobile .kwik-mobile-account-role {
  color: #8b949e;
}

html.kwik-theme-dark .navbar-mobile .kwik-mobile-account-company {
  color: #adbac7;
}

html.kwik-theme-unix .menu-sidebar__content {
  background: #eef4e7 !important;
  padding: 0 !important;
}

html.kwik-theme-unix .navbar-sidebar {
  padding: 0 !important;
}

html.kwik-theme-unix .navbar-sidebar .navbar__list > li > a {
  border-bottom: 1px solid #c7d3be;
  border-radius: 0;
  margin: 0;
  padding: 12px 18px;
}

html.kwik-theme-unix .menu-sidebar .navbar__list .navbar__sub-list {
  background: #ffffff !important;
  padding-left: 0 !important;
}

html.kwik-theme-unix .menu-sidebar .navbar__list .navbar__sub-list li a {
  background: #ffffff !important;
  border-bottom: 1px solid #c7d3be;
  padding: 10px 18px 10px 34px !important;
}

html.kwik-theme-dark .card,
html.kwik-theme-dark .au-card,
html.kwik-theme-dark .widget {
  background: var(--kwik-surface) !important;
  border-color: var(--kwik-border) !important;
  color: var(--kwik-text);
}

html.kwik-theme-dark .overview-item {
  background: linear-gradient(0deg, rgba(0, 177, 255, 1) 0%, rgba(0, 0, 0, 1) 100%) !important;
  border: none !important;
  color: #ffffff;
}

html.kwik-theme-theme .page-wrapper .card > .card-header {
  background: var(--kwik-header-gradient) !important;
  border-bottom: 0 !important;
  color: #ffffff !important;
}

html.kwik-theme-theme .page-wrapper .card > .card-header .card-header-text,
html.kwik-theme-theme .page-wrapper .card > .card-header strong,
html.kwik-theme-theme .page-wrapper .card > .card-header a {
  color: #ffffff !important;
}

html.kwik-theme-theme .page-wrapper .card > .card-header a:hover {
  color: rgba(255, 255, 255, 0.9) !important;
}

html.kwik-theme-theme .btn-success,
html.kwik-theme-dark .btn-success {
  background: var(--kwik-primary) !important;
  border-color: var(--kwik-primary) !important;
  color: #ffffff !important;
}

html.kwik-theme-theme .btn-success:hover,
html.kwik-theme-dark .btn-success:hover {
  background: var(--kwik-primary-dark) !important;
  border-color: var(--kwik-primary-dark) !important;
  color: #ffffff !important;
}

html.kwik-theme-theme .au-btn--green,
html.kwik-theme-dark .au-btn--green {
  background: var(--kwik-primary) !important;
}

html.kwik-theme-theme .au-btn--green:hover,
html.kwik-theme-dark .au-btn--green:hover {
  background: var(--kwik-primary-dark) !important;
}

html.kwik-theme-theme .dot--green,
html.kwik-theme-dark .dot--green {
  background: var(--kwik-primary) !important;
}

html.kwik-theme-theme .statistic__item--green,
html.kwik-theme-dark .statistic__item--green {
  background: var(--kwik-primary) !important;
}

html.kwik-theme-theme .badge-success,
html.kwik-theme-dark .badge-success {
  background-color: var(--kwik-primary) !important;
}

html.kwik-theme-theme .text-success,
html.kwik-theme-dark .text-success {
  color: var(--kwik-primary) !important;
}

html.kwik-theme-theme .alert-success {
  background-color: rgba(14, 165, 233, 0.12) !important;
  border-color: rgba(14, 165, 233, 0.35) !important;
  color: #0369a1 !important;
}

html.kwik-theme-dark .alert-success {
  background-color: rgba(14, 165, 233, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #7dd3fc !important;
}

html.kwik-theme-dark .card-header,
html.kwik-theme-dark .page-wrapper .card > .card-header {
  background: var(--kwik-header-gradient-dark) !important;
  border-bottom-color: var(--kwik-border) !important;
  color: #f0f6fc !important;
}

html.kwik-theme-dark .card-body,
html.kwik-theme-dark .card-body p,
html.kwik-theme-dark .tab-content,
html.kwik-theme-dark .default-tab {
  color: var(--kwik-text);
}

html.kwik-theme-dark .form-control,
html.kwik-theme-dark .au-input,
html.kwik-theme-dark select.form-control,
html.kwik-theme-dark textarea.form-control,
html.kwik-theme-dark .custom-select {
  background-color: #22272e !important;
  border-color: var(--kwik-border) !important;
  color: var(--kwik-text) !important;
}

html.kwik-theme-dark .form-control:focus,
html.kwik-theme-dark .au-input:focus,
html.kwik-theme-dark select.form-control:focus,
html.kwik-theme-dark textarea.form-control:focus {
  background-color: #1c2128 !important;
  border-color: var(--kwik-primary) !important;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2) !important;
  color: var(--kwik-text) !important;
}

html.kwik-theme-dark .form-control::placeholder,
html.kwik-theme-dark .au-input::placeholder {
  color: #768390 !important;
}

html.kwik-theme-dark .table {
  background: var(--kwik-surface);
  color: var(--kwik-text);
}

html.kwik-theme-dark .table thead td,
html.kwik-theme-dark .table thead th {
  background: var(--kwik-surface-soft) !important;
  border-bottom-color: var(--kwik-border) !important;
  color: var(--kwik-muted) !important;
}

html.kwik-theme-dark .table td,
html.kwik-theme-dark .table th {
  border-top-color: var(--kwik-border) !important;
  color: var(--kwik-text);
}

html.kwik-theme-dark .table-striped > tbody > tr:nth-of-type(odd),
html.kwik-theme-dark .table-striped tbody tr:nth-of-type(odd) {
  background-color: #181d24 !important;
}

html.kwik-theme-dark .table-striped > tbody > tr:nth-of-type(even),
html.kwik-theme-dark .table-striped tbody tr:nth-of-type(even) {
  background-color: #22272e !important;
}

html.kwik-theme-dark .table-striped > tbody > tr:nth-of-type(odd) > td,
html.kwik-theme-dark .table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: #181d24 !important;
  color: var(--kwik-text) !important;
}

html.kwik-theme-dark .table-striped > tbody > tr:nth-of-type(even) > td,
html.kwik-theme-dark .table-striped > tbody > tr:nth-of-type(even) > th {
  background-color: #22272e !important;
  color: var(--kwik-text) !important;
}

html.kwik-theme-dark .table-hover tbody tr:hover,
html.kwik-theme-dark .table-striped tbody tr:hover {
  background-color: #2a313a !important;
}

html.kwik-theme-dark .table-hover tbody tr:hover > td,
html.kwik-theme-dark .table-hover tbody tr:hover > th,
html.kwik-theme-dark .table-striped tbody tr:hover > td,
html.kwik-theme-dark .table-striped tbody tr:hover > th {
  background-color: #2a313a !important;
  color: var(--kwik-text) !important;
}

html.kwik-theme-dark .nav-tabs {
  border-bottom-color: var(--kwik-border);
}

html.kwik-theme-dark .nav-tabs .nav-link {
  border-color: transparent;
  color: var(--kwik-muted);
}

html.kwik-theme-dark .nav-tabs .nav-link:hover {
  border-color: var(--kwik-border) var(--kwik-border) transparent;
  color: var(--kwik-text);
}

html.kwik-theme-dark .nav-tabs .nav-link.active {
  background-color: var(--kwik-surface);
  border-color: var(--kwik-border) var(--kwik-border) var(--kwik-surface);
  color: var(--kwik-text);
}

html.kwik-theme-dark .select2-container--default .select2-selection--single {
  background-color: #22272e;
  border-color: var(--kwik-border);
  color: var(--kwik-text);
}

html.kwik-theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--kwik-text);
}

html.kwik-theme-dark .select2-dropdown {
  background-color: #2d333b;
  border-color: var(--kwik-border);
  color: var(--kwik-text);
}

html.kwik-theme-dark .select2-container--default .select2-results__option {
  color: var(--kwik-text);
}

html.kwik-theme-dark .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--kwik-primary);
  color: #ffffff;
}

html.kwik-theme-dark .modal-content {
  background-color: var(--kwik-surface);
  color: var(--kwik-text);
}

html.kwik-theme-dark .modal-header,
html.kwik-theme-dark .modal-footer {
  border-color: var(--kwik-border);
}

html.kwik-theme-dark a:not(.btn):not(.nav-link) {
  color: var(--kwik-primary);
}

html.kwik-theme-dark a:not(.btn):not(.nav-link) > .btn,
html.kwik-theme-dark a.btn.btn-primary,
html.kwik-theme-dark a.btn.btn-info,
html.kwik-theme-dark a.btn.btn-success,
html.kwik-theme-dark a.btn.btn-danger,
html.kwik-theme-dark button.btn.btn-primary,
html.kwik-theme-dark button.btn.btn-info,
html.kwik-theme-dark button.btn.btn-success,
html.kwik-theme-dark button.btn.btn-danger {
  color: #ffffff !important;
}

html.kwik-theme-dark .overview-box .text h2 {
  color: #ffffff;
}

html.kwik-theme-dark .overview-box .text span {
  color: rgba(255, 255, 255, 0.82);
}

html.kwik-theme-dark .btn-secondary,
html.kwik-theme-dark .btn-outline-secondary {
  background-color: #2d333b;
  border-color: var(--kwik-border) !important;
  color: var(--kwik-text) !important;
}

.noti__item .quantity.kwik-support-badge {
  min-width: 15px;
  width: auto;
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
}

/* Receipt storage meter (sidebar + mobile menu) */
.menu-sidebar--with-meter {
  display: flex;
  flex-direction: column;
}

.menu-sidebar--with-meter .menu-sidebar__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.kwik-storage-meter-wrap {
  flex-shrink: 0;
  margin-top: auto;
  padding: 14px 20px 18px;
  border-top: 1px solid #e6e6e6;
  background: #f8f8f8;
  text-align: center;
}

.kwik-storage-meter-wrap--mobile {
  padding: 16px 18px 22px;
  border-top: 1px solid #e6e6e6;
  background: #fff;
}

.kwik-storage-meter {
  display: inline-block;
  max-width: 220px;
  width: 100%;
  margin: 0 auto;
}

.kwik-storage-meter--mobile {
  max-width: 280px;
}

.kwik-storage-meter__label {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.kwik-storage-meter__track {
  background: #e2e8f0;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  width: 100%;
}

.kwik-storage-meter__fill {
  background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 100%);
  border-radius: 999px;
  height: 100%;
  max-width: 100%;
  transition: width 0.35s ease;
}

.kwik-storage-meter--warn .kwik-storage-meter__fill {
  background: linear-gradient(90deg, #b45309 0%, #f59e0b 100%);
}

.kwik-storage-meter--danger .kwik-storage-meter__fill {
  background: linear-gradient(90deg, #b91c1c 0%, #ef4444 100%);
}

.kwik-storage-meter__meta {
  color: #334155;
  display: flex;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 4px;
  justify-content: center;
  margin-top: 7px;
}

.kwik-storage-meter__sep {
  color: #94a3b8;
  font-weight: 400;
}

html.kwik-theme-dark .kwik-storage-meter-wrap,
html.kwik-theme-dark .kwik-storage-meter-wrap--mobile {
  background: #1e2228;
  border-top-color: #2d333b;
}

html.kwik-theme-dark .kwik-storage-meter__label {
  color: #94a3b8;
}

html.kwik-theme-dark .kwik-storage-meter__track {
  background: #2d333b;
}

html.kwik-theme-dark .kwik-storage-meter__meta {
  color: #e2e8f0;
}

/* SweetAlert2 flash toasts — above fixed header / modals */
.swal2-container.kwik-flash-container {
  z-index: 100200 !important;
}

/* Simple UI mode */
.kwik-ui-mode-toggle .btn-group .btn {
  font-weight: 600;
  min-width: 5.5rem;
}

/* Topbar: align support envelope with Simple/Complete toggle */
.header-button .kwik-ui-mode-toggle-wrap,
.header-button .noti-wrap,
.header-button .account-wrap {
  display: inline-flex;
  align-items: center;
  align-self: center;
  vertical-align: middle;
}

.header-button .noti-wrap {
  height: auto;
}

.header-button .noti-wrap .noti__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-bottom: 0;
}

.header-button .noti-wrap .noti__item i {
  font-size: 1.35rem;
  line-height: 1;
  vertical-align: middle;
}

.kwik-ui-mode-toggle--mobile .btn-group {
  width: 100%;
}

.kwik-ui-mode-toggle--mobile .btn-group .btn {
  width: 50%;
}

html.kwik-ui-simple .overview-item .overview-actions .btn-sm {
  padding: 0.35rem 0.75rem;
}

html.kwik-ui-simple .kwik-dash-simple-table th,
html.kwik-ui-simple .kwik-dash-simple-table td {
  font-size: 1rem;
  vertical-align: middle;
}

html.kwik-ui-simple .menu-sidebar.menu-sidebar--with-meter .menu-sidebar__content {
  max-height: calc(100vh - 120px);
}

/* Invoice / quote line entry: tools, catalog search, discounted price cue */
.kwik-line-tools {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.25rem;
  vertical-align: middle;
  max-width: 100%;
}

.kwik-line-tools .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  min-width: 1.85rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 0.2rem;
}

.kwik-line-tools .btn i {
  font-size: 0.8125rem;
  margin: 0;
}

.kwik-inv-line-tools-col {
  flex: 0 0 auto;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.kwik-catalog-search-panel {
  border: 1px solid var(--kwik-border, #969696);
  padding: 12px;
}

#livesearch {
  max-height: 420px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.35;
  word-break: break-word;
}

#livesearch a {
  display: block;
  padding: 0.2rem 0;
}

.form-control.kwik-line-price-discounted,
input.form-control.kwik-line-price-discounted {
  background-color: #e8f4fc !important;
  border-color: #b8daf0 !important;
}

.form-control.kwik-line-price-discounted:focus,
input.form-control.kwik-line-price-discounted:focus {
  background-color: #e8f4fc !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2) !important;
}

html.kwik-theme-dark .form-control.kwik-line-price-discounted,
html.kwik-theme-dark input.form-control.kwik-line-price-discounted {
  background-color: rgba(56, 189, 248, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

html.kwik-theme-dark .form-control.kwik-line-price-discounted:focus,
html.kwik-theme-dark input.form-control.kwik-line-price-discounted:focus {
  background-color: rgba(56, 189, 248, 0.22) !important;
}
