/* Basket POS shared light/dark appearance */
:root {
  color-scheme: light;
}

#basket-ui-preferences {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 7px;
  direction: ltr;
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(14px);
}

#basket-ui-preferences button {
  width: 38px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-family: Arial, Tahoma, sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

#basket-ui-preferences button:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

#basket-ui-preferences.basket-ui-preferences-inline {
  position: static;
  inset: auto;
  z-index: auto;
  padding: 4px;
  border-radius: 13px;
  background: #f8fafc;
  box-shadow: none;
  backdrop-filter: none;
}

#basket-ui-preferences.basket-ui-preferences-inline button {
  width: 34px;
  height: 30px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

#pos-tools-sidebar .pos-sidebar-spacer {
  flex: 1 1 auto;
  min-height: 8px;
}

#pos-tools-sidebar #basket-ui-preferences.basket-ui-preferences-sidebar {
  position: static;
  inset: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  direction: inherit;
  padding: 6px 0 0;
  margin: 0;
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

#pos-tools-sidebar #basket-ui-preferences.basket-ui-preferences-sidebar button {
  width: 100%;
  height: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  transform: none;
}

#pos-tools-sidebar #basket-ui-preferences.basket-ui-preferences-sidebar button:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: none;
}

#pos-tools-sidebar .basket-preference-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

#pos-tools-sidebar:not(:hover) #basket-ui-preferences.basket-ui-preferences-sidebar button {
  justify-content: center;
  gap: 0;
  padding-inline: 0;
}

#pos-tools-sidebar:hover #basket-ui-preferences.basket-ui-preferences-sidebar button {
  justify-content: flex-start;
}

html[dir="ltr"] body,
html[dir="ltr"] input,
html[dir="ltr"] select,
html[dir="ltr"] textarea,
html[dir="ltr"] button {
  font-family: Inter, Arial, Tahoma, sans-serif !important;
}

html[dir="ltr"] .text-right { text-align: left !important; }
html[dir="ltr"] .text-left { text-align: right !important; }
html[dir="ltr"] .right-0 { right: auto !important; left: 0 !important; }
html[dir="ltr"] .left-0 { left: auto !important; right: 0 !important; }
html[dir="ltr"] .mr-2 { margin-right: 0 !important; margin-left: .5rem !important; }
html[dir="ltr"] .pr-6 { padding-right: 0 !important; padding-left: 1.5rem !important; }
html[dir="ltr"] #pos-tools-sidebar { right: auto !important; left: 6px !important; }
html[dir="ltr"] #basket-ui-preferences { left: auto; right: 14px; }
html[dir="ltr"] #basket-ui-preferences.basket-ui-preferences-inline {
  left: auto;
  right: auto;
}

