html { scroll-behavior: smooth; }
body { background: #f8fafc; }

/* Print only the invoice content when #invoice-print-area is on the page */
@media print {
  body:has(#invoice-print-area) * { visibility: hidden; }
  body:has(#invoice-print-area) #invoice-print-area,
  body:has(#invoice-print-area) #invoice-print-area * { visibility: visible; }
  body:has(#invoice-print-area) #modalRoot { position: absolute; inset: 0; background: none; padding: 0; }
  body:has(#invoice-print-area) #modalBox { position: absolute; left: 0; top: 0; width: 100%; max-width: 100%; box-shadow: none; border: none; }
  body:has(#invoice-print-area) #modalBox > *:not(#invoice-print-area) { display: none; }
}

.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #334155; border-radius: 999px; }

.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(99,102,241,.10));
  color: #fff;
  border: 1px solid rgba(129,140,248,.18);
}

.glass { background: rgba(255,255,255,.78); backdrop-filter: blur(12px); }

.table-wrap::-webkit-scrollbar { height: 7px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

/* Toggle switch (styled checkbox) */
input[type="checkbox"].toggle-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 2.5rem;
  height: 1.5rem;
  background: #cbd5e1;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s ease;
}
input[type="checkbox"].toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: #fff;
  border-radius: 50%;
  transition: left .15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
input[type="checkbox"].toggle-switch:checked { background: #4f46e5; }
input[type="checkbox"].toggle-switch:checked::after { left: calc(100% - 1.25rem - 2px); }

input[type="checkbox"].toggle-switch-sm { width: 2rem; height: 1.125rem; }
input[type="checkbox"].toggle-switch-sm::after { width: .875rem; height: .875rem; }
input[type="checkbox"].toggle-switch-sm:checked::after { left: calc(100% - .875rem - 2px); }

/* Image dropzone */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  padding: 1.25rem;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.dropzone:hover, .dropzone.dropzone-active {
  border-color: #6366f1;
  background: #eef2ff;
}
.dropzone-preview {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: .75rem;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 1.5rem;
}
.dropzone-img { width: 100%; height: 100%; object-fit: cover; }
.dropzone-hint { font-size: .75rem; color: #64748b; }
.dropzone-hint b { color: #4f46e5; font-weight: 600; }
.dropzone-clear { margin-top: .25rem; display: flex; align-items: center; gap: .375rem; font-size: .75rem; color: #64748b; cursor: pointer; }

/* Choices.js — themed to match our text/select inputs */
.choices { margin-bottom: 0; font-size: .875rem; }
.choices__inner {
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  padding: .3rem .75rem;
  font-size: .875rem;
}
.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(99,102,241,.10);
}
.choices[data-type*="select-one"] .choices__inner { padding-bottom: .3rem; }
.choices[data-type*="select-one"] .choices__input { margin-top: .25rem; background: #f8fafc; border-radius: .5rem; }
.choices__list--single { padding: 0 1rem 0 0; }
.choices__list--dropdown, .choices__list[aria-expanded] {
  border-color: #e2e8f0;
  border-radius: .75rem;
  overflow: hidden;
  margin-top: .25rem;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: #eef2ff;
  color: #4338ca;
}
.choices__item--choice.is-disabled { color: #cbd5e1; }
.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item { white-space: nowrap; }
.choices__list--dropdown { width: max-content; min-width: 100%; }
.choices[data-type*="select-multiple"] .choices__inner,
.choices[data-type*="text"] .choices__inner { padding-top: .2rem; padding-bottom: .2rem; }
.choices__list--multiple .choices__item {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
  border-radius: .5rem;
}
.choices__placeholder { opacity: 1; color: #94a3b8; }

/* flatpickr — align sizing with our inputs (the alt text input is the visible one) */
input.flatpickr-input { cursor: pointer; }

/* Locked form fields (e.g. sale items once paid/shipping) */
input:disabled, select:disabled, textarea:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}
