:root {
  --brand-bg: #0b1b38;
  --brand-accent: #2563eb;
  --brand-accent-2: #1d4ed8;
  --action-bg: #1f6fff;
  --action-bg-2: #1559e6;
  --action-text: #ffffff;

  --app-bg: #f4f7fb;
  --app-surface: #ffffff;
  --app-surface-2: #eef4fb;
  --app-stroke: #e6edf6;
  --app-text: #111827;
  --app-muted: #6b7280;

  --shadow: 0 12px 34px rgba(2, 6, 23, 0.1);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --sidebar-width: 252px;

  color-scheme: light;
}

html[data-bs-theme="dark"] {
  --app-bg: #071225;
  --app-surface: rgba(255, 255, 255, 0.06);
  --app-surface-2: rgba(255, 255, 255, 0.04);
  --app-stroke: rgba(255, 255, 255, 0.1);
  --app-text: #eaf2ff;
  --app-muted: rgba(234, 242, 255, 0.7);

  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --action-bg: #5aa2ff;
  --action-bg-2: #2f7ee8;
  --action-text: #ffffff;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--app-text);
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(37, 99, 235, 0.1), transparent 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(16, 185, 129, 0.07), transparent 55%),
    var(--app-bg);
}

h1,
h2,
h3,
h4,
h5,
h6,
.erp-title,
.erp-brand-title,
.nav-pill-erp,
.btn,
.table thead th {
  font-family: var(--font-head);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: -0.02em;
  font-weight: 800;
}

h2 {
  font-size: 1.28rem;
}

h3 {
  font-size: 1.08rem;
}

h4 {
  font-size: 0.98rem;
}

h5 {
  font-size: 0.9rem;
}

h6 {
  font-size: 0.8rem;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

aside.erp-sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1035;
  min-height: 100vh;
  overflow-y: auto;
  color: rgba(255, 255, 255, 0.92);
  background: radial-gradient(1200px 900px at 18% 12%, #0f67c4 0%, #004b97 46%, #00366d 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.erp-brand {
  display: flex;
  align-items: center;
  padding: 0.9rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.erp-logo-wrap {
  padding: 0.2rem 0.1rem;
}

html[data-bs-theme="light"] aside.erp-sidebar .erp-logo-wrap,
html[data-bs-theme="light"] .offcanvas.erp-sidebar .erp-logo-wrap {
  margin: 0.45rem -1rem 0.85rem !important;
  padding: 1rem 1rem 0.95rem;
  background: radial-gradient(1100px 300px at 8% 10%, #00244d 0%, #003f84 46%, #1b72cf 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

aside.erp-sidebar nav {
  margin-top: 1.2rem;
}

.offcanvas.erp-sidebar nav {
  margin-top: 0;
}

.erp-logo-img {
  display: block;
  width: 100%;
  max-width: 112px;
  height: auto;
  margin: 0 auto;
}

.erp-brand-title {
  font-size: 0.96rem;
  font-weight: 900;
}

.erp-brand-sub,
.erp-user {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.erp-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-accent), #b4f36b);
  box-shadow: 0 18px 28px rgba(149, 208, 73, 0.18);
}

.nav-pill-erp {
  display: flex;
  align-items: center;
  gap: 0.52rem;
  border-radius: 16px;
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px) saturate(120%);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.14);
  transition: 0.12s ease;
}

.nav-pill-icon {
  width: 1.2rem;
  text-align: center;
  font-size: 0.95rem;
}

.nav-pill-label {
  line-height: 1;
}

.nav-pill-erp:hover,
.nav-pill-erp:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
}

.nav-pill-erp.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
}

