:root {
  --lm-bg: #f4f6f9;
  --lm-surface: #ffffff;
  --lm-surface-2: #f8fafc;
  --lm-border: #e5e7eb;
  --lm-text: #111827;
  --lm-text-muted: #6b7280;
  --lm-primary: #2eb6bf;
  --lm-success: #16a34a;
  --lm-warning: #f59e0b;
  --lm-danger: #ef4444;
  --lm-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --lm-shadow-soft: 0 6px 16px rgba(15, 23, 42, 0.06);
  --lm-radius: 14px;
  --lm-radius-sm: 10px;
  --lm-radius-lg: 18px;
  --lm-focus: rgba(46, 182, 191, 0.35);
  --lm-scroll-thumb: #9ca3af;
  --lm-scroll-track: rgba(0, 0, 0, 0.06);
  --lm-card-pad: 16px;
  --lm-card-pad-lg: 20px;
  --lm-input-pad: 12px 14px;
  --bs-body-bg: var(--lm-bg);
  --bs-body-color: var(--lm-text);
  --bs-border-color: var(--lm-border);
  --bs-primary: var(--lm-primary);
  --bs-success: var(--lm-success);
  --bs-warning: var(--lm-warning);
  --bs-danger: var(--lm-danger);
  --bs-link-color: var(--lm-primary);
  --bs-link-hover-color: #249ea6;
  --bs-secondary-bg: var(--lm-surface-2);
  --bs-tertiary-bg: var(--lm-surface-2);
  --bs-secondary-color: var(--lm-text-muted);
  --bs-border-radius: var(--lm-radius);
  --bs-border-radius-sm: var(--lm-radius-sm);
  --bs-box-shadow: var(--lm-shadow);
}

html[data-theme="dark"] {
  --lm-bg: #232323;
  --lm-surface: #2b2b2b;
  --lm-surface-2: #262626;
  --lm-border: #3a3a3a;
  --lm-text: #f3f4f6;
  --lm-text-muted: #b0b7c3;
  --lm-primary: #3fbac2;
  --lm-success: #22c55e;
  --lm-warning: #f8b24a;
  --lm-danger: #f87171;
  --lm-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  --lm-shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.25);
  --lm-focus: rgba(63, 186, 194, 0.4);
  --lm-scroll-thumb: #b59a7a;
  --lm-scroll-track: rgba(255, 255, 255, 0.08);
  --bs-body-bg: var(--lm-bg);
  --bs-body-color: var(--lm-text);
  --bs-border-color: var(--lm-border);
  --bs-primary: var(--lm-primary);
  --bs-success: var(--lm-success);
  --bs-warning: var(--lm-warning);
  --bs-danger: var(--lm-danger);
  --bs-link-color: #7dd3d8;
  --bs-link-hover-color: #9fe2e6;
}

html,
body {
  background: var(--lm-bg);
  color: var(--lm-text);
}

.lm-page {
  min-height: calc(100vh - 120px);
}

:where(.card, .panel, .box, .card-surface, .dashboard-card, .overview-Orders) {
  background: var(--lm-surface);
  color: var(--lm-text);
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius);
  box-shadow: var(--lm-shadow);
}

:where(.card > .card-body, .panel, .box, .modal-content, .overview-Orders) {
  padding: var(--lm-card-pad);
}

.card-shadow-soft {
  box-shadow: var(--lm-shadow-soft);
}

.text-muted {
  color: var(--lm-text-muted) !important;
}

.bg-light,
.bg-white,
.bg-slate-50,
.bg-gray-50 {
  background: var(--lm-surface-2) !important;
}

hr {
  border-color: var(--lm-border);
  opacity: 1;
}

.btn {
  border-radius: var(--lm-radius-sm);
}

.btn-primary,
.btn-master,
.btn-Create-Order {
  color: #ffffff !important;
  background: var(--lm-primary) !important;
  border-color: var(--lm-primary) !important;
}

.btn-primary:hover,
.btn-master:hover,
.btn-Create-Order:hover {
  filter: brightness(0.95);
}

.btn-outline-secondary,
.btn-outline-light {
  color: var(--lm-text) !important;
  border-color: var(--lm-border) !important;
}

.btn-outline-secondary:hover,
.btn-outline-light:hover {
  background: var(--lm-surface-2) !important;
}

.btn-light {
  background: var(--lm-surface-2) !important;
  color: var(--lm-text) !important;
  border-color: var(--lm-border) !important;
}