@media (min-width: 1024px) {
  html[dir="ltr"] body > main {
    margin-right: 0 !important;
    margin-left: 50px !important;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --text-main: #e5edf8;
  --text: #e5edf8;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary-light: #172554;
  --surface: #111827;
  --surface-soft: #0f172a;
}

@media screen {
  html[data-theme="dark"] body {
    background: #080f1d !important;
    color: #e5edf8 !important;
  }

  html[data-theme="dark"] #basket-ui-preferences {
    background: rgba(15, 23, 42, 0.94);
    border-color: #334155;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  }

  html[data-theme="dark"] #basket-ui-preferences button {
    background: #1e293b;
    color: #e2e8f0;
  }

  html[data-theme="dark"] #basket-ui-preferences button:hover {
    background: #1e3a8a;
  }

  html[data-theme="dark"] #basket-ui-preferences.basket-ui-preferences-inline {
    background: #0f172a;
    border-color: #334155;
    box-shadow: none;
  }

  html[data-theme="dark"] #basket-ui-preferences.basket-ui-preferences-inline button {
    background: #1e293b;
    border-color: #334155;
  }

  html[data-theme="dark"] #pos-tools-sidebar #basket-ui-preferences.basket-ui-preferences-sidebar {
    background: transparent;
    border-color: #334155;
  }

  html[data-theme="dark"] #pos-tools-sidebar #basket-ui-preferences.basket-ui-preferences-sidebar button {
    background: transparent;
    border-color: transparent;
    color: #cbd5e1;
  }

  html[data-theme="dark"] #pos-tools-sidebar #basket-ui-preferences.basket-ui-preferences-sidebar button:hover {
    background: #1e3a8a;
    color: #dbeafe;
  }

  html[data-theme="dark"] .bg-white,
  html[data-theme="dark"] .bg-white\/80,
  html[data-theme="dark"] .bg-white\/90,
  html[data-theme="dark"] .bg-white\/95,
  html[data-theme="dark"] [class*="bg-white/"] {
    background-color: #111827 !important;
  }

  html[data-theme="dark"] .bg-slate-50,
  html[data-theme="dark"] .bg-slate-50\/50,
  html[data-theme="dark"] .bg-slate-50\/60,
  html[data-theme="dark"] .bg-slate-100,
  html[data-theme="dark"] .bg-gray-50,
  html[data-theme="dark"] .bg-gray-100,
  html[data-theme="dark"] [class*="bg-slate-50/"],
  html[data-theme="dark"] [class*="bg-gray-50/"] {
    background-color: #0f172a !important;
  }

  html[data-theme="dark"] .hover\:bg-slate-50:hover,
  html[data-theme="dark"] .hover\:bg-slate-100:hover,
  html[data-theme="dark"] .hover\:bg-gray-50:hover,
  html[data-theme="dark"] .hover\:bg-gray-100:hover {
    background-color: #1e293b !important;
  }

  html[data-theme="dark"] .text-slate-900,
  html[data-theme="dark"] .text-slate-800,
  html[data-theme="dark"] .text-slate-700,
  html[data-theme="dark"] .text-gray-900,
  html[data-theme="dark"] .text-gray-800,
  html[data-theme="dark"] .text-gray-700 {
    color: #e5edf8 !important;
  }

  html[data-theme="dark"] .text-slate-600,
  html[data-theme="dark"] .text-slate-500,
  html[data-theme="dark"] .text-gray-600,
  html[data-theme="dark"] .text-gray-500 {
    color: #b8c5d8 !important;
  }

  html[data-theme="dark"] .text-slate-400,
  html[data-theme="dark"] .text-gray-400 {
    color: #94a3b8 !important;
  }

  html[data-theme="dark"] .border,
  html[data-theme="dark"] .border-slate-50,
  html[data-theme="dark"] .border-slate-100,
  html[data-theme="dark"] .border-slate-200,
  html[data-theme="dark"] .border-slate-300,
  html[data-theme="dark"] .border-gray-100,
  html[data-theme="dark"] .border-gray-200,
  html[data-theme="dark"] .border-gray-300,
  html[data-theme="dark"] [class*="border-slate-"],
  html[data-theme="dark"] [class*="border-gray-"] {
    border-color: #334155 !important;
  }

  html[data-theme="dark"] input,
  html[data-theme="dark"] select,
  html[data-theme="dark"] textarea {
    background-color: #0b1220 !important;
    border-color: #3b4a60 !important;
    color: #f1f5f9 !important;
  }

  html[data-theme="dark"] input::placeholder,
  html[data-theme="dark"] textarea::placeholder {
    color: #64748b !important;
  }

  html[data-theme="dark"] option {
    background: #0f172a;
    color: #f1f5f9;
  }

  html[data-theme="dark"] table,
  html[data-theme="dark"] tbody,
  html[data-theme="dark"] .log-table-wrap,
  html[data-theme="dark"] .log-filter-bar,
  html[data-theme="dark"] .log-modal-header {
    background-color: #111827 !important;
    color: #e5edf8 !important;
    border-color: #334155 !important;
  }

  html[data-theme="dark"] #pos-tools-sidebar,
  html[data-theme="dark"] .topbar-btn,
  html[data-theme="dark"] .app-btn,
  html[data-theme="dark"] .log-icon-btn,
  html[data-theme="dark"] #sidebar-flyout {
    background-color: #111827 !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
  }

  html[data-theme="dark"] .pos-sidebar-brand {
    border-color: #334155 !important;
  }

  html[data-theme="dark"] thead,
  html[data-theme="dark"] th {
    background-color: #162033 !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
  }

  html[data-theme="dark"] td,
  html[data-theme="dark"] tr {
    border-color: #273449 !important;
  }

  html[data-theme="dark"] tbody tr:hover {
    background-color: #162033 !important;
  }

  html[data-theme="dark"] .shadow,
  html[data-theme="dark"] .shadow-sm,
  html[data-theme="dark"] .shadow-md,
  html[data-theme="dark"] .shadow-lg,
  html[data-theme="dark"] .shadow-xl,
  html[data-theme="dark"] .shadow-2xl {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32) !important;
  }

  html[data-theme="dark"] hr {
    border-color: #334155 !important;
  }
}

@media (max-width: 640px) {
  #basket-ui-preferences {
    left: 8px;
    bottom: 8px;
    padding: 5px;
  }

  html[dir="ltr"] #basket-ui-preferences {
    left: auto;
    right: 8px;
  }

  #basket-ui-preferences button {
    width: 34px;
    height: 31px;
  }

  #basket-ui-preferences.basket-ui-preferences-inline {
    position: static;
    inset: auto;
    padding: 3px;
  }
}