.nav-pill-group {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.nav-group-caret {
  margin-left: auto;
  font-size: 0.82rem;
  line-height: 1;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.nav-group {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px) saturate(120%);
  padding: 0.3rem;
}

.nav-group > .nav-pill-group {
  border: none;
  box-shadow: none;
  background: transparent;
}

.nav-group-children {
  margin-top: 0.3rem;
  padding: 0;
  border: none;
  background: transparent;
}

.nav-pill-nested {
  min-height: 38px;
  margin-top: 0.25rem;
  margin-left: 0.35rem;
  margin-right: 0.15rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
}

.js-nav-group-toggle[aria-expanded="true"] .nav-group-caret {
  transform: rotate(180deg);
}

.main-panel {
  flex: 1;
  overflow-x: hidden;
  padding-top: 76px;
  margin-left: var(--sidebar-width);
}

.erp-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 1040;
  backdrop-filter: blur(12px);
  background: rgba(215, 227, 244, 0.95);
  border-bottom: 1px solid var(--app-stroke);
  min-height: 66px;
}

.erp-title {
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.erp-subtitle {
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

main > .container-fluid,
main > .container {
  padding: 1rem 1rem 1.2rem !important;
}

@media (min-width: 992px) {
  main > .container-fluid,
  main > .container {
    padding: 1.25rem 1.4rem 1.5rem !important;
  }
}

.btn {
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: -0.01em;
  padding: 0.44rem 0.9rem;
  min-height: 36px;
  font-size: 0.82rem;
}

.btn-sm {
  min-height: 30px;
  padding: 0.26rem 0.62rem;
  font-size: 0.76rem;
}

.btn-erp,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger,
.btn-secondary {
  border: 1px solid var(--app-stroke) !important;
  background: var(--app-surface) !important;
  color: var(--app-text) !important;
  box-shadow: var(--shadow-soft);
}

.btn-erp-primary,
.btn-primary {
  border: 1px solid color-mix(in oklab, var(--action-bg), black 12%) !important;
  background: linear-gradient(180deg, var(--action-bg), var(--action-bg-2)) !important;
  color: var(--action-text) !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
  box-shadow: 0 8px 20px color-mix(in oklab, var(--action-bg), transparent 70%);
}

.btn-erp-danger,
.btn-danger {
  border: 1px solid color-mix(in oklab, #dc2626, black 12%) !important;
  background: linear-gradient(180deg, #ef4444, #dc2626) !important;
  color: #fff !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

.btn-erp-danger:hover,
.btn-danger:hover,
.btn-erp-danger:focus,
.btn-danger:focus {
  color: #fff !important;
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn:hover {
  filter: brightness(1.06);
}

.btn-erp-primary:hover,
.btn-primary:hover,
.btn-erp-primary:focus,
.btn-primary:focus {
  color: var(--action-text) !important;
  transform: translateY(-1px);
}

.card {
  border-radius: 20px;
  border: 1px solid var(--app-stroke);
  background: var(--app-surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--app-stroke);
}

.card .card-body {
  padding: 1rem;
}

.form-control,
.form-select,
textarea {
  border-radius: 12px;
  border: 1px solid var(--app-stroke);
  background: var(--app-surface);
  color: var(--app-text);
  font-weight: 500;
  font-size: 0.83rem;
}

.erp-header-search {
  width: 100%;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.erp-header-search-wrap {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0.35rem;
}

.search-input {
  padding-right: 2.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6.5' fill='none' stroke='%2364748b' stroke-width='2'/%3E%3Cpath d='M16.2 16.2L21 21' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 14px 14px;
}

html[data-bs-theme="dark"] .search-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6.5' fill='none' stroke='rgba(234,242,255,0.72)' stroke-width='2'/%3E%3Cpath d='M16.2 16.2L21 21' fill='none' stroke='rgba(234,242,255,0.72)' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.form-select {
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 10px 6px;
}

html[data-bs-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-opacity='0.75' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.form-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: color-mix(in oklab, var(--brand-accent), transparent 40%);
  box-shadow: 0 0 0 0.2rem color-mix(in oklab, var(--brand-accent), transparent 84%);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--app-text);
  --bs-table-border-color: var(--app-stroke);
  margin-bottom: 0;
}

.table thead th {
  font-size: 0.66rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--app-muted);
  border-bottom: 1px solid var(--app-stroke);
}

.table tbody tr:hover td {
  background: transparent !important;
}

.table tbody tr.is-editing td {
  background: color-mix(in oklab, var(--brand-accent), transparent 91%);
}

.table-active > * {
  --bs-table-bg: color-mix(in oklab, var(--action-bg), transparent 90%);
  color: var(--app-text) !important;
}

.table thead th,
.table tbody td {
  vertical-align: middle;
}

.table.table-striped tbody td {
  font-size: 0.79rem;
  font-weight: 400;
  padding-top: 0.38rem;
  padding-bottom: 0.38rem;
}

.table .table-actions {
  text-align: right;
  white-space: nowrap;
}

.customers-per-page-wrap {
  margin-left: auto;
  min-width: 220px;
  justify-content: flex-end;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: color-mix(in oklab, var(--app-surface-2), transparent 0%);
}

.badge {
  border-radius: 999px;
  border: 1px solid var(--app-stroke);
  background: var(--app-surface-2);
  color: var(--app-text);
  font-weight: 800;
  font-size: 0.72rem;
}

.alert {
  border-radius: 1rem;
  border: 1px solid var(--app-stroke);
}

.card-kpi {
  border-left: 4px solid var(--brand-accent);
}

.small,
small,
.text-muted {
  color: var(--app-muted) !important;
  font-size: 0.72rem !important;
  font-weight: 700;
}

.customers-name-link {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.customers-name-link:hover,
.customers-name-link:focus {
  color: inherit;
  text-decoration: none;
}

.table.table-striped .customers-name-link,
.table.table-striped .category-tree-parent {
  font-weight: 400;
}

.category-tree-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.category-tree-parent {
  font-weight: 700;
}

.category-tree-child {
  margin-left: 0.9rem;
}

.category-tree-branch {
  color: var(--app-muted);
  font-size: 0.78rem;
  line-height: 1;
}

.timeline-list .timeline-item {
  border-left: 3px solid var(--app-stroke);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--app-surface-2);
  border-radius: 0.8rem;
}

a:not(.btn):not(.nav-pill-erp):not(.dropdown-item) {
  color: var(--app-text);
}

a:not(.btn):not(.nav-pill-erp):not(.dropdown-item):hover,
a:not(.btn):not(.nav-pill-erp):not(.dropdown-item):focus {
  color: var(--app-text);
}

.list-group-item.active {
  color: var(--app-text) !important;
  background: color-mix(in oklab, var(--action-bg), transparent 90%) !important;
  border-color: color-mix(in oklab, var(--action-bg), transparent 72%) !important;
}

.order-dropdown {
  z-index: 1030;
  max-height: 220px;
  overflow-y: auto;
  width: min(500px, 90vw);
}

.product-dropdown {
  z-index: 1030;
  max-height: 240px;
  overflow-y: auto;
  width: min(560px, 92vw);
  background: var(--app-surface);
  border: 1px solid var(--app-stroke);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.order-dropdown,
.product-dropdown {
  background: var(--app-surface);
  border: 1px solid var(--app-stroke);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.order-dropdown .list-group-item,
.product-dropdown .list-group-item {
  background: var(--app-surface);
  color: var(--app-text);
  border: 0;
  border-bottom: 1px solid var(--app-stroke);
}

.order-dropdown .list-group-item:last-child,
.product-dropdown .list-group-item:last-child {
  border-bottom: 0;
}

html[data-bs-theme="dark"] .order-dropdown,
html[data-bs-theme="dark"] .product-dropdown {
  background: #0f1f3d;
  border-color: rgba(255, 255, 255, 0.16);
}

html[data-bs-theme="dark"] .order-dropdown .list-group-item,
html[data-bs-theme="dark"] .product-dropdown .list-group-item {
  background: #0f1f3d;
}

#orderEntryPage .card,
#orderEntryPage .card .card-body,
#orderEntryPage #orderGrid,
#orderEntryPage #orderGrid td {
  overflow: visible;
}

#orderEntryPage .order-workflow-lock {
  position: relative;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

#orderEntryPage .order-workflow-lock.is-locked {
  filter: blur(2px);
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}

#orderEntryPage .fulfilment-toggle .btn {
  font-weight: 700;
}

#orderEntryPage .btn-group .btn-check:checked + .btn {
  background: #2f7ee8 !important;
  border-color: #2f7ee8 !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

html[data-bs-theme="dark"] #orderEntryPage .btn-group .btn-check:checked + .btn {
  background: #5aa2ff !important;
  border-color: #5aa2ff !important;
  color: #071225 !important;
}

#orderEntryPage .order-actions-row .order-confirm-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#orderEntryPage .order-actions-row .order-confirm-switch .form-check-input {
  width: 2.9rem;
  height: 1.55rem;
  margin-top: 0;
}

#orderEntryPage .order-actions-row .order-confirm-switch .form-check-label {
  font-size: 0.92rem;
  font-weight: 600;
}