.btn-light:hover {
  filter: brightness(0.98);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.65;
  color: var(--lm-text-muted) !important;
}

.form-control,
.form-select,
input,
textarea {
  background: var(--lm-surface) !important;
  color: var(--lm-text) !important;
  border-color: var(--lm-border) !important;
  border-radius: var(--lm-radius-sm) !important;
  padding: var(--lm-input-pad);
}

.form-control::placeholder,
textarea::placeholder {
  color: var(--lm-text-muted);
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus {
  border-color: var(--lm-primary) !important;
  box-shadow: 0 0 0 0.2rem var(--lm-focus) !important;
}

.form-check-input {
  border-color: var(--lm-border);
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem var(--lm-focus);
  border-color: var(--lm-primary);
}

.input-validation-error,
.is-invalid {
  border-color: var(--lm-danger) !important;
}

.field-validation-error,
.validation-summary-errors,
.invalid-feedback,
.text-danger {
  color: var(--lm-danger) !important;
}

.table {
  --bs-table-bg: var(--lm-surface);
  --bs-table-color: var(--lm-text);
  --bs-table-border-color: var(--lm-border);
  --bs-table-striped-bg: var(--lm-surface-2);
  --bs-table-striped-color: var(--lm-text);
  --bs-table-hover-bg: var(--lm-surface-2);
  --bs-table-hover-color: var(--lm-text);
  border-color: var(--lm-border);
}

.table thead th {
  background: var(--lm-surface-2);
  color: var(--lm-text);
  border-bottom: 1px solid var(--lm-border);
  font-weight: 600;
}

.table tbody tr:hover {
  background: var(--lm-surface-2);
}

.table-responsive {
  border-radius: var(--lm-radius);
  border: 1px solid var(--lm-border);
  overflow: hidden;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--lm-radius-sm) !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: var(--lm-surface) !important;
  color: var(--lm-text) !important;
  border: 1px solid var(--lm-border) !important;
  padding: 6px 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: var(--lm-surface) !important;
  color: var(--lm-text) !important;
  border: 1px solid var(--lm-border) !important;
  margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--lm-surface-2) !important;
  border-color: var(--lm-border) !important;
  color: var(--lm-text) !important;
}

.dataTables_wrapper .dataTables_info {
  color: var(--lm-text-muted) !important;
}

.dropdown-menu {
  background: var(--lm-surface);
  color: var(--lm-text);
  border-radius: var(--lm-radius);
  border: 1px solid var(--lm-border);
  box-shadow: var(--lm-shadow);
}

.dropdown-item {
  color: var(--lm-text);
  border-radius: calc(var(--lm-radius-sm) - 2px);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--lm-surface-2);
  color: var(--lm-text);
}

.modal-content {
  background: var(--lm-surface);
  color: var(--lm-text);
  border-radius: var(--lm-radius-lg);
  border: 1px solid var(--lm-border);
  box-shadow: var(--lm-shadow);
}

.modal-header,
.modal-footer {
  border-color: var(--lm-border);
}

.modal-backdrop.show {
  opacity: 0.55;
}

html[dir="rtl"] .dropdown-menu {
  right: 0;
  left: auto;
  text-align: right;
}

html[dir="rtl"] .dropdown-menu-end {
  right: 0;
  left: auto;
}

html[dir="rtl"] .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 0.35rem;
}

html[dir="rtl"] .dropdown-toggle::after {
  margin-left: 0.35rem !important;
  margin-right: 0 !important;
}

html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] input,
html[dir="rtl"] textarea {
  text-align: right;
}

html[dir="rtl"] .dataTables_wrapper .dataTables_filter,
html[dir="rtl"] .dataTables_wrapper .dataTables_length {
  text-align: right;
}

body {
  scrollbar-color: var(--lm-scroll-thumb) var(--lm-scroll-track);
}

body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body::-webkit-scrollbar-thumb {
  background: var(--lm-scroll-thumb);
  border-radius: 999px;
}

body::-webkit-scrollbar-track {
  background: var(--lm-scroll-track);
}

.table-responsive,
.modal-body {
  scrollbar-color: var(--lm-scroll-thumb) var(--lm-scroll-track);
}

.table-responsive::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-responsive::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: var(--lm-scroll-thumb);
  border-radius: 999px;
}

.table-responsive::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: var(--lm-scroll-track);
}
