.theme-toggle {
  align-items: center;
  background: #fff;
  border: 1px solid #dce5e1;
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  flex: 0 0 auto;
  font: 700 12px/1 Inter, system-ui, sans-serif;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
}

.theme-toggle:hover {
  background: #eff8f4;
  border-color: #9bcfb9;
  color: #087653;
}

.theme-toggle svg {
  height: 16px;
  width: 16px;
}

.theme-toggle-floating {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 1200;
}

.navbar-collapse > .theme-toggle {
  margin-right: 8px;
}

html[data-theme="dark"] {
  --ink: #edf4f7;
  --text: #ced9e1;
  --muted: #9fb0bd;
  --line: #2a3b47;
  --surface: #12212b;
  --background: #09151d;
  --cream: #101f28;
  --mint: #163d35;
  color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .system-shell,
html[data-theme="dark"] .system-main,
html[data-theme="dark"] .login-page,
html[data-theme="dark"] .login-main {
  background: #09151d;
  color: #ced9e1;
}

html[data-theme="dark"] .system-header,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .navbar-collapse,
html[data-theme="dark"] .mobile-bottom-nav,
html[data-theme="dark"] .mobile-more-menu {
  background: rgba(15, 28, 37, .97) !important;
  border-color: #293b47 !important;
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .panel-flat,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .compact-stats > div,
html[data-theme="dark"] .category-admin-card,
html[data-theme="dark"] .product-admin-card,
html[data-theme="dark"] .service-category-card,
html[data-theme="dark"] .item-card,
html[data-theme="dark"] .order-progress,
html[data-theme="dark"] .order-panel,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .tracking-card,
html[data-theme="dark"] .success-panel,
html[data-theme="dark"] .process-card,
html[data-theme="dark"] .empty-state-system,
html[data-theme="dark"] .ref-metric,
html[data-theme="dark"] .ref-category-card,
html[data-theme="dark"] .ref-category-metrics article,
html[data-theme="dark"] .ref-catalog-toolbar,
html[data-theme="dark"] .ref-item-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .floating-cart-summary,
html[data-theme="dark"] .floating-cart-panel,
html[data-theme="dark"] .pos-item,
html[data-theme="dark"] .pos-order-result,
html[data-theme="dark"] .finance-facts > div,
html[data-theme="dark"] .history-order-readonly,
html[data-theme="dark"] .category-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .reference-box,
html[data-theme="dark"] .card,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .accordion-item {
  background: #12212b !important;
  border-color: #2a3b47 !important;
  color: #ced9e1 !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .system-form-modal .modal-header,
html[data-theme="dark"] .system-form-modal .modal-footer {
  background: #12212b !important;
  border-color: #2a3b47 !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong,
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .navbar-brand,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .page-title h1,
html[data-theme="dark"] .panel-head h2,
html[data-theme="dark"] .pos-item strong,
html[data-theme="dark"] .pos-cart-line strong,
html[data-theme="dark"] .pos-order-result strong,
html[data-theme="dark"] .pos-order-detail strong,
html[data-theme="dark"] .account-trigger-copy strong,
html[data-theme="dark"] .branch-pos-identity strong {
  color: #edf4f7 !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] small,
html[data-theme="dark"] label,
html[data-theme="dark"] .page-title span,
html[data-theme="dark"] .note-copy,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .pos-section-head p,
html[data-theme="dark"] .pos-ready-intro,
html[data-theme="dark"] .pos-cart-lines > p {
  color: #a9b8c3 !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background-color: #0d1a23 !important;
  border-color: #344754 !important;
  color: #edf4f7 !important;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #7f919e !important;
  opacity: 1;
}

html[data-theme="dark"] .system-table th,
html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .summary-total,
html[data-theme="dark"] .stage-list > div,
html[data-theme="dark"] .sidebar-help,
html[data-theme="dark"] .round-action,
html[data-theme="dark"] .table-action,
html[data-theme="dark"] .category-icon,
html[data-theme="dark"] .item-price-block,
html[data-theme="dark"] .history-icon,
html[data-theme="dark"] .modal-close,
html[data-theme="dark"] .amount-callout,
html[data-theme="dark"] .line-number,
html[data-theme="dark"] .form-card-head > a,
html[data-theme="dark"] .ref-btn.light,
html[data-theme="dark"] .ref-view-toggle,
html[data-theme="dark"] .ref-view-toggle button.active,
html[data-theme="dark"] .ref-category-icon,
html[data-theme="dark"] .ref-manage-row b,
html[data-theme="dark"] .ref-add-category > span,
html[data-theme="dark"] .ref-add-category b,
html[data-theme="dark"] .ref-item-image,
html[data-theme="dark"] .ref-edit-item,
html[data-theme="dark"] .settings-card-head > span,
html[data-theme="dark"] .pos-order-customer,
html[data-theme="dark"] .pos-order-detail-head button,
html[data-theme="dark"] .pos-express-toggle,
html[data-theme="dark"] .pos-workflow-tabs,
html[data-theme="dark"] .pos-line-controls button,
html[data-theme="dark"] .quick-links a:hover {
  background: #0d1a23 !important;
  border-color: #2a3b47 !important;
}

html[data-theme="dark"] .sidebar-nav a,
html[data-theme="dark"] .back-link,
html[data-theme="dark"] .breadcrumbs,
html[data-theme="dark"] .breadcrumbs strong,
html[data-theme="dark"] .result-count,
html[data-theme="dark"] .compact-stats span,
html[data-theme="dark"] .category-meta,
html[data-theme="dark"] .history-main p,
html[data-theme="dark"] .history-main small,
html[data-theme="dark"] .info-list span,
html[data-theme="dark"] .info-list small,
html[data-theme="dark"] .invoice-summary span,
html[data-theme="dark"] .finance-facts small,
html[data-theme="dark"] .method-breakdown small,
html[data-theme="dark"] .cashflow-month small {
  color: #a9b8c3 !important;
}

html[data-theme="dark"] .sidebar-nav a:hover {
  background: #182b36 !important;
  color: #edf4f7 !important;
}

html[data-theme="dark"] .sidebar-nav a.active {
  background: #12372f !important;
  color: #55d6a3 !important;
}

html[data-theme="dark"] .sidebar-help:hover,
html[data-theme="dark"] .round-action:hover,
html[data-theme="dark"] .table-action:hover,
html[data-theme="dark"] .modal-close:hover {
  background: #1b303c !important;
  color: #edf4f7 !important;
}

html[data-theme="dark"] .progress-line,
html[data-theme="dark"] .method-breakdown em {
  background: #243640 !important;
}

html[data-theme="dark"] .detail-tabs a span {
  background: #263944 !important;
  color: #c4d0d8 !important;
}

html[data-theme="dark"] .detail-tabs a.active span {
  background: rgba(255, 255, 255, .18) !important;
  color: #fff !important;
}

html[data-theme="dark"] .status-chip {
  background: #1b303c !important;
  color: #c4d0d8 !important;
}

html[data-theme="dark"] .status-chip.success,
html[data-theme="dark"] .status-completed,
html[data-theme="dark"] .status-ready {
  background: #123d31 !important;
  color: #62dfa9 !important;
}

html[data-theme="dark"] .status-chip.warning,
html[data-theme="dark"] .status-hold {
  background: #3b2c16 !important;
  color: #f6c56b !important;
}

html[data-theme="dark"] .status-cancelled {
  background: #3d2029 !important;
  color: #fb8fa9 !important;
}

html[data-theme="dark"] .status-placed,
html[data-theme="dark"] .status-confirmed,
html[data-theme="dark"] .status-pickup {
  background: #172f4a !important;
  color: #87b8ff !important;
}

html[data-theme="dark"] .status-received,
html[data-theme="dark"] .status-sorting,
html[data-theme="dark"] .status-cleaning,
html[data-theme="dark"] .status-drying,
html[data-theme="dark"] .status-ironing,
html[data-theme="dark"] .status-quality,
html[data-theme="dark"] .status-packing,
html[data-theme="dark"] .status-delivery {
  background: #30274a !important;
  color: #c4a8ff !important;
}

html[data-theme="dark"] .form-card-head,
html[data-theme="dark"] .settings-card-head {
  background: #101f28 !important;
  border-color: #2a3b47 !important;
}

html[data-theme="dark"] .category-add-card,
html[data-theme="dark"] .catalog-alert,
html[data-theme="dark"] .order-form-status,
html[data-theme="dark"] .ref-catalog-notice,
html[data-theme="dark"] .ref-rate-banner {
  background: #12212b !important;
  border-color: #3b5260 !important;
  color: #ced9e1 !important;
}

html[data-theme="dark"] .category-cover,
html[data-theme="dark"] .ref-category-hero,
html[data-theme="dark"] .ref-item-image,
html[data-theme="dark"] .product-image,
html[data-theme="dark"] .cashflow-chart {
  background-color: #101f28 !important;
  background-image: none !important;
  border-color: #2a3b47 !important;
}

html[data-theme="dark"] .clickable-row:hover {
  background: #182b36 !important;
}

html[data-theme="dark"] .pos-balance-due {
  background: #3b2c16 !important;
  border-color: #745628 !important;
  color: #f2d49a !important;
}

html[data-theme="dark"] .pos-ready-feedback.success {
  background: #123d31 !important;
  color: #62dfa9 !important;
}

html[data-theme="dark"] .pos-ready-feedback.error,
html[data-theme="dark"] .form-errors,
html[data-theme="dark"] .line-remove {
  background: #3d2029 !important;
  border-color: #693441 !important;
  color: #fb8fa9 !important;
}

html[data-theme="dark"] .pos-section-head > span,
html[data-theme="dark"] .activity-icon,
html[data-theme="dark"] .success-icon,
html[data-theme="dark"] .avatar,
html[data-theme="dark"] .header-avatar {
  background: #163d35 !important;
  color: #62dfa9 !important;
}

html[data-theme="dark"] .table,
html[data-theme="dark"] .table-responsive {
  --bs-table-bg: transparent;
  --bs-table-color: #ced9e1;
  --bs-table-border-color: #2a3b47;
  color: #ced9e1;
}

/* Public homepage and service surfaces use the same complete dark palette. */
html[data-theme="dark"] .atelier-home,
html[data-theme="dark"] .atelier-hero,
html[data-theme="dark"] .atelier-categories,
html[data-theme="dark"] .atelier-items {
  background: #09151d !important;
  color: #ced9e1 !important;
}

html[data-theme="dark"] .atelier-process,
html[data-theme="dark"] .atelier-tracker {
  background: #0d1a23 !important;
}

html[data-theme="dark"] .atelier-showcase article,
html[data-theme="dark"] .atelier-category-grid > a,
html[data-theme="dark"] .atelier-process-grid article:not(.featured),
html[data-theme="dark"] .atelier-item-grid > article,
html[data-theme="dark"] .atelier-tracker-card,
html[data-theme="dark"] .atelier-quality,
html[data-theme="dark"] .atelier-btn.secondary,
html[data-theme="dark"] .atelier-float.top,
html[data-theme="dark"] .atelier-badge {
  background: #12212b !important;
  border-color: #2a3b47 !important;
  color: #ced9e1 !important;
}

html[data-theme="dark"] .atelier-copy h1,
html[data-theme="dark"] .atelier-copy h1 em,
html[data-theme="dark"] .atelier-showcase h2,
html[data-theme="dark"] .atelier-showcase h2 em,
html[data-theme="dark"] .atelier-category-grid h3,
html[data-theme="dark"] .atelier-section-head h2,
html[data-theme="dark"] .atelier-centered h2,
html[data-theme="dark"] .atelier-process-grid h3,
html[data-theme="dark"] .atelier-item-grid h3,
html[data-theme="dark"] .atelier-item-grid footer strong,
html[data-theme="dark"] .atelier-tracker-card h2,
html[data-theme="dark"] .atelier-status-demo span {
  color: #edf4f7 !important;
}

html[data-theme="dark"] .atelier-copy > p,
html[data-theme="dark"] .atelier-showcase article > p,
html[data-theme="dark"] .atelier-category-grid p,
html[data-theme="dark"] .atelier-section-head p,
html[data-theme="dark"] .atelier-centered p,
html[data-theme="dark"] .atelier-process-grid p,
html[data-theme="dark"] .atelier-tracker-card > div:first-child p,
html[data-theme="dark"] .atelier-item-grid footer small {
  color: #a9b8c3 !important;
}

html[data-theme="dark"] .atelier-section-head,
html[data-theme="dark"] .atelier-trust,
html[data-theme="dark"] .atelier-card-foot,
html[data-theme="dark"] .atelier-item-grid article > footer,
html[data-theme="dark"] .atelier-status-demo {
  border-color: #2a3b47 !important;
}

html[data-theme="dark"] .system-table td,
html[data-theme="dark"] .history-order-readonly,
html[data-theme="dark"] .order-item-list > div,
html[data-theme="dark"] .payment-list > a,
html[data-theme="dark"] .payment-list > div,
html[data-theme="dark"] .configured-service-list > div,
html[data-theme="dark"] .pos-cart-line,
html[data-theme="dark"] .pos-ready-line {
  border-color: #293b47 !important;
}

html[data-theme="dark"] .system-table tbody tr:hover,
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .pos-customer-result:hover,
html[data-theme="dark"] .pos-customer-result:focus {
  background: #182b36 !important;
}

html[data-theme="dark"] .pos-workflow-tabs button.active,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .btn-secondary-system,
html[data-theme="dark"] .view-site,
html[data-theme="dark"] .branch-shift-link,
html[data-theme="dark"] .account-trigger:hover,
html[data-theme="dark"] .account-trigger[aria-expanded="true"] {
  background: #182b36 !important;
  border-color: #3b5260 !important;
  color: #dce7ed !important;
}

html[data-theme="dark"] .detail-tabs a,
html[data-theme="dark"] .finance-tabs a,
html[data-theme="dark"] .settings-tabs > a,
html[data-theme="dark"] .settings-tabs > span,
html[data-theme="dark"] .pos-category-tabs button,
html[data-theme="dark"] .payment-timing label,
html[data-theme="dark"] .category-tabs a {
  background: #12212b !important;
  border-color: #344754 !important;
  color: #ced9e1 !important;
}

html[data-theme="dark"] .detail-tabs a.active,
html[data-theme="dark"] .finance-tabs a.active,
html[data-theme="dark"] .settings-tabs > a.active,
html[data-theme="dark"] .pos-category-tabs button.active,
html[data-theme="dark"] .category-tabs a.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

html[data-theme="dark"] .pos-customer-results {
  background: #12212b;
  border-color: #344754;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .hero,
html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .soft-section {
  background: #0d1a23 !important;
}

html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .floating-pill {
  background: rgba(18, 33, 43, .96) !important;
  color: #edf4f7 !important;
}

html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .about-section {
  background: #061017 !important;
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

@media (max-width: 991px) {
  .navbar-collapse > .theme-toggle {
    margin: 10px 0;
    width: 100%;
  }
}

@media (max-width: 620px) {
  .header-actions .theme-toggle-label,
  .branch-pos-actions .theme-toggle-label {
    display: none;
  }

  .header-actions .theme-toggle,
  .branch-pos-actions .theme-toggle {
    min-height: 38px;
    padding: 9px;
  }
}

/* Compact POS catalog: faster scanning and more garments visible at once. */
.pos-category-tabs {
  gap: 6px;
  margin-bottom: 11px;
  padding-bottom: 4px;
}

.pos-category-tabs button,
html[data-theme="dark"] .pos-category-tabs button {
  min-height: 34px;
  padding: 6px 10px;
}

.pos-category-tabs button span,
.pos-category-tabs button small {
  font-size: 10px;
  line-height: 1.15;
}

.pos-item-grid {
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pos-item {
  border-radius: 11px;
}

.pos-item img {
  height: 84px;
}

.pos-item > span:last-child {
  padding: 8px;
}

.pos-item strong,
.pos-item b {
  font-size: 10.5px;
  line-height: 1.2;
}

.pos-item small {
  font-size: 9px;
  line-height: 1.2;
  margin: 2px 0 5px;
}

.pos-item-count {
  border-width: 1px;
  font-size: 9px;
  height: 23px;
  right: 5px;
  top: 5px;
  width: 23px;
}

@media (max-width: 1180px) {
  .pos-item-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .pos-item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .pos-item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-item img { height: 76px; }
}