#orderEntryPage .order-selected-customer-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

#orderEntryPage .order-selected-customer-main {
  flex: 1 1 auto;
  min-width: 0;
}

#orderEntryPage .order-selected-customer-icon {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  line-height: 1;
  background: color-mix(in oklab, var(--action-bg), transparent 82%);
  border: 1px solid color-mix(in oklab, var(--action-bg), transparent 62%);
  flex: 0 0 auto;
}

html[data-bs-theme="dark"] #orderEntryPage .order-selected-customer-icon {
  background: rgba(90, 162, 255, 0.2);
  border-color: rgba(90, 162, 255, 0.46);
}

#orderEntryPage #orderGrid td {
  position: relative;
}

#orderEntryPage .product-dropdown,
#orderEntryPage .order-dropdown {
  z-index: 3000;
}

#orderEntryPage #orderGrid .line-remove-col {
  width: 2.4rem;
  text-align: center;
}

#orderEntryPage #orderGrid .line-remove-btn {
  width: 1.7rem;
  min-width: 1.7rem;
  height: 1.7rem;
  min-height: 1.7rem;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

#orderEntryPage #orderGrid tbody tr.is-committed:hover .line-remove-btn,
#orderEntryPage #orderGrid tbody tr.is-committed:focus-within .line-remove-btn {
  opacity: 1;
  pointer-events: auto;
}

#orderEntryPage .erp-price-tooltip-title {
  font-weight: 700;
  margin-bottom: 0.3rem;
}

#orderEntryPage .erp-price-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

#orderEntryPage .erp-price-tooltip-row + .erp-price-tooltip-row {
  margin-top: 0.15rem;
}

.order-price-hint {
  position: absolute;
  z-index: 4000;
  transform: translate(-50%, -100%);
  display: none;
  min-width: 220px;
  max-width: 320px;
  padding: 0.5rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid var(--app-stroke);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: var(--shadow-soft);
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.35;
}

.order-price-hint.show {
  display: block;
}

html[data-bs-theme="dark"] .order-price-hint {
  background: #0f1f3d;
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

#orderEntryPage #orderGrid tbody tr.is-committed .product-search:disabled {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.42);
  color: var(--app-text);
  opacity: 1;
}

html[data-bs-theme="dark"] #orderEntryPage #orderGrid tbody tr.is-committed .product-search:disabled {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(74, 222, 128, 0.48);
  color: #fff;
}

.offcanvas.erp-sidebar {
  background: radial-gradient(1200px 900px at 18% 12%, #0f67c4 0%, #004b97 46%, #00366d 100%);
}

.offcanvas .btn-close {
  filter: invert(1);
  opacity: 0.8;
}

.user-menu-wrap .dropdown-menu {
  border-radius: 0.9rem;
  border: 1px solid var(--app-stroke);
  background: var(--app-surface);
  box-shadow: var(--shadow-soft);
  padding: 0.35rem;
}

.erp-sidebar .user-menu-wrap .btn-erp,
.offcanvas.erp-sidebar .user-menu-wrap .btn-erp {
  color: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none;
}

.user-menu-top .user-icon-btn {
  min-width: 58px;
  height: 36px;
  padding: 0 0.55rem;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  color: var(--app-text) !important;
  border: 1px solid var(--app-stroke) !important;
  background: var(--app-surface) !important;
  box-shadow: var(--shadow-soft);
}

.user-menu-top .user-icon-btn::after {
  display: none;
}

.user-menu-top .user-icon-glyph {
  line-height: 1;
}

.user-menu-top .user-icon-caret {
  font-size: 0.74rem;
  opacity: 0.9;
  line-height: 1;
}

.erp-sidebar .user-menu-wrap .btn-erp:hover,
.erp-sidebar .user-menu-wrap .btn-erp:focus,
.offcanvas.erp-sidebar .user-menu-wrap .btn-erp:hover,
.offcanvas.erp-sidebar .user-menu-wrap .btn-erp:focus {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.user-menu-wrap .dropdown-item {
  border-radius: 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--app-text);
  border: 1px solid var(--app-stroke);
  background: var(--app-surface);
  padding: 0.42rem 0.62rem;
}

.user-menu-wrap .dropdown-item:hover {
  background: color-mix(in oklab, var(--brand-accent), transparent 88%);
  color: var(--app-text);
}

.login-bg {
  min-height: 100vh;
}

html[data-bs-theme="dark"] .modal-content {
  background: #1a1326;
  border: 1px solid var(--app-stroke);
}

html[data-bs-theme="dark"] body {
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(75, 183, 255, 0.18), rgba(0, 0, 0, 0) 60%),
    radial-gradient(900px 500px at 85% 25%, rgba(55, 214, 122, 0.1), rgba(0, 0, 0, 0) 55%),
    linear-gradient(180deg, #071225, #091831);
}

html[data-bs-theme="dark"] .erp-sidebar,
html[data-bs-theme="dark"] .offcanvas.erp-sidebar {
  background: rgba(9, 23, 46, 0.72);
  backdrop-filter: blur(12px) saturate(118%);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

html[data-bs-theme="dark"] .erp-topbar {
  background: color-mix(in oklab, var(--app-bg), transparent 18%);
}

html[data-bs-theme="dark"] {
  --app-text: #eaf2ff;
  --app-muted: rgba(234, 242, 255, 0.7);
}

html[data-bs-theme="dark"] h1,
html[data-bs-theme="dark"] h2,
html[data-bs-theme="dark"] h3,
html[data-bs-theme="dark"] h4,
html[data-bs-theme="dark"] h5,
html[data-bs-theme="dark"] h6,
html[data-bs-theme="dark"] .erp-title,
html[data-bs-theme="dark"] .card-title,
html[data-bs-theme="dark"] .table thead th {
  color: #fff !important;
}

html[data-bs-theme="dark"] .erp-subtitle {
  color: #fff !important;
}

html[data-bs-theme="dark"] .table.table-striped tbody td,
html[data-bs-theme="dark"] .table.table-striped tbody td a,
html[data-bs-theme="dark"] .table.table-striped tbody td .small,
html[data-bs-theme="dark"] .table.table-striped tbody td .text-muted,
html[data-bs-theme="dark"] .table.table-striped tbody td small,
html[data-bs-theme="dark"] .table.table-striped tbody td .category-tree-branch {
  color: #fff !important;
}

html[data-bs-theme="dark"] .table-active > * {
  --bs-table-bg: color-mix(in oklab, var(--action-bg), transparent 85%);
  color: #fff !important;
}

#dispatchUnallocatedTable tbody tr {
  cursor: grab;
}

#dispatchUnallocatedTable tbody tr:active {
  cursor: grabbing;
}

#dispatchOrdersTable tbody tr {
  cursor: pointer;
}

#dispatchCollectionsTable tbody tr {
  cursor: pointer;
}

#dispatchCollectionsTable tbody tr td.table-actions {
  cursor: default;
}

#dispatchCollectionsTable tbody tr td.table-actions a,
#dispatchCollectionsTable tbody tr td.table-actions button {
  cursor: pointer;
}

#dispatchUnallocatedTable tbody tr.table-active > *,
#dispatchOrdersTable tbody tr.table-active > * {
  --bs-table-bg: color-mix(in oklab, var(--action-bg), transparent 88%);
  background: color-mix(in oklab, var(--action-bg), transparent 88%) !important;
  color: var(--app-text) !important;
}

html[data-bs-theme="dark"] #dispatchUnallocatedTable tbody tr.table-active > *,
html[data-bs-theme="dark"] #dispatchOrdersTable tbody tr.table-active > * {
  --bs-table-bg: color-mix(in oklab, var(--action-bg), transparent 82%);
  background: color-mix(in oklab, var(--action-bg), transparent 82%) !important;
  color: #fff !important;
}

#dispatchUnallocatedTable tbody tr.table-active:hover > *,
#dispatchOrdersTable tbody tr.table-active:hover > * {
  background: inherit !important;
}

.dispatch-route-drop-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  border: 1px solid var(--app-stroke);
}

.dispatch-route-drop-card.is-drop-target {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--action-bg), transparent 45%);
  box-shadow: 0 12px 24px color-mix(in oklab, var(--action-bg), transparent 78%);
  background: color-mix(in oklab, var(--action-bg), transparent 93%);
}

.route-summary-tile {
  height: 100%;
  border: 1px solid var(--app-stroke);
  border-radius: 0.75rem;
  background: color-mix(in oklab, var(--app-surface-2), transparent 8%);
  padding: 0.55rem 0.65rem;
}

.route-summary-label {
  font-size: 0.7rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.route-summary-value {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--app-text);
}

@media print {
  aside.erp-sidebar,
  .offcanvas.erp-sidebar,
  .erp-topbar {
    display: none !important;
  }

  .main-panel {
    margin-left: 0 !important;
    padding-top: 0 !important;
  }

  .container-fluid {
    padding: 0 !important;
  }
}

@media (max-width: 991px) {
  aside.erp-sidebar {
    width: 100%;
    min-height: auto;
    position: static;
    inset: auto;
    overflow: visible;
  }

  .main-panel {
    padding-top: 72px;
    margin-left: 0;
  }

  .erp-topbar {
    min-height: 68px;
    left: 0;
  }

  .mobile-overlay-open {
    overflow: hidden;
  }

  .mobile-overlay-panel {
    position: fixed;
    inset: 0;
    z-index: 2000;
    padding: 0.95rem;
    background: rgba(7, 18, 37, 0.45);
    overflow-y: auto;
  }

  .mobile-overlay-panel .card {
    margin: 0.35rem auto;
    max-width: 780px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  }
}

@media (min-width: 992px) {
  .products-layout-row .products-table-col,
  .products-layout-row .products-side-col {
    transition: max-width 0.28s ease, flex-basis 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  }

  .products-layout-row.products-side-hidden .products-table-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .products-layout-row.products-side-hidden .products-side-col {
    flex: 0 0 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
  }

  .products-layout-row.products-side-visible .products-table-col {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }

  .products-layout-row.products-side-visible .products-side-col {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    opacity: 1;
  }

  .categories-layout-row .categories-table-col,
  .categories-layout-row .categories-side-col {
    transition: max-width 0.28s ease, flex-basis 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  }

  .categories-layout-row.categories-side-hidden .categories-table-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .categories-layout-row.categories-side-hidden .categories-side-col {
    flex: 0 0 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
  }

  .categories-layout-row.categories-side-visible .categories-table-col {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }

  .categories-layout-row.categories-side-visible .categories-side-col {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    opacity: 1;
  }

  .vat-groups-layout-row .vat-groups-table-col,
  .vat-groups-layout-row .vat-groups-side-col {
    transition: max-width 0.28s ease, flex-basis 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  }

  .vat-groups-layout-row.vat-groups-side-hidden .vat-groups-table-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .vat-groups-layout-row.vat-groups-side-hidden .vat-groups-side-col {
    flex: 0 0 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
  }

  .vat-groups-layout-row.vat-groups-side-visible .vat-groups-table-col {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }

  .vat-groups-layout-row.vat-groups-side-visible .vat-groups-side-col {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    opacity: 1;
  }

  .staff-layout-row .staff-table-col,
  .staff-layout-row .staff-side-col {
    transition: max-width 0.28s ease, flex-basis 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  }

  .staff-layout-row.staff-side-hidden .staff-table-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .staff-layout-row.staff-side-hidden .staff-side-col {
    flex: 0 0 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
  }

  .staff-layout-row.staff-side-visible .staff-table-col {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }

  .staff-layout-row.staff-side-visible .staff-side-col {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    opacity: 1;
  }

  .vehicles-layout-row .vehicles-table-col,
  .vehicles-layout-row .vehicles-side-col {
    transition: max-width 0.28s ease, flex-basis 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  }

  .vehicles-layout-row.vehicles-side-hidden .vehicles-table-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .vehicles-layout-row.vehicles-side-hidden .vehicles-side-col {
    flex: 0 0 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
  }

  .vehicles-layout-row.vehicles-side-visible .vehicles-table-col {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }

  .vehicles-layout-row.vehicles-side-visible .vehicles-side-col {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    opacity: 1;
  }

  .dispatch-layout-row .dispatch-table-col,
  .dispatch-layout-row .dispatch-side-col {
    transition: max-width 0.28s ease, flex-basis 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  }

  .dispatch-layout-row.dispatch-side-hidden .dispatch-table-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .dispatch-layout-row.dispatch-side-hidden .dispatch-side-col {
    flex: 0 0 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
  }

  .dispatch-layout-row.dispatch-side-visible .dispatch-table-col {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }

  .dispatch-layout-row.dispatch-side-visible .dispatch-side-col {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    opacity: 1;
  }

  .dispatch-unallocated-layout-row .dispatch-unallocated-table-col,
  .dispatch-unallocated-layout-row .dispatch-unallocated-side-col {
    transition: max-width 0.28s ease, flex-basis 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  }

  .dispatch-unallocated-layout-row.dispatch-unallocated-side-hidden .dispatch-unallocated-table-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .dispatch-unallocated-layout-row.dispatch-unallocated-side-hidden .dispatch-unallocated-side-col {
    flex: 0 0 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
  }

  .dispatch-unallocated-layout-row.dispatch-unallocated-side-visible .dispatch-unallocated-table-col {
    flex: 0 0 68%;
    max-width: 68%;
  }

  .dispatch-unallocated-layout-row.dispatch-unallocated-side-visible .dispatch-unallocated-side-col {
    flex: 0 0 32%;
    max-width: 32%;
    opacity: 1;
  }

  .dispatch-detail-layout-row .dispatch-detail-table-col,
  .dispatch-detail-layout-row .dispatch-detail-side-col {
    transition: max-width 0.28s ease, flex-basis 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  }

  .dispatch-detail-layout-row.dispatch-detail-side-hidden .dispatch-detail-table-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .dispatch-detail-layout-row.dispatch-detail-side-hidden .dispatch-detail-side-col {
    flex: 0 0 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
  }

  .dispatch-detail-layout-row.dispatch-detail-side-visible .dispatch-detail-table-col {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }

  .dispatch-detail-layout-row.dispatch-detail-side-visible .dispatch-detail-side-col {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    opacity: 1;
  }
}
