:root,
html[data-theme="light"] {
  --pos-font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --pos-font-ar: "Cairo", "IBM Plex Sans", "Segoe UI", sans-serif;
  --diraya-orange: #f59e0b;
  --diraya-orange-strong: #d97706;
  --diraya-orange-light: #fbbf24;
  --diraya-orange-muted: rgba(245, 158, 11, 0.12);
  --diraya-charcoal: #374151;
  --diraya-gray: #4b5563;
  --diraya-gray-medium: #6b7280;
  --diraya-gray-light: #9ca3af;
  --pos-bg: #f8f9fa;
  --pos-surface: #fff;
  --pos-surface-2: #f3f4f6;
  --pos-border: #e5e7eb;
  --pos-text: #111827;
  --pos-muted: #6b7280;
  --pos-accent: var(--diraya-orange);
  --pos-accent-strong: var(--diraya-orange-strong);
  --pos-sidebar-bg: #fff;
  --pos-sidebar-border: rgba(15, 23, 42, 0.06);
  --pos-sidebar-text: #374151;
  --pos-sidebar-muted: #6b7280;
  --pos-sidebar-label: #9ca3af;
  --pos-sidebar-hover: rgba(245, 158, 11, 0.08);
  --pos-sidebar-active-bg: rgba(245, 158, 11, 0.12);
  --pos-sidebar-active-text: #d97706;
  --pos-sidebar-brand-bg: #fff;
  --pos-sidebar-width: 240px;
  --pos-sidebar-collapsed-width: 76px;
  --pos-sidebar-inset: 18px;
  --pos-sidebar-gap: 16px;
  --pos-sidebar-radius: 24px;
  --pos-sidebar-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06);
  --pos-header-height: 4.25rem;
  --pos-topbar-height: 4.25rem;
  --pos-topbar-radius: 22px;
  --pos-topbar-control-size: 2.5rem;
  --pos-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  --pos-chip-bg: #ffffff;
  --pos-chip-border: #e5e7eb;
  --pos-overlay: rgba(0, 0, 0, 0.28);
  --pos-hero-bg: radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 45%), linear-gradient(135deg, #000000 0%, #1f2937 100%);
  --pos-tile-hover-border: #d1d5db;
  --pos-kpi-accent: var(--diraya-orange);
  --pos-focus-ring: rgba(245, 158, 11, 0.35);
}

html[data-theme="dark"] {
  --pos-bg: #000000;
  --pos-surface: #111827;
  --pos-surface-2: #1f2937;
  --pos-border: #374151;
  --pos-text: #f9fafb;
  --pos-muted: #9ca3af;
  --pos-accent: var(--diraya-orange);
  --pos-accent-strong: var(--diraya-orange-light);
  --pos-sidebar-bg: #111827;
  --pos-sidebar-border: rgba(255, 255, 255, 0.08);
  --pos-sidebar-text: #e5e7eb;
  --pos-sidebar-muted: #9ca3af;
  --pos-sidebar-label: #6b7280;
  --pos-sidebar-hover: rgba(245, 158, 11, 0.1);
  --pos-sidebar-active-bg: rgba(245, 158, 11, 0.16);
  --pos-sidebar-active-text: #fbbf24;
  --pos-sidebar-brand-bg: #ffffff;
  --pos-sidebar-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.35);
  --pos-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 12px 32px rgba(0, 0, 0, 0.4);
  --pos-chip-bg: #1f2937;
  --pos-chip-border: #374151;
  --pos-overlay: rgba(0, 0, 0, 0.42);
  --pos-hero-bg: radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 45%), linear-gradient(135deg, #000000 0%, #374151 100%);
  --pos-tile-hover-border: #4b5563;
  --pos-kpi-accent: var(--diraya-orange-light);
  --pos-focus-ring: rgba(245, 158, 11, 0.4);
}

html {
  font-size: 13px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 1400px) {
  html {
    font-size: 15px;
  }
}

@media (min-width: 1680px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--pos-surface), 0 0 0 0.25rem var(--pos-focus-ring);
}

.btn-primary {
  background-color: var(--diraya-orange) !important;
  border-color: var(--diraya-orange-strong) !important;
  color: #000 !important;
  font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--diraya-orange-strong) !important;
  border-color: var(--diraya-orange-strong) !important;
  color: #000 !important;
}

html,
body {
  height: 100%;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--pos-bg);
  color: var(--pos-text);
  font-family: var(--pos-font);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pos-sidebar,
.pos-topbar,
.pos-footer {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .pos-sidebar,
  .pos-nav-link,
  .pos-brand-text,
  .pos-nav-label,
  .pos-nav-link span,
  .pos-sidebar-user,
  .pos-sidebar-user-meta,
  .pos-sidebar-user-chevron {
    transition: none !important;
  }
}

html[dir="rtl"] body {
  font-family: var(--pos-font-ar);
}

/* POS shell layout */
.pos-shell {
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  min-height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  gap: var(--pos-sidebar-gap);
}

.pos-sidebar {
  width: var(--pos-sidebar-width);
  background: var(--pos-sidebar-bg);
  color: var(--pos-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: var(--pos-sidebar-inset);
  align-self: flex-start;
  margin-block: var(--pos-sidebar-inset);
  margin-inline-start: var(--pos-sidebar-inset);
  height: calc(100dvh - (2 * var(--pos-sidebar-inset)));
  max-height: calc(100dvh - (2 * var(--pos-sidebar-inset)));
  overflow: hidden;
  z-index: 40;
  border: 1px solid var(--pos-sidebar-border);
  border-radius: var(--pos-sidebar-radius);
  box-shadow: var(--pos-sidebar-shadow);
  transition:
    width 0.22s ease,
    box-shadow 0.22s ease,
    border-radius 0.22s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

html[data-theme="dark"] .pos-sidebar {
  box-shadow: var(--pos-sidebar-shadow);
}

.pos-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--pos-sidebar-border);
  min-height: 4.5rem;
  box-sizing: border-box;
  flex-shrink: 0;
}

.pos-brand-text {
  min-width: 0;
  flex: 1;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.pos-brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(245, 158, 11, 0.28);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 0;
  margin: 0;
  cursor: default;
  appearance: none;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pos-sidebar-collapse-btn,
.pos-sidebar-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pos-sidebar-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.pos-sidebar-close-btn {
  display: none;
}

.pos-sidebar-collapse-btn:hover,
.pos-sidebar-close-btn:hover {
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--diraya-orange);
  background: var(--pos-sidebar-hover);
}

html[dir="rtl"] .pos-sidebar-collapse-btn i {
  transform: scaleX(-1);
}

html[data-theme="dark"] .pos-brand-mark {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.pos-brand-mark img {
  width: 2.15rem;
  height: 2.15rem;
  object-fit: contain;
}

.pos-nav {
  padding: 0.7rem 0.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.45) transparent;
}

.pos-nav::-webkit-scrollbar {
  width: 4px;
}

.pos-nav::-webkit-scrollbar-track {
  background: transparent;
}

.pos-nav::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.45);
  border-radius: 999px;
}

.pos-nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pos-sidebar-label);
  margin: 0.95rem 0.7rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.pos-nav-label:first-child {
  margin-top: 0.25rem;
}

.pos-brand-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--pos-sidebar-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-brand-sub {
  font-size: 0.68rem;
  color: var(--pos-sidebar-muted);
  letter-spacing: 0.02em;
  margin-top: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.85rem;
  color: var(--pos-sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  border-inline-start: 2px solid transparent;
  background: transparent;
  margin-bottom: 0.15rem;
}

.pos-nav-link i {
  width: 1.2rem;
  text-align: center;
  opacity: 0.88;
  color: var(--pos-sidebar-muted);
  flex-shrink: 0;
  font-size: 0.95rem;
  transition: color 0.18s ease;
}

.pos-nav-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.pos-nav-link:hover {
  background: var(--pos-sidebar-hover);
  color: var(--pos-sidebar-text);
  text-decoration: none;
}

.pos-nav-link:hover i {
  color: var(--diraya-orange);
}

.pos-nav-link.active {
  background: var(--pos-sidebar-active-bg);
  color: var(--pos-sidebar-active-text);
  border-inline-start-color: var(--diraya-orange);
  font-weight: 600;
}

.pos-nav-link.active i {
  color: #f59e0b;
  opacity: 1;
}

html[dir="rtl"] .pos-nav-link {
  border-inline-start: none;
  border-inline-end: 2px solid transparent;
}

html[dir="rtl"] .pos-nav-link.active {
  border-inline-start: none;
  border-inline-end-color: var(--diraya-orange);
}

.pos-sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--pos-sidebar-border);
  flex-shrink: 0;
}

.pos-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.85rem;
  text-decoration: none;
  color: var(--pos-sidebar-text);
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease;
}

.pos-sidebar-user:hover {
  background: var(--pos-sidebar-hover);
  color: var(--pos-sidebar-text);
  text-decoration: none;
}

.pos-sidebar-user-avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--diraya-orange-strong);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.pos-sidebar-user-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.pos-sidebar-user-name {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-sidebar-user-role {
  font-size: 0.7rem;
  color: var(--pos-sidebar-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-sidebar-user-chevron {
  font-size: 0.7rem;
  color: var(--pos-sidebar-label);
  flex-shrink: 0;
  opacity: 1;
  transition: opacity 0.2s ease, color 0.18s ease;
}

html[dir="rtl"] .pos-sidebar-user-chevron {
  transform: scaleX(-1);
}

.pos-sidebar-user:hover .pos-sidebar-user-chevron {
  color: var(--diraya-orange);
}

.pos-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: var(--pos-sidebar-inset);
  padding-inline-end: var(--pos-sidebar-inset);
  box-sizing: border-box;
}

.pos-shell-terminal .pos-main {
  padding-inline-end: 0;
}

turbo-frame#app-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

turbo-frame#app-content[busy] #appContentMain {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.pos-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.15rem;
  margin-inline-end: 0;
  margin-bottom: var(--pos-sidebar-gap);
  background: var(--pos-sidebar-bg);
  border: 1px solid var(--pos-sidebar-border);
  border-radius: var(--pos-topbar-radius);
  box-shadow: var(--pos-sidebar-shadow);
  position: relative;
  z-index: 30;
  flex-shrink: 0;
  --pos-topbar-height: 4.25rem;
  height: var(--pos-topbar-height);
  min-height: var(--pos-topbar-height);
  max-height: var(--pos-topbar-height);
  box-sizing: border-box;
}

.pos-topbar-start {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 12rem;
}

.pos-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pos-sidebar-border);
  background: rgba(243, 244, 246, 0.9);
  width: var(--pos-topbar-control-size);
  height: var(--pos-topbar-control-size);
  border-radius: 0.85rem;
  color: var(--pos-text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pos-menu-btn:hover {
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--diraya-orange-strong);
  background: var(--diraya-orange-muted);
}

.pos-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-shrink: 0;
}

.pos-topbar-brand img {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  flex-shrink: 0;
}

.pos-topbar-brand span {
  font-weight: 700;
  color: var(--pos-text);
  font-size: 0.92rem;
  white-space: nowrap;
}

.pos-topbar-title {
  font-weight: 700;
  color: var(--pos-text);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.pos-topbar-title:empty,
.pos-topbar-title.is-pos-hidden {
  display: none;
}

.pos-topbar-search {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 42rem;
}

.pos-shell-terminal .pos-topbar-search:not([hidden]),
.pos-shell-workstation .pos-topbar-search:not([hidden]) {
  display: flex;
}

.pos-topbar-filter-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--pos-border);
  border-radius: 0.65rem;
  background: var(--pos-surface-2);
  color: var(--pos-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pos-shell-terminal .pos-topbar-filter-btn:not([hidden]) {
  display: inline-flex;
}

body.workstation-panel-pos .pos-topbar-filter-btn:not([hidden]) {
  display: none;
}

.pos-topbar-filter-btn:hover {
  border-color: var(--diraya-orange);
  color: var(--diraya-orange);
}

.pos-topbar-filter-btn.is-open,
.pos-topbar-filter-btn.is-active {
  border-color: var(--diraya-orange);
  background: rgba(245, 158, 11, 0.12);
  color: var(--diraya-orange-strong);
}

.pos-topbar-filter-btn {
  position: relative;
}

.pos-topbar-queue-badge {
  position: absolute;
  top: -0.25rem;
  inset-inline-end: -0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--diraya-orange);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1rem;
  pointer-events: none;
}

.pos-topbar-queue-badge.hidden {
  display: none !important;
}

.pos-queue-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.85rem 1rem;
  background: var(--pos-bg);
}

.pos-queue-overlay.hidden {
  display: none !important;
}

.pos-queue-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.pos-queue-head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  color: var(--pos-text);
}

.pos-queue-back,
.pos-queue-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--pos-border);
  border-radius: 0.65rem;
  background: var(--pos-surface);
  color: var(--pos-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.pos-queue-back.hidden,
.pos-queue-refresh.hidden {
  display: none !important;
}

.pos-queue-back:hover,
.pos-queue-refresh:hover {
  border-color: var(--diraya-orange);
  color: var(--diraya-orange-strong);
}

.pos-queue-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  flex-shrink: 0;
}

.pos-queue-pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 9rem;
  padding: 1.1rem 0.85rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.85rem;
  background: var(--pos-surface);
  color: var(--pos-text);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.pos-queue-pick-card:hover {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.08);
  transform: translateY(-1px);
}

.pos-queue-pick-card i {
  font-size: 1.35rem;
  color: var(--diraya-orange-strong);
}

.pos-queue-pick-card strong {
  font-size: 0.95rem;
}

.pos-queue-pick-card span:not(.pos-queue-pick-badge) {
  font-size: 0.78rem;
  color: var(--pos-muted);
}

.pos-queue-pick-badge {
  position: absolute;
  top: 0.55rem;
  inset-inline-end: 0.55rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--diraya-orange);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25rem;
}

.pos-queue-pick-badge.hidden {
  display: none !important;
}

.pos-queue-overlay .employee-hub-list {
  flex: 1;
  min-height: 0;
}

.employee-hub-card.is-clickable {
  cursor: pointer;
}

@media (max-width: 640px) {
  .pos-queue-picker {
    grid-template-columns: 1fr;
  }
}

.pos-topbar-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.pos-inline-form {
  margin: 0;
}

.pos-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--pos-chip-border);
  background: var(--pos-chip-bg);
  color: var(--pos-text);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pos-chip:hover {
  border-color: var(--pos-accent);
  background: var(--diraya-orange-muted);
}

/* Professional theme switch */
.pos-theme-toggle,
.pos-lang-toggle {
  --theme-toggle-pad: 0.16rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--pos-sidebar-border);
  background: rgba(243, 244, 246, 0.9);
  color: var(--pos-text);
  border-radius: 999px;
  padding: 0.22rem;
  cursor: pointer;
  isolation: isolate;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.18s ease;
}

.pos-theme-toggle:hover,
.pos-lang-toggle:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--diraya-orange-muted);
  box-shadow: none;
}

.pos-theme-toggle:focus-visible,
.pos-lang-toggle:focus-visible {
  outline: none;
  border-color: var(--pos-accent);
  box-shadow: 0 0 0 3px var(--pos-focus-ring);
}

.pos-theme-toggle:active,
.pos-lang-toggle:active {
  transform: scale(0.97);
}

.pos-theme-toggle-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 3.85rem;
  height: 1.95rem;
  padding: var(--theme-toggle-pad);
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(160deg, #dbeafe 0%, #fde68a 52%, #fed7aa 100%);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.45);
  transition: background 0.45s ease, box-shadow 0.45s ease;
}

.pos-theme-toggle.is-dark .pos-theme-toggle-track {
  background: linear-gradient(160deg, #020617 0%, #0f172a 48%, #1e293b 100%);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.55),
    inset 0 0 12px rgba(59, 130, 246, 0.12);
}

.pos-theme-toggle-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.55), transparent 28%),
    radial-gradient(circle at 28% 72%, rgba(255, 255, 255, 0.18), transparent 34%);
  opacity: 1;
  transition: opacity 0.4s ease;
}

.pos-theme-toggle.is-dark .pos-theme-toggle-sky {
  opacity: 0;
}

.pos-theme-toggle-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.pos-theme-toggle.is-dark .pos-theme-toggle-stars {
  opacity: 1;
}

.pos-theme-toggle-stars span {
  position: absolute;
  width: 0.18rem;
  height: 0.18rem;
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: 0 0 6px rgba(248, 250, 252, 0.85);
}

.pos-theme-toggle-stars span:nth-child(1) {
  top: 22%;
  left: 18%;
  animation: pos-theme-star 2.4s ease-in-out infinite;
}

.pos-theme-toggle-stars span:nth-child(2) {
  top: 58%;
  left: 30%;
  width: 0.12rem;
  height: 0.12rem;
  animation: pos-theme-star 2.8s ease-in-out 0.35s infinite;
}

.pos-theme-toggle-stars span:nth-child(3) {
  top: 28%;
  left: 42%;
  width: 0.14rem;
  height: 0.14rem;
  animation: pos-theme-star 2.1s ease-in-out 0.7s infinite;
}

@keyframes pos-theme-star {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.pos-theme-toggle-option {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  opacity: 0.45;
  transition: opacity 0.3s ease, color 0.3s ease, transform 0.35s ease;
}

.pos-theme-toggle.is-light .pos-theme-toggle-option.dark,
.pos-theme-toggle.is-dark .pos-theme-toggle-option.light {
  opacity: 0.55;
}

.pos-theme-toggle.is-light .pos-theme-toggle-option.light,
.pos-theme-toggle.is-dark .pos-theme-toggle-option.dark {
  opacity: 0;
  transform: scale(0.7);
}

.pos-theme-toggle-option.light i {
  color: #b45309;
}

.pos-theme-toggle-option.dark i {
  color: #93c5fd;
}

.pos-theme-toggle-thumb {
  position: absolute;
  top: var(--theme-toggle-pad);
  left: var(--theme-toggle-pad);
  width: calc(50% - var(--theme-toggle-pad));
  height: calc(100% - (var(--theme-toggle-pad) * 2));
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.18),
    0 6px 14px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 0.45s cubic-bezier(0.22, 1.4, 0.36, 1),
    background 0.35s ease,
    box-shadow 0.35s ease;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.pos-theme-toggle.is-dark .pos-theme-toggle-thumb {
  transform: translateX(100%);
  background: linear-gradient(160deg, #fde68a 0%, #f59e0b 55%, #d97706 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 0 16px rgba(245, 158, 11, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pos-theme-toggle-thumb-icon {
  position: absolute;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  transition: opacity 0.28s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.pos-theme-toggle-thumb-icon.sun {
  color: #d97706;
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.pos-theme-toggle-thumb-icon.moon {
  color: #1e3a5f;
  opacity: 0;
  transform: rotate(-40deg) scale(0.55);
}

.pos-theme-toggle.is-dark .pos-theme-toggle-thumb-icon.sun {
  opacity: 0;
  transform: rotate(40deg) scale(0.55);
}

.pos-theme-toggle.is-dark .pos-theme-toggle-thumb-icon.moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.pos-lang-toggle-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 3.85rem;
  height: 1.95rem;
  padding: var(--theme-toggle-pad);
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, #e5e7eb, #f3f4f6);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

html[data-theme="dark"] .pos-lang-toggle-track {
  background: linear-gradient(180deg, #0b1220, #1f2937);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.pos-lang-toggle-option {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--pos-muted);
  transition: color 0.25s ease, opacity 0.25s ease;
}

.pos-lang-toggle.is-en .pos-lang-toggle-option.en,
.pos-lang-toggle.is-ar .pos-lang-toggle-option.ar {
  opacity: 0;
}

.pos-lang-toggle.is-en .pos-lang-toggle-option.ar,
.pos-lang-toggle.is-ar .pos-lang-toggle-option.en {
  opacity: 0.75;
  color: var(--pos-muted);
}

.pos-lang-toggle-thumb {
  position: absolute;
  top: var(--theme-toggle-pad);
  left: var(--theme-toggle-pad);
  width: calc(50% - var(--theme-toggle-pad));
  height: calc(100% - (var(--theme-toggle-pad) * 2));
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.18),
    0 6px 14px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 0.45s cubic-bezier(0.22, 1.4, 0.36, 1),
    background 0.35s ease,
    box-shadow 0.35s ease;
  z-index: 2;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 750;
  color: #111827;
}

.pos-lang-toggle.is-ar .pos-lang-toggle-thumb {
  transform: translateX(100%);
  background: linear-gradient(160deg, #fde68a 0%, #f59e0b 55%, #d97706 100%);
  color: #1f2937;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 0 14px rgba(245, 158, 11, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pos-lang-toggle.is-en .pos-lang-toggle-thumb::after {
  content: "EN";
}

.pos-lang-toggle.is-ar .pos-lang-toggle-thumb::after {
  content: "عر";
}

/* Circular page reveal when switching themes */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
  animation: pos-theme-reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pos-theme-reveal {
  from {
    clip-path: circle(0% at var(--theme-x, 50%) var(--theme-y, 50%));
  }
  to {
    clip-path: circle(150% at var(--theme-x, 50%) var(--theme-y, 50%));
  }
}

/* Fallback soft fade when View Transitions are unavailable */
html.theme-animating,
html.theme-animating body,
html.theme-animating .pos-shell,
html.theme-animating .pos-sidebar,
html.theme-animating .pos-topbar,
html.theme-animating .pos-content,
html.theme-animating .pos-chip,
html.theme-animating .pos-nav-link,
html.theme-animating .pos-brand,
html.theme-animating .card,
html.theme-animating .modal-content,
html.theme-animating .table,
html.theme-animating .form-control,
html.theme-animating .form-select {
  transition:
    background-color 0.45s ease,
    color 0.45s ease,
    border-color 0.45s ease,
    box-shadow 0.45s ease,
    fill 0.45s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  .pos-theme-toggle,
  .pos-lang-toggle,
  .pos-theme-toggle-track,
  .pos-lang-toggle-track,
  .pos-theme-toggle-thumb,
  .pos-lang-toggle-thumb,
  .pos-theme-toggle-thumb-icon,
  .pos-theme-toggle-option,
  .pos-lang-toggle-option,
  .pos-theme-toggle-sky,
  .pos-theme-toggle-stars,
  .pos-theme-toggle-stars span {
    transition: none !important;
    animation: none !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

.pos-topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 8.5rem;
  min-height: var(--pos-topbar-control-size);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--pos-sidebar-border);
  background: rgba(243, 244, 246, 0.85);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pos-sidebar-text);
  margin-inline-start: 0.1rem;
}

.pos-topbar-meta-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--diraya-orange);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
  flex-shrink: 0;
}

html[data-theme="dark"] .pos-menu-btn,
html[data-theme="dark"] .pos-notification-bell,
html[data-theme="dark"] .pos-topbar-logout,
html[data-theme="dark"] .pos-theme-toggle,
html[data-theme="dark"] .pos-lang-toggle,
html[data-theme="dark"] .pos-topbar-meta {
  background: rgba(31, 41, 55, 0.9);
}

html[data-theme="dark"] .pos-topbar .pos-terminal-search-wrap {
  background: rgba(31, 41, 55, 0.92);
}

html[data-theme="dark"] .pos-topbar .pos-terminal-search-wrap:focus-within {
  background: #111827;
}

@media (max-width: 1280px) {
  .pos-topbar-search {
    max-width: none;
  }

  .pos-topbar-meta-name {
    max-width: 5.5rem;
  }

  .pos-topbar-actions {
    gap: 0.4rem;
  }
}

@media (max-width: 1100px) {
  .pos-topbar-meta-name {
    display: none;
  }

  .pos-topbar-meta {
    padding-inline: 0.55rem;
    max-width: none;
  }

  .pos-topbar-title {
    font-size: 1rem;
  }

  .pos-lang-toggle-track {
    width: 3.35rem;
  }
}

@media (max-width: 900px) {
  .pos-topbar {
    gap: 0.5rem;
    padding-inline: 0.75rem;
  }

  .pos-topbar .pos-terminal-search-wrap {
    min-height: 2.85rem;
    height: 2.85rem;
  }

  .pos-topbar-start {
    max-width: 6.5rem;
  }
}

.pos-content {
  padding: 0.85rem 1rem;
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.pos-content:has(> .page-list) {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.pos-content:has(> .page-list) > .page-list {
  flex: 1 1 auto;
  min-height: 0;
}

.pos-content:has(> .page-list) > script,
.pos-content:has(> .page-list) > [id$="Modal"],
.pos-content:has(> .page-list) > .hidden,
.pos-content:has(> .page-list) > [hidden] {
  flex: 0 0 auto;
}

.pos-footer {
  padding: 0.85rem 1.25rem;
  color: var(--pos-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--pos-border);
  background: var(--pos-surface);
}

.pos-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--pos-overlay);
  z-index: 35;
}

.pos-overlay.show {
  display: block;
}

/* Dashboard analytics workspace */
.dash-analytics {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
}

.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--pos-surface) 0%, rgba(245, 158, 11, 0.06) 100%);
}

.dash-hero-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--diraya-orange-strong);
}

.dash-hero-title {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--pos-text);
  letter-spacing: -0.02em;
}

.dash-hero-sub {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--pos-muted);
}

.dash-hero-sub .is-up {
  color: #059669;
}

.dash-hero-sub .is-down {
  color: #dc2626;
}

.dash-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dash-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface-2);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pos-text);
}

.dash-hero-badge.is-warn {
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.35);
}

.dash-kpi-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.dash-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem 0.65rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.95rem;
  background: var(--pos-surface);
  min-height: 8.5rem;
}

.dash-kpi-card--accent {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--pos-surface) 100%);
}

.dash-kpi-card-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dash-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.5rem;
  background: rgba(245, 158, 11, 0.14);
  color: var(--diraya-orange-strong);
  font-size: 0.78rem;
}

.dash-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pos-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--pos-text);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.dash-kpi-value.warn {
  color: #d97706;
}

.dash-kpi-meta {
  font-size: 0.75rem;
  color: var(--pos-muted);
}

.dash-kpi-spark {
  height: 2.4rem;
  margin-top: 0.25rem;
}

.dash-kpi-compact {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
}

.dash-chip {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.75rem;
  background: var(--pos-surface-2);
  min-width: 0;
}

.dash-chip span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--pos-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-chip strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--pos-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-chip strong.warn {
  color: #d97706;
}

.dash-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(280px, auto);
  gap: 0.85rem;
  grid-auto-flow: dense;
}

.dash-bento-item {
  min-height: 280px;
}

.dash-bento-item--wide {
  grid-column: span 2;
}

.dash-bento-item--table {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.dash-bento-item--table .dash-feed,
.dash-bento-item--table .dash-table-wrap,
.dash-bento-item--table .dash-empty {
  flex: 1 1 auto;
}

.dash-bento-item--cash {
  display: flex;
  flex-direction: column;
}

.dash-cash-drawer-mini {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.35rem;
  padding: 0 0.85rem 0.85rem;
  min-height: 0;
}

.dash-cash-drawer-balances {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.dash-cash-drawer-balances div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  background: var(--pos-surface-2);
  border: 1px solid var(--pos-border);
}

.dash-cash-drawer-balances span {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--pos-muted);
  text-transform: uppercase;
}

.dash-cash-drawer-balances strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--pos-text);
}

.dash-panel-body--chart {
  height: 220px;
  min-height: 220px;
}

.dash-panel-body--donut {
  height: 240px;
  min-height: 240px;
}

.dash-panel-body--mini-chart {
  flex: 1 1 auto;
  height: auto;
  min-height: 120px;
  padding: 0.25rem 0 0;
}


.dash-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  background: var(--pos-surface);
  position: sticky;
  top: 0;
  z-index: 12;
}

.dash-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 0.75rem;
  width: 100%;
}

.dash-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  flex: 0 0 auto;
  padding-bottom: 0.15rem;
}

.dash-preset {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--pos-border);
  border-radius: 999px;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.dash-preset:hover {
  border-color: var(--diraya-orange);
}

.dash-preset.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--diraya-orange);
  color: var(--diraya-orange-strong);
}

.dash-range-fields {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem;
  align-items: end;
  flex: 1 1 auto;
  min-width: 0;
}

.dash-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 8.5rem;
  flex: 0 0 auto;
}

.dash-field span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pos-muted);
}

.dash-input {
  min-height: 2.5rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.65rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  font: inherit;
}

.dash-apply-btn,
.dash-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  flex: 0 0 auto;
}

.dash-apply-btn {
  background: var(--pos-surface-2);
  border: 1px solid var(--pos-border);
  color: var(--pos-text);
}

.dash-export-btn {
  background: var(--diraya-orange);
  color: #111;
}

.dash-export-btn:hover {
  background: var(--diraya-orange-strong);
}

.dash-report-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 10rem;
  flex: 1 1 10rem;
}

.dash-report-select-wrap label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pos-muted);
}

@media (max-width: 1100px) {
  .dash-filter-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .dash-range-fields {
    flex-wrap: wrap;
    width: 100%;
  }
}

.dash-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

.dash-kpi-strip-secondary {
  margin-top: -0.25rem;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.95rem;
  background: var(--pos-surface);
}

.dash-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pos-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pos-text);
  letter-spacing: -0.02em;
}

.dash-stat-value.accent {
  color: var(--diraya-orange-strong);
}

.dash-stat-value.warn {
  color: #d97706;
}

.dash-stat-meta {
  font-size: 0.78rem;
  color: var(--pos-muted);
}

.dash-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.dash-chart-grid-main {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-chart-grid-main .dash-panel-wide {
  grid-column: span 2;
}

.dash-chart-grid-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-chart-grid-3 {
  grid-template-columns: 1.4fr 1fr 1fr;
}

.dash-panel-wide {
  grid-column: 1 / -1;
}

.dash-chart-grid-3 .dash-panel-wide {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.dash-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  background: var(--pos-surface);
  overflow: hidden;
}

.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.35rem;
}

.dash-panel-head h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--pos-text);
}

.dash-panel-head p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--pos-muted);
}

.dash-panel-body {
  position: relative;
  height: 220px;
  padding: 0.35rem 0.85rem 0.95rem;
}

.dash-panel-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--diraya-orange-strong);
  text-decoration: none;
  white-space: nowrap;
}

.dash-panel-link:hover {
  text-decoration: underline;
}

.dash-cash-drawer-panel .dash-panel-body {
  height: auto;
  padding: 0.75rem 1rem 1rem;
}

.dash-cash-drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.dash-cash-drawer-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.85rem;
  background: var(--pos-surface-2);
}

.dash-cash-drawer-label {
  font-size: 0.78rem;
  color: var(--pos-muted);
  font-weight: 600;
}

.dash-cash-drawer-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--pos-text);
  line-height: 1.2;
}

.dash-cash-drawer-meta {
  font-size: 0.72rem;
  color: var(--pos-muted);
  line-height: 1.35;
}

.dash-panel-donut {
  height: 240px;
}

.dash-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0.85rem;
}

.dash-feed {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dash-feed li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
  border-radius: 0.7rem;
  background: var(--pos-surface-2);
}

.dash-feed strong {
  display: block;
  font-size: 0.88rem;
  color: var(--pos-text);
}

.dash-feed span {
  font-size: 0.78rem;
  color: var(--pos-muted);
}

.dash-feed-meta {
  text-align: end;
}

.dash-feed-meta strong {
  color: var(--diraya-orange-strong);
}

.dash-table-wrap {
  padding: 0 0.85rem 0.95rem;
  overflow-x: auto;
}

.dash-empty {
  margin: 0;
  padding: 1.25rem 1rem 1.4rem;
  color: var(--pos-muted);
  font-size: 0.9rem;
}

.dash-table td.warn {
  color: #d97706;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .dash-chart-grid,
  .dash-chart-grid-main,
  .dash-chart-grid-secondary,
  .dash-chart-grid-3,
  .dash-secondary-grid,
  .dash-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-kpi-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-kpi-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-chart-grid-main .dash-panel-wide,
  .dash-chart-grid-3 .dash-panel-wide,
  .dash-bento-item--wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .dash-filter-bar {
    position: static;
  }

  .dash-stat-value,
  .dash-kpi-value {
    font-size: 1.15rem;
  }

  .dash-kpi-hero,
  .dash-kpi-compact,
  .dash-bento {
    grid-template-columns: 1fr;
  }

  .dash-bento-item--wide {
    grid-column: auto;
  }
}

/* Dashboard — Sahel-inspired layout */
.dash-greeting {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.dash-greeting-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--pos-text);
  letter-spacing: -0.02em;
}

.dash-greeting-date {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--pos-muted);
}

.dash-greeting-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dash-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.95rem;
  border-radius: 0.65rem;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dash-quick-btn:hover {
  border-color: var(--diraya-orange);
  background: var(--diraya-orange-muted);
  color: var(--pos-text);
}

.dash-quick-btn.primary {
  background: var(--diraya-orange);
  border-color: var(--diraya-orange-strong);
  color: #fff !important;
}

.dash-quick-btn.primary:hover {
  background: var(--diraya-orange-strong);
  border-color: var(--diraya-orange-strong);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.4rem;
  border-radius: 1rem;
  background: var(--pos-hero-bg);
  color: #f8fafc;
  border: 1px solid rgba(245, 158, 11, 0.12);
}

.dashboard-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--diraya-orange-light);
}

.dashboard-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
}

.dashboard-subtitle {
  margin: 0.35rem 0 0;
  color: #cbd5e1;
  font-size: 0.95rem;
  max-width: 34rem;
}

.dashboard-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--pos-accent);
  color: #fff !important;
  text-decoration: none !important;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-cta:hover {
  background: var(--diraya-orange-strong);
  color: #000 !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dash-kpi {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.dash-kpi:hover {
  box-shadow: var(--pos-shadow);
  border-color: rgba(245, 158, 11, 0.25);
}

.dash-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dash-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dash-kpi-badge.orange {
  background: rgba(245, 158, 11, 0.15);
  color: var(--diraya-orange-strong);
}

.dash-kpi-badge.gray {
  background: rgba(107, 114, 128, 0.15);
  color: var(--diraya-gray-medium);
}

.dash-kpi-badge.alert {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.dash-kpi-label {
  font-size: 0.78rem;
  color: var(--pos-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--pos-text);
  letter-spacing: -0.02em;
}

.dash-kpi-value.accent {
  color: var(--pos-kpi-accent);
}

.dash-kpi-value.text-amber,
.text-amber {
  color: var(--diraya-orange) !important;
}

.dash-kpi-meta {
  font-size: 0.8rem;
  color: var(--pos-muted);
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.dash-chart-card,
.dash-lowstock-card {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--pos-shadow);
}

.dash-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dash-chart-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pos-text);
}

.dash-chart-header p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--pos-muted);
}

.dash-chart-header a {
  color: var(--pos-accent-strong);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.dash-chart-body {
  position: relative;
  height: 220px;
}

.dash-chart-body-donut {
  height: 240px;
}

.dash-recent-sales-card {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--pos-shadow);
}

.dash-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dash-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.65rem;
  background: var(--pos-surface-2);
}

.dash-recent-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.dash-recent-main strong {
  font-size: 0.88rem;
  color: var(--pos-text);
}

.dash-recent-main span {
  font-size: 0.82rem;
  color: var(--pos-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-recent-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.dash-recent-time {
  font-size: 0.78rem;
  color: var(--pos-muted);
}

.dash-recent-amount {
  font-size: 0.92rem;
  color: var(--diraya-orange-strong);
}

.dash-recent-empty {
  margin: 0;
  padding: 1rem 0.25rem;
  text-align: center;
  color: var(--pos-muted);
  font-size: 0.9rem;
}

.dash-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.dash-table th,
.dash-table td {
  text-align: start;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.dash-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: 1rem;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dash-tile-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.dash-tile-orange .dash-tile-icon { background: linear-gradient(135deg, #f59e0b, #d97706); color: #000; }
.dash-tile-amber .dash-tile-icon { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.dash-tile-charcoal .dash-tile-icon { background: linear-gradient(135deg, #374151, #1f2937); color: #f59e0b; }
.dash-tile-gray .dash-tile-icon { background: linear-gradient(135deg, #6b7280, #4b5563); color: #fff; }
.dash-tile-dark .dash-tile-icon { background: linear-gradient(135deg, #111827, #000); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.dash-tile-green .dash-tile-icon { background: linear-gradient(135deg, #f59e0b, #d97706); color: #000; }
.dash-tile-teal .dash-tile-icon { background: linear-gradient(135deg, #6b7280, #4b5563); color: #fff; }
.dash-tile-emerald .dash-tile-icon { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.dash-tile-slate .dash-tile-icon { background: linear-gradient(135deg, #374151, #1f2937); color: #f59e0b; }
.dash-tile-cyan .dash-tile-icon { background: linear-gradient(135deg, #4b5563, #374151); color: #fbbf24; }
.dash-tile-violet .dash-tile-icon { background: linear-gradient(135deg, #1f2937, #111827); color: #f59e0b; }
.dash-tile-indigo .dash-tile-icon { background: linear-gradient(135deg, #000, #374151); color: #f59e0b; }

.dash-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--pos-shadow);
  border-color: rgba(245, 158, 11, 0.3);
  color: inherit;
}

.dash-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pos-text);
  letter-spacing: -0.01em;
}

.dash-quick-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.dash-quick-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  text-decoration: none !important;
  color: var(--pos-text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dash-quick-link i {
  color: var(--diraya-orange);
  width: 1rem;
  text-align: center;
}

.dash-quick-link:hover {
  border-color: var(--diraya-orange);
  background: var(--diraya-orange-muted);
  color: var(--pos-text);
}

.dash-tile-body h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pos-text);
}

.dash-tile-body p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--pos-muted);
}

.dash-tile-arrow {
  margin-inline-start: auto;
  color: var(--pos-muted);
  font-size: 0.8rem;
}

html[dir="rtl"] .dash-tile-arrow {
  transform: scaleX(-1);
}

/* Settings */
.settings-page {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.settings-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 0.95rem;
  padding: 0.5rem;
  box-shadow: var(--pos-shadow);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.6rem;
  padding: 0.5rem 1rem;
  border-radius: 0.7rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pos-text);
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.settings-nav-item i {
  width: 1.15rem;
  text-align: center;
  color: var(--diraya-orange-strong);
}

.settings-nav-item:hover {
  background: rgba(245, 158, 11, 0.08);
}

.settings-nav-item.active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
  color: var(--diraya-orange-strong);
}

.settings-section.is-hidden {
  display: none !important;
}

.settings-panels {
  min-width: 0;
  width: 100%;
}

.settings-receipt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(420px, 38vw));
  gap: clamp(0.75rem, 2vw, 1.25rem);
  align-items: start;
  width: 100%;
  min-width: 0;
}

.settings-receipt-layout > * {
  min-width: 0;
}

.settings-receipt-form {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.settings-receipt-form .settings-money-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.65rem, 2vw, 1.1rem);
  margin-bottom: 0;
}

.settings-receipt-form .settings-money-field {
  min-width: 0;
}

.settings-receipt-form .settings-money-field .page-input,
.settings-receipt-form .settings-money-field textarea,
.settings-receipt-form .settings-money-field select {
  width: 100%;
  box-sizing: border-box;
}

.settings-receipt-logo-label {
  display: block;
  font-weight: 650;
  margin-bottom: 0.55rem;
}

.settings-receipt-logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.settings-receipt-logo-preview {
  width: 9rem;
  height: 5.5rem;
  flex: 0 0 auto;
  border: 1px dashed var(--pos-border);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
  background: var(--pos-bg);
}

.settings-receipt-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.settings-receipt-logo-empty {
  font-size: 0.78rem;
  color: var(--pos-muted);
  text-align: center;
  line-height: 1.35;
}

.settings-receipt-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.settings-file-btn {
  cursor: pointer;
  margin: 0;
}

.settings-receipt-span-2 {
  grid-column: 1 / -1;
}

.settings-receipt-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.55rem;
}

.settings-receipt-toggle {
  margin: 0;
}

.settings-receipt-toggle .settings-touch-toggle-copy strong {
  line-height: 1.35;
  word-break: break-word;
}

.settings-receipt-preview-panel {
  position: sticky;
  top: 1rem;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 0.95rem;
  box-shadow: var(--pos-shadow);
  overflow: hidden;
}

.settings-receipt-preview-head {
  padding: clamp(0.65rem, 2vw, 0.85rem) clamp(0.75rem, 2.5vw, 1rem);
  border-bottom: 1px solid var(--pos-border);
}

.settings-receipt-preview-head h3 {
  margin: 0;
  font-size: clamp(0.88rem, 2vw, 0.95rem);
}

.settings-receipt-preview-head p {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--pos-muted);
  line-height: 1.45;
}

.settings-receipt-preview-stage {
  padding: clamp(0.65rem, 2vw, 1rem);
  background: #f3f4f6;
  min-height: min(26rem, 55vh);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

html[data-theme="dark"] .settings-receipt-preview-stage {
  background: var(--pos-surface-2);
}

.settings-receipt-preview-inner {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
}

.settings-receipt-preview-inner .pos-receipt-sheet {
  margin: 0 auto;
  background: #fff;
  color: #111;
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

.settings-receipt-preview-inner .pos-receipt-logo {
  text-align: center;
  margin-bottom: 8px;
}

.settings-receipt-preview-inner .pos-receipt-logo img {
  max-width: 72%;
  max-height: 56px;
  object-fit: contain;
}

@media (max-width: 1200px) {
  .settings-receipt-layout {
    grid-template-columns: 1fr;
  }

  .settings-receipt-preview-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  .settings-receipt-form .settings-money-grid {
    grid-template-columns: 1fr;
  }

  .settings-receipt-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .settings-receipt-logo-row {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-receipt-logo-preview {
    width: 100%;
    height: 5.5rem;
  }

  .settings-receipt-logo-actions {
    width: 100%;
  }

  .settings-receipt-logo-actions .page-btn,
  .settings-receipt-logo-actions .settings-file-btn {
    flex: 1 1 calc(50% - 0.3rem);
    justify-content: center;
  }

  .settings-receipt-toggles {
    grid-template-columns: 1fr;
  }

  .settings-receipt-preview-stage {
    min-height: auto;
    padding: 0.75rem;
  }

  #settings-section-receipt .settings-card {
    padding: 0.9rem;
  }

  #settings-section-receipt .settings-card-head {
    flex-wrap: wrap;
  }

  #settings-section-receipt .settings-actions {
    margin-top: 0.25rem;
  }

  #settings-section-receipt .settings-apply-btn {
    width: 100%;
    justify-content: center;
  }

  .settings-receipt-preview-inner .pos-receipt-sheet {
    font-size: 11px;
  }
}

@media (max-width: 400px) {
  .settings-receipt-preview-stage {
    padding: 0.5rem;
  }
}

.settings-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.settings-kicker {
  margin: 0 0 0.3rem;
  color: var(--pos-accent-strong);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.settings-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pos-text);
}

.settings-subtitle {
  margin: 0.4rem 0 0;
  color: var(--pos-muted);
  max-width: 40rem;
}

.settings-toast {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(245, 158, 11, 0.12);
  color: var(--diraya-orange-strong);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 0.65rem;
  padding: 0.65rem 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.settings-card {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 0.95rem;
  padding: 1.2rem;
  box-shadow: var(--pos-shadow);
}

.settings-card-head {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.settings-card-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.14);
  color: var(--diraya-orange-strong);
  flex-shrink: 0;
}

.settings-card-icon.theme {
  background: rgba(55, 65, 81, 0.2);
  color: var(--diraya-orange-light);
}

.settings-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--pos-text);
}

.settings-card-head p {
  margin: 0.25rem 0 0;
  color: var(--pos-muted);
  font-size: 0.88rem;
}

.settings-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.settings-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.35rem;
  padding: 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.settings-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-option:hover {
  border-color: var(--pos-accent);
}

.settings-option.selected {
  border-color: var(--pos-accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  background: rgba(245, 158, 11, 0.06);
}

.settings-touch-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.85rem;
  background: var(--pos-surface);
  cursor: pointer;
  user-select: none;
  position: relative;
}

.settings-touch-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-touch-toggle-box {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  margin-top: 0.15rem;
  border: 2px solid var(--pos-border);
  border-radius: 0.35rem;
  background: var(--pos-surface-2);
  flex: 0 0 1.35rem;
  position: relative;
  box-sizing: border-box;
}

.settings-touch-toggle input:checked + .settings-touch-toggle-box {
  border-color: var(--diraya-orange);
  background: rgba(245, 158, 11, 0.15);
}

.settings-touch-toggle input:checked + .settings-touch-toggle-box::after {
  content: '';
  position: absolute;
  inset: 0.2rem;
  border-radius: 0.15rem;
  background: var(--diraya-orange);
}

.settings-touch-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.settings-touch-toggle-copy strong {
  color: var(--pos-text);
  font-size: 0.95rem;
}

.settings-touch-toggle-copy small {
  color: var(--pos-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.settings-terminal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-option-flag,
.settings-theme-preview {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.settings-option-flag {
  background: #0f172a;
  color: #fff;
  font-size: 0.8rem;
}

.settings-theme-preview.light {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  color: #d97706;
}

.settings-theme-preview.dark {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fbbf24;
}

.settings-theme-card {
  position: relative;
  width: 4.6rem;
  height: 3.35rem;
  border-radius: 0.65rem;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.settings-theme-card.light {
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
  border-color: #cbd5e1;
}

.settings-theme-card.dark {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  border-color: #334155;
}

.settings-theme-chrome {
  display: flex;
  gap: 0.18rem;
  padding: 0.28rem 0.35rem;
}

.settings-theme-chrome span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.45);
}

.settings-theme-card.dark .settings-theme-chrome span {
  background: rgba(148, 163, 184, 0.35);
}

.settings-theme-body {
  display: grid;
  grid-template-columns: 0.9rem 1fr;
  gap: 0.25rem;
  padding: 0 0.35rem 0.35rem;
  height: calc(100% - 0.9rem);
}

.settings-theme-sidebar {
  border-radius: 0.25rem;
  background: rgba(15, 23, 42, 0.12);
}

.settings-theme-card.dark .settings-theme-sidebar {
  background: rgba(255, 255, 255, 0.08);
}

.settings-theme-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-theme-main span {
  flex: 1;
  border-radius: 0.2rem;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.05);
}

.settings-theme-card.dark .settings-theme-main span {
  background: rgba(255, 255, 255, 0.08);
}

.settings-theme-badge {
  position: absolute;
  right: 0.3rem;
  bottom: 0.3rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  background: #fff;
  color: #d97706;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.settings-theme-card.dark .settings-theme-badge {
  background: #f59e0b;
  color: #0f172a;
}

html[dir="rtl"] .settings-theme-badge {
  right: auto;
  left: 0.3rem;
}

.settings-option-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.settings-option-copy strong {
  color: var(--pos-text);
  font-size: 0.95rem;
}

.settings-option-copy small {
  color: var(--pos-muted);
  font-size: 0.75rem;
}

.settings-option-check {
  margin-inline-start: auto;
  color: var(--pos-accent);
  opacity: 0;
}

.settings-option.selected .settings-option-check {
  opacity: 1;
}

.settings-meta {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.4rem;
  color: var(--pos-muted);
  font-size: 0.85rem;
}

.settings-meta strong {
  color: var(--pos-text);
}

.settings-actions {
  margin-top: 1.1rem;
  display: flex;
  justify-content: flex-end;
}

.settings-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  background: var(--diraya-orange);
  color: #000;
  font-weight: 700;
  border-radius: 0.65rem;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
}

.settings-apply-btn:hover {
  background: var(--diraya-orange-strong);
}

.settings-card-wide {
  margin-top: 1rem;
}

.settings-card-head-row {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.settings-card-head-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.settings-card-icon.currency {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
}

.settings-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  border-radius: 0.65rem;
  padding: 0.55rem 0.9rem;
  background: var(--diraya-orange);
  color: #000;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.settings-add-btn:hover {
  background: var(--diraya-orange-strong);
}

.settings-currency-active {
  margin: 0.25rem 0 1.15rem;
  padding: 1rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.9rem;
  background: var(--pos-surface-2);
}

.settings-money-form {
  margin-top: 0.5rem;
}

.settings-money-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.settings-money-field {
  padding: 1rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.9rem;
  background: var(--pos-surface-2);
}

.settings-money-field label {
  display: block;
  margin: 0;
  font-weight: 700;
  color: var(--pos-text);
}

.settings-money-hint {
  margin: 0.35rem 0 0.85rem;
  color: var(--pos-muted);
  font-size: 0.85rem;
}

.settings-money-input-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.settings-money-prefix,
.settings-money-suffix {
  color: var(--pos-muted);
  font-weight: 700;
  white-space: nowrap;
}

.settings-money-input-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--pos-border);
  border-radius: 0.65rem;
  background: var(--pos-surface);
  color: var(--pos-text);
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.settings-currency-active-copy h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--pos-text);
}

.settings-currency-active-copy p {
  margin: 0.3rem 0 0.9rem;
  color: var(--pos-muted);
  font-size: 0.85rem;
}

.settings-currency-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.settings-currency-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.8rem;
  background: var(--pos-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.settings-currency-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-currency-choice:hover {
  border-color: rgba(245, 158, 11, 0.55);
  transform: translateY(-1px);
}

.settings-currency-choice.selected {
  border-color: var(--diraya-orange);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), var(--pos-surface));
}

.settings-currency-choice-symbol {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.14);
  color: var(--diraya-orange-strong);
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.settings-currency-choice-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.settings-currency-choice-copy strong {
  color: var(--pos-text);
  font-size: 0.92rem;
}

.settings-currency-choice-copy small {
  color: var(--pos-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-currency-choice-check {
  margin-inline-start: auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--pos-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.settings-currency-choice.selected .settings-currency-choice-check {
  background: var(--diraya-orange);
  border-color: var(--diraya-orange);
  color: #000;
}

.settings-currency-form {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.75rem;
  background: var(--pos-surface-2);
}

.settings-currency-form.hidden {
  display: none;
}

.settings-currency-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.settings-currency-form h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--pos-text);
}

.settings-currency-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.settings-currency-form-grid label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pos-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-currency-form-grid input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.55rem;
  background: var(--pos-surface);
  color: var(--pos-text);
}

.settings-currency-form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.settings-cancel-btn {
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text);
  border-radius: 0.65rem;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.settings-currency-table-wrap {
  overflow-x: auto;
}

.settings-currency-table {
  width: 100%;
  border-collapse: collapse;
}

.settings-currency-table th,
.settings-currency-table td {
  text-align: start;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--pos-border);
  font-size: 0.9rem;
  color: var(--pos-text);
}

.settings-currency-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pos-muted);
}

.settings-currency-table tr.is-active {
  background: rgba(245, 158, 11, 0.06);
}

.settings-badge-default {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--diraya-orange-strong);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.settings-badge-idle {
  color: var(--pos-muted);
  font-size: 0.85rem;
}

.settings-row-actions {
  display: flex;
  gap: 0.35rem;
}

.settings-row-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.45rem;
  background: var(--pos-surface);
  color: var(--pos-text);
  cursor: pointer;
}

.settings-row-btn:hover {
  border-color: var(--diraya-orange);
  color: var(--diraya-orange-strong);
}

.settings-row-btn.danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.settings-empty {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--pos-muted);
  font-size: 0.9rem;
}

.settings-empty.hidden {
  display: none;
}

.settings-currency-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  border-radius: 0.7rem;
  background: #059669;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.settings-currency-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.settings-currency-toast.error {
  background: #dc2626;
}

.settings-kind-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.25rem 0 1rem;
}

.settings-kind-tab {
  min-height: 2.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text);
  font-weight: 650;
  font-size: 0.82rem;
  cursor: pointer;
}

.settings-kind-tab.active {
  background: var(--diraya-orange);
  border-color: var(--diraya-orange-strong);
  color: #111827;
}

.settings-code-desc {
  grid-column: 1 / -1;
}

@media (max-width: 992px) {
  .settings-currency-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-currency-form-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .settings-currency-form-grid {
    grid-template-columns: 1fr;
  }

  .settings-currency-picker {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .dashboard-kpis,
  .dash-quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1400px) {
  .dashboard-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .dashboard-grid,
  .dashboard-kpis,
  .dashboard-charts,
  .settings-grid,
  .dash-quick-links {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .settings-nav-item {
    flex: 1 0 auto;
  }
}

/* Icon rail / collapsed sidebar on tablets landscape + all laptops/desktops */
@media (min-width: 992px) {
  html.sidebar-collapsed .pos-sidebar {
    width: var(--pos-sidebar-collapsed-width);
  }

  html.sidebar-collapsed .pos-brand {
    justify-content: center;
    padding-inline: 0.55rem;
  }

  html.sidebar-collapsed .pos-brand-text,
  html.sidebar-collapsed .pos-sidebar-collapse-btn,
  html.sidebar-collapsed .pos-nav-label,
  html.sidebar-collapsed .pos-nav-link span,
  html.sidebar-collapsed .pos-sidebar-footer .pos-nav-link span,
  html.sidebar-collapsed .pos-sidebar-user-meta,
  html.sidebar-collapsed .pos-sidebar-user-chevron {
    display: none;
  }

  html.sidebar-collapsed .pos-brand-mark {
    cursor: pointer;
  }

  html.sidebar-collapsed .pos-brand-mark:hover {
    border-color: var(--diraya-orange);
    box-shadow: 0 0 0 3px var(--pos-focus-ring);
  }

  html.sidebar-collapsed .pos-nav-link {
    justify-content: center;
    padding-inline: 0.45rem;
    border-inline-start-width: 0;
    border-inline-end-width: 0;
  }

  html.sidebar-collapsed .pos-nav-link.active {
    box-shadow: inset 2px 0 0 var(--diraya-orange);
  }

  html[dir="rtl"].sidebar-collapsed .pos-nav-link.active {
    box-shadow: inset -2px 0 0 var(--diraya-orange);
  }

  html.sidebar-collapsed .pos-nav-link i {
    width: auto;
    font-size: 1.05rem;
  }

  html.sidebar-collapsed .pos-nav {
    padding-inline: 0.55rem;
  }

  html.sidebar-collapsed .pos-sidebar-footer {
    padding-inline: 0.55rem;
  }

  html.sidebar-collapsed .pos-sidebar-user {
    justify-content: center;
    padding-inline: 0.35rem;
  }
}

/*
  Drawer sidebar: phones / small tablets only (CSS max-width 991px).
  Laptops keep a persistent sidebar (expanded or icon rail) so nav icons stay visible at 100% zoom.
  Opens as a floating overlay above content; dimmer sits under the drawer so links stay clickable.
*/
@media (max-width: 991px) {
  .pos-shell {
    position: relative;
    gap: 0;
  }

  .pos-main {
    padding-top: var(--pos-sidebar-inset);
    padding-inline: var(--pos-sidebar-inset);
  }

  .pos-shell-terminal .pos-main {
    padding-inline-end: var(--pos-sidebar-inset);
  }

  .pos-topbar {
    z-index: 90;
    margin-inline-end: 0;
    padding-inline: 0.85rem;
  }

  .pos-overlay {
    z-index: 95;
    inset: 0;
    top: calc(var(--pos-sidebar-inset) + var(--pos-topbar-height) + var(--pos-sidebar-gap));
    height: auto;
    pointer-events: none;
  }

  .pos-overlay.show {
    pointer-events: auto;
  }

  .pos-sidebar {
    position: fixed !important;
    inset-inline-start: 12px;
    top: calc(var(--pos-sidebar-inset) + var(--pos-topbar-height) + var(--pos-sidebar-gap));
    width: min(var(--pos-sidebar-width), calc(86vw - 12px));
    height: calc(100dvh - var(--pos-sidebar-inset) - var(--pos-topbar-height) - var(--pos-sidebar-gap) - 12px);
    max-height: calc(100dvh - var(--pos-sidebar-inset) - var(--pos-topbar-height) - var(--pos-sidebar-gap) - 12px);
    overflow: hidden;
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: var(--pos-sidebar-shadow);
    z-index: 100;
    background: var(--pos-sidebar-bg) !important;
    flex: 0 0 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--pos-sidebar-border);
    border-radius: calc(var(--pos-sidebar-radius) - 2px);
    pointer-events: auto;
  }

  html[dir="rtl"] .pos-sidebar {
    transform: translateX(calc(100% + 24px));
  }

  .pos-sidebar.open,
  html[dir="rtl"] .pos-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.16);
  }

  .pos-sidebar .pos-brand-mark,
  .pos-sidebar .pos-brand-text {
    display: none;
  }

  .pos-sidebar .pos-brand {
    min-height: 3.5rem;
    padding: 0.65rem 0.85rem;
    justify-content: flex-end;
  }

  html.sidebar-collapsed .pos-nav-label,
  html.sidebar-collapsed .pos-nav-link span,
  html.sidebar-collapsed .pos-sidebar-footer .pos-nav-link span,
  html.sidebar-collapsed .pos-sidebar-user-meta,
  html.sidebar-collapsed .pos-sidebar-user-chevron {
    display: revert;
  }

  html.sidebar-collapsed .pos-nav-link {
    justify-content: flex-start;
    padding-inline: 0.75rem;
    border-inline-start-width: 2px;
    box-shadow: none;
  }

  html.sidebar-collapsed .pos-brand {
    justify-content: flex-end;
    padding-inline: 0.85rem;
  }

  html.sidebar-collapsed .pos-sidebar-collapse-btn,
  .pos-sidebar-collapse-btn {
    display: none;
  }

  .pos-sidebar-close-btn {
    display: inline-flex;
  }

  .pos-menu-btn {
    display: inline-flex;
  }

  html.sidebar-collapsed .pos-brand-mark {
    cursor: default;
  }

  .pos-nav {
    min-height: 0;
  }

  .pos-shell-terminal > .pos-sidebar {
    position: fixed !important;
    z-index: 100 !important;
    background: var(--pos-sidebar-bg) !important;
    border: 1px solid var(--pos-sidebar-border);
  }

  .pos-shell-terminal > .pos-main {
    position: relative;
    z-index: 1;
  }

  .pos-shell-terminal .pos-terminal-cart {
    z-index: 28;
  }
}

@media (max-width: 768px) {
  .dashboard-hero,
  .settings-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-title {
    font-size: clamp(1.25rem, 5vw, 1.6rem);
  }

  .settings-subtitle {
    font-size: 0.88rem;
  }

  .pos-content:has(> .settings-page) {
    padding-inline: 0.65rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .settings-option-grid {
    grid-template-columns: 1fr;
  }

  .pos-chip span {
    display: none;
  }
}

/* Keep inline SVG icons from exploding if utilities fail to load */
svg.h-4 { width: 1rem; height: 1rem; }
svg.h-5 { width: 1.25rem; height: 1.25rem; }
svg.h-6 { width: 1.5rem; height: 1.5rem; }
svg.w-4 { width: 1rem; }
svg.w-5 { width: 1.25rem; }
svg.w-6 { width: 1.5rem; }

button svg,
a svg,
.btn svg {
  flex-shrink: 0;
  max-width: 1.5rem;
  max-height: 1.5rem;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content {
  background-color: var(--pos-surface) !important;
  color: var(--pos-text);
}

html[data-theme="dark"] .table {
  color: var(--pos-text);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background-color: var(--pos-surface-2);
  color: var(--pos-text);
  border-color: var(--pos-border);
}

html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-dark {
  color: var(--pos-text) !important;
}

html[data-theme="dark"] .text-gray-700 {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-400 {
  color: var(--pos-muted) !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-300,
html[data-theme="dark"] .border-bottom {
  border-color: var(--pos-border) !important;
}

html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-gray-100 {
  background-color: var(--pos-surface-2) !important;
}

html[data-theme="dark"] .shadow,
html[data-theme="dark"] .shadow-md,
html[data-theme="dark"] .shadow-lg {
  box-shadow: var(--pos-shadow) !important;
}

/* Full-width module pages inside the content area.
   Bootstrap .container / .p-4 / .mx-auto use !important — match them. */
.pos-content > .container,
.pos-content > .container-fluid,
.pos-content > .dashboard,
.pos-content > .settings-page,
.pos-content > .page-list,
.pos-content > .max-w-7xl,
.pos-content > .min-h-screen,
.pos-content > .w-full,
.pos-content .container.mx-auto,
.pos-content .container,
.pos-content .container-fluid {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-inline: 0 !important;
}

.pos-content > .container,
.pos-content > .container-fluid,
.pos-content > .w-full,
.pos-content .container.mx-auto,
.pos-content .container,
.pos-content .container-fluid,
.pos-content .container.p-4,
.pos-content .p-4.container {
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-inline: 0 !important;
}

.pos-content .max-w-7xl:not(.app-modal-dialog),
.pos-content .max-w-6xl:not(.app-modal-dialog),
.pos-content .max-w-5xl:not(.app-modal-dialog),
.pos-content .max-w-4xl:not(.app-modal-dialog),
.pos-content .max-w-3xl:not(.app-modal-dialog) {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-inline: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-inline: 0 !important;
}

/* Centered modal dialogs — 70–80% width, never full page */
.pos-content .app-modal-dialog,
.app-modal-dialog,
.pos-shell [id$="Modal"] > .relative.mx-auto,
.pos-shell [id$="Modal"] > .relative.top-4,
.pos-shell [id$="Modal"] > .relative.top-8,
.pos-shell [id$="Modal"] > .relative.top-20,
.pos-shell [id$="Modal"] > .relative.my-8,
.pos-shell [id$="Modal"] > div.bg-white,
.pos-shell [id$="Modal"] > div[class*="bg-white"],
.pos-shell [id$="Modal"] > div.rounded-lg,
.pos-shell [id$="Modal"] > div.rounded-xl {
  width: 75% !important;
  max-width: 75% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-inline: auto !important;
}

/* Backdrop overlays inside modals must stay full-screen */
.pos-shell [id$="Modal"] > .absolute.inset-0,
.pos-shell [id$="Modal"] > [data-close-payment],
.pos-shell [id$="Modal"] > [data-close-adjustment],
.pos-shell [id$="Modal"] > [class*="bg-black"],
.pos-shell [id$="Modal"] > [class*="bg-gray-600"],
.pos-shell [id$="Modal"] > [class*="bg-gray-800"] {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
}

.pos-content .return-sales-dialog,
.return-sales-dialog {
  width: 75% !important;
  max-width: 75% !important;
}

.employee-modal-shell {
  display: flex;
}

.employee-modal-shell.hidden {
  display: none !important;
}

.employee-modal-dialog {
  width: min(42rem, 94vw) !important;
  max-width: min(42rem, 94vw) !important;
  max-height: 90vh;
  overflow-y: auto;
  margin: 0 !important;
  padding: 1.5rem;
}

.employee-modal-dialog--confirm {
  width: min(36rem, 94vw) !important;
  max-width: min(36rem, 94vw) !important;
}

.employee-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.employee-modal-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
}

.employee-modal-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted, #6b7280);
  font-size: 0.95rem;
}

.employee-modal-close {
  border: 0;
  background: transparent;
  color: var(--text-muted, #6b7280);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.employee-modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary, #111827);
}

.employee-modal-form {
  display: grid;
  gap: 1rem;
}

.employee-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.employee-modal-actions .page-btn {
  min-height: 2.75rem;
  min-width: 7rem;
  padding-inline: 1.25rem;
}

@media (min-width: 900px) {
  .employee-modal-dialog {
    width: min(48rem, 80vw) !important;
    max-width: min(48rem, 80vw) !important;
    padding: 2rem;
  }

  .employee-modal-dialog--confirm {
    width: min(40rem, 72vw) !important;
    max-width: min(40rem, 72vw) !important;
  }
}

@media (max-width: 768px) {
  .pos-content .app-modal-dialog,
  .app-modal-dialog,
  .pos-shell [id$="Modal"] > .relative.mx-auto,
  .pos-shell [id$="Modal"] > .relative.top-4,
  .pos-shell [id$="Modal"] > .relative.top-8,
  .pos-shell [id$="Modal"] > .relative.top-20,
  .pos-shell [id$="Modal"] > .relative.my-8,
  .pos-shell [id$="Modal"] > div.bg-white,
  .pos-shell [id$="Modal"] > div[class*="bg-white"],
  .pos-shell [id$="Modal"] > div.rounded-lg,
  .pos-shell [id$="Modal"] > div.rounded-xl {
    width: 94% !important;
    max-width: 94% !important;
  }
}

.pos-content > .min-h-screen,
.pos-content .min-h-screen {
  min-height: auto !important;
}

.pos-content > .w-full,
.pos-content .w-full {
  width: 100% !important;
  max-width: none !important;
}

@media (max-width: 768px) {
  .pos-content {
    padding: 0.85rem;
  }

  .pos-content .flex.justify-between {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem;
  }

  .pos-content .flex.space-x-2 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Supplier Page Enhancements */
.supplier-page-loaded {
    animation: pageLoad 0.3s ease-out;
}

@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Animations */
#supplierModal, #deleteSupplierModal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Button Hover Effects */
.btn-hover-lift {
    transition: all 0.2s ease;
}

.btn-hover-lift:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Table Row Hover Effects */
.table-row-hover {
    transition: all 0.2s ease;
}

.table-row-hover:hover {
    background-color: var(--pos-surface-2);
    transform: translateX(2px);
}

.form-field-enhanced:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--pos-focus-ring);
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Toast Notifications */
.toast-enter {
    animation: toastSlideIn 0.3s ease-out;
}

.toast-exit {
    animation: toastSlideOut 0.3s ease-in;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Checkbox Enhancements */
input[type="checkbox"]:checked {
    background-color: var(--diraya-orange);
    border-color: var(--diraya-orange-strong);
}

input[type="checkbox"]:indeterminate {
    background-color: #6b7280;
    border-color: #6b7280;
}

/* Responsive Table Scroll */
.table-container {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Avatar Styling */
.supplier-avatar {
    background: linear-gradient(135deg, #374151 0%, #111827 100%);
    color: var(--diraya-orange-light);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-active {
    background-color: var(--diraya-orange-muted);
    color: var(--diraya-orange-strong);
}

.status-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Search Input Enhancement */
.search-input-container {
    position: relative;
}

.search-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.5rem;
    padding: 1px;
    background: linear-gradient(45deg, var(--diraya-orange), var(--diraya-charcoal));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-input-container:focus-within::before {
    opacity: 1;
}

/* Mobile Responsive Enhancements */
@media (max-width: 640px) {
    .mobile-stack {
        flex-direction: column;
        gap: 1rem;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .mobile-text-center {
        text-align: center;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .dark-mode-card {
        background-color: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .dark-mode-text {
        color: #d1d5db;
    }
    
    .dark-mode-border {
        border-color: #374151;
    }
}

/* =============================================================================
   Diraya theme — inner pages, modals, Identity, global Tailwind remaps
   ============================================================================= */

/* Page scaffold */
.pos-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pos-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pos-text);
  letter-spacing: -0.02em;
}

.pos-page-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--pos-muted);
}

.pos-card {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  box-shadow: var(--pos-shadow);
}

.pos-filter-bar {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--pos-shadow);
}

.pos-table-wrap {
  overflow-x: auto;
  border-radius: 0.75rem;
}

/* =============================================================================
   Diraya Data Tables — professional global table system
   ============================================================================= */

.pos-shell {
  --table-radius: 1rem;
  --table-row-h: 3rem;
  --table-head-h: 2.75rem;
  --table-pad-x: 0.85rem;
  --table-pad-y: 0.7rem;
  --table-accent: var(--diraya-orange);
  --table-hover: rgba(245, 158, 11, 0.06);
  --table-stripe: rgba(15, 23, 42, 0.015);
  --table-head-bg: var(--pos-surface-2);
  --table-head-bg-accent: color-mix(in srgb, var(--pos-surface-2) 86%, var(--diraya-orange) 14%);
  --table-head-fill: linear-gradient(180deg, var(--table-head-bg) 0%, var(--table-head-bg-accent) 100%);
}

html[data-theme="dark"] .pos-shell {
  --table-hover: rgba(245, 158, 11, 0.09);
  --table-stripe: rgba(255, 255, 255, 0.02);
}

/* Card shell around page tables */
.pos-content .bg-white.rounded-lg.shadow:has(table),
.pos-content .bg-white.rounded-lg.shadow.overflow-hidden:has(table),
.pos-content .bg-white.rounded-xl.shadow:has(table),
.pos-content .card:has(table),
.pos-shell .diraya-table-shell {
  background: var(--pos-surface) !important;
  border: 1px solid var(--pos-border) !important;
  border-radius: var(--table-radius) !important;
  box-shadow: var(--pos-shadow) !important;
  overflow: hidden;
}

.pos-shell .diraya-table-shell {
  position: relative;
}

.pos-shell .diraya-table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.45) transparent;
}

.pos-content:has(> .page-list) .diraya-table-scroll,
.pos-content:has(> .page-list) .page-table-scroll {
  flex: 1 1 auto;
  min-height: min(18rem, 55vh);
  overflow-x: auto;
  overflow-y: auto;
}

/* Cash drawer table should not create a second vertical scroller */
.pos-content:has(.cash-drawer-stats) .page-table-scroll,
.pos-content:has(.cash-drawer-stats) .diraya-table-scroll {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.pos-shell .diraya-table-scroll::-webkit-scrollbar {
  height: 8px;
}

.pos-shell .diraya-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4);
  border-radius: 999px;
}

.pos-shell .diraya-table-shell.is-scrolled::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--diraya-orange), transparent 70%);
  opacity: 0.85;
  z-index: 5;
  pointer-events: none;
}

/* Base table */
.pos-shell table,
.pos-content table,
.pos-shell .table,
.pos-shell .dash-table,
.pos-shell .settings-currency-table,
.pos-shell .diraya-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  color: var(--pos-text);
  font-variant-numeric: tabular-nums;
}

.pos-shell table thead,
.pos-content table thead,
.pos-shell .table thead,
.pos-shell .dash-table thead,
.pos-shell .settings-currency-table thead,
.app-modal-dialog table thead,
[id$="Modal"] table thead {
  background: var(--table-head-fill, var(--pos-surface-2)) !important;
  position: sticky;
  top: 0;
  z-index: 4;
}

.pos-shell table thead th,
.pos-content table thead th,
.pos-shell .table thead th,
.pos-shell .dash-table th,
.pos-shell .settings-currency-table th,
.pos-content table.min-w-full th,
.app-modal-dialog table thead th,
[id$="Modal"] table thead th {
  height: var(--table-head-h);
  padding: 0.7rem var(--table-pad-x) !important;
  color: var(--pos-muted) !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  white-space: nowrap;
  border-bottom: 1px solid var(--pos-border) !important;
  background: var(--table-head-fill, var(--pos-surface-2)) !important;
  vertical-align: middle;
  text-align: start;
  position: sticky;
  top: 0;
  z-index: 4;
  box-shadow: 0 1px 0 var(--pos-border);
}

.pos-shell table thead th:first-child,
.pos-shell .diraya-table thead th:first-child {
  border-start-start-radius: 0;
}

.pos-shell table tbody td,
.pos-content table tbody td,
.pos-shell .table tbody td,
.pos-shell .dash-table td,
.pos-shell .settings-currency-table td,
.pos-content table.min-w-full td {
  height: var(--table-row-h);
  padding: var(--table-pad-y) var(--table-pad-x) !important;
  color: var(--pos-text) !important;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid var(--pos-border) !important;
  vertical-align: middle;
  background: transparent;
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.pos-shell table tbody tr:last-child td,
.pos-shell .dash-table tbody tr:last-child td,
.pos-shell .settings-currency-table tbody tr:last-child td {
  border-bottom: none !important;
}

/* Zebra + hover with accent rail */
.pos-shell table tbody tr:nth-child(even) td {
  background: var(--table-stripe);
}

.pos-shell table tbody tr {
  position: relative;
}

.pos-shell table tbody tr:hover td {
  background: var(--table-hover) !important;
}

.pos-shell table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--table-accent);
}

html[dir="rtl"] .pos-shell table tbody tr:hover td:first-child {
  box-shadow: inset -3px 0 0 var(--table-accent);
}

.pos-shell table tbody tr.is-selected td,
.pos-shell table tbody tr.selected td,
.pos-shell table tbody tr.active td {
  background: rgba(245, 158, 11, 0.1) !important;
}

.pos-shell table tbody tr.is-selected td:first-child,
.pos-shell table tbody tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--diraya-orange-strong);
}

/* Sortable headers */
.pos-shell table thead th.sortable,
.pos-shell table thead th[data-column],
.pos-shell table thead .sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.pos-shell table thead th.sortable:hover,
.pos-shell table thead th[data-column]:hover,
.pos-shell table thead .sortable:hover {
  color: var(--diraya-orange-strong) !important;
  background: color-mix(in srgb, var(--table-head-bg-accent, var(--pos-surface-2)) 82%, var(--diraya-orange) 18%) !important;
}

.pos-shell table .sort-icon {
  opacity: 0.45;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.pos-shell table thead th:hover .sort-icon,
.pos-shell table thead th.sorted .sort-icon {
  opacity: 1;
  color: var(--diraya-orange-strong);
}

/* Primary cell emphasis */
.pos-shell table tbody td strong,
.pos-shell table tbody td .font-medium,
.pos-shell table tbody td .font-semibold {
  font-weight: 650;
  color: var(--pos-text);
  letter-spacing: -0.01em;
}

/* Money / totals feel */
.pos-shell table tbody td[data-total-amount],
.pos-shell table .money,
.pos-shell table td.amount {
  font-weight: 700;
  color: var(--diraya-orange-strong);
  font-variant-numeric: tabular-nums;
}

/* Status pills */
.pos-shell table .rounded-full,
.pos-shell table [class*="rounded-full"],
.pos-shell table .badge,
.pos-shell table .inline-flex.px-2 {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem !important;
  border: 1px solid transparent;
  line-height: 1.2;
}

.pos-shell table .bg-green-100,
.pos-shell table .bg-emerald-100 {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.22) !important;
}

.pos-shell table .bg-red-100,
.pos-shell table .bg-rose-100 {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
  border-color: rgba(239, 68, 68, 0.22) !important;
}

.pos-shell table .bg-yellow-100,
.pos-shell table .bg-amber-100 {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #b45309 !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
}

.pos-shell table .bg-blue-100,
.pos-shell table .bg-indigo-100 {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #2563eb !important;
  border-color: rgba(59, 130, 246, 0.22) !important;
}

.pos-shell table .bg-gray-100,
.pos-shell table .bg-slate-100 {
  background: var(--pos-surface-2) !important;
  color: var(--pos-muted) !important;
  border-color: var(--pos-border) !important;
}

/* Action column */
.pos-shell table tbody td:last-child {
  white-space: nowrap;
}

.pos-shell table tbody td .flex.space-x-2,
.pos-shell table tbody td .flex.gap-2,
.pos-shell table .settings-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pos-shell table tbody td button,
.pos-shell table tbody td .btn,
.pos-shell table tbody td a.btn,
.pos-shell table .settings-row-btn {
  transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.pos-shell table tbody td button:hover,
.pos-shell table .settings-row-btn:hover {
  transform: translateY(-1px);
}

/* Checkbox cells */
.pos-shell table input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--diraya-orange);
  cursor: pointer;
}

/* Empty / muted cells */
.pos-shell table tbody td .text-gray-400,
.pos-shell table tbody td .text-gray-500,
.pos-shell table .text-muted {
  color: var(--pos-muted) !important;
}

/* Compact tables inside modals */
.app-modal-dialog table thead th,
.app-modal-dialog table tbody td,
[id$="Modal"] table thead th,
[id$="Modal"] table tbody td {
  height: auto;
  padding: 0.65rem 0.85rem !important;
  font-size: 0.85rem;
}

/* Keep numeric invoice detail columns aligned (headers were forced to start by global modal table CSS). */
#viewInvoiceModal .invoice-view-items-table thead th.col-num,
#viewInvoiceModal .invoice-view-items-table tbody td.col-num,
.app-modal-dialog .invoice-view-items-table thead th.col-num,
.app-modal-dialog .invoice-view-items-table tbody td.col-num,
[id$="Modal"] .invoice-view-items-table thead th.col-num,
[id$="Modal"] .invoice-view-items-table tbody td.col-num {
  text-align: end !important;
}

.app-modal-dialog table,
[id$="Modal"] table {
  border: 1px solid var(--pos-border);
  border-radius: 0.75rem;
  overflow: hidden;
}

/* Pagination under tables */
.pos-content nav[aria-label="Pagination"],
.pos-content .pagination,
.pos-content .paginate-link {
  border-radius: 0.55rem;
}

.pos-content .paginate-link {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pos-content .paginate-link:hover {
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: var(--diraya-orange-strong) !important;
  background: rgba(245, 158, 11, 0.08) !important;
}

/* Dashboard + settings tables inherit system */
.dash-table th,
.dash-table td {
  text-align: start;
}

.settings-currency-table tr.is-active td {
  background: rgba(245, 158, 11, 0.07) !important;
}

/* Compact POS / app density for ~14.5"–16.5" class screens (CSS 1440–1680) and below */
@media (max-width: 1680px) {
  .pos-shell {
    --table-pad-x: 0.7rem;
    --table-pad-y: 0.55rem;
    --table-row-h: 2.55rem;
  }

  .pos-topbar {
    --pos-topbar-height: 4.1rem;
    height: var(--pos-topbar-height);
    min-height: var(--pos-topbar-height);
    max-height: var(--pos-topbar-height);
    gap: 0.65rem;
    padding-inline: 1rem;
  }

  .pos-topbar-title {
    font-size: 1.05rem;
  }

  .pos-topbar .pos-terminal-search-wrap {
    min-height: 3rem;
    height: 3rem;
  }

  .pos-topbar-start {
    max-width: 9rem;
  }

  .pos-brand-name {
    font-size: 0.88rem;
  }

  .pos-nav-link {
    font-size: 0.8rem;
    min-height: 44px;
    padding-block: 0.4rem;
  }

  .pos-menu-btn,
  .pos-brand-mark {
    width: 44px;
    height: 44px;
  }

  .pos-content,
  .pos-content p,
  .pos-content label,
  .pos-content .form-label,
  .pos-content .form-control,
  .pos-content .form-select,
  .pos-content .btn {
    font-size: 0.82rem;
  }

  .pos-shell table thead th,
  .pos-shell table tbody td {
    font-size: 0.78rem !important;
  }

  .dash-greeting-title,
  .dashboard-hero h1,
  .settings-hero h1 {
    font-size: 1.15rem;
  }

  .dash-greeting-date,
  .dashboard-hero p,
  .settings-hero p {
    font-size: 0.8rem;
  }

  .pos-terminal-search {
    font-size: 0.85rem;
    min-height: 44px;
  }

  .pos-topbar .pos-terminal-search {
    min-height: 0;
    font-size: 0.9rem;
  }

  .pos-category-pill {
    font-size: 0.82rem;
    min-height: 2.45rem;
    padding: 0.4rem 0.85rem;
  }

  .pos-category-bar {
    top: 0.5rem;
    inset-inline: 0.5rem;
  }

  .pos-product-scroll {
    padding-top: 4.5rem;
  }

  .pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 0.7rem;
  }

  .pos-product-card {
    padding: 0.65rem;
  }

  .pos-product-image {
    height: 112px;
  }

  .pos-product-name {
    font-size: 0.9rem;
  }

  .pos-product-price {
    font-size: 1.05rem;
  }

  .pos-product-add {
    width: 2.15rem;
    height: 2.15rem;
  }

  .pos-cart-header h2 {
    font-size: 0.95rem;
  }

  .pos-terminal-tab {
    font-size: 0.78rem;
    min-height: 44px;
  }
}

/* Tighten further inside the classic 15–16" band (~14.5"–16.5" CSS 1440–1680) */
@media (min-width: 1440px) and (max-width: 1680px) {
  .pos-shell-terminal .pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 0.75rem;
  }

  .pos-shell-terminal .pos-product-image {
    height: 120px;
  }
}

@media (max-width: 768px) {
  .pos-shell {
    --table-pad-x: 0.65rem;
    --table-pad-y: 0.5rem;
    --table-row-h: 2.45rem;
  }
}

/* Modal panels */
.pos-content .rounded-lg.shadow-lg,
.pos-content .rounded-lg.shadow-xl,
.pos-content .modal-content {
  background: var(--pos-surface) !important;
  border: 1px solid var(--pos-border);
  color: var(--pos-text);
}

.pos-content .bg-gradient-to-r.from-blue-600,
.pos-content .bg-gradient-to-r.from-purple-600,
.pos-content [class*="from-blue-600"],
.pos-content [class*="from-purple-600"] {
  background: var(--pos-hero-bg) !important;
  color: #f8fafc !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
}

/* Primary actions: green / emerald → Diraya orange */
.pos-shell .bg-green-500,
.pos-shell .bg-green-600,
.pos-shell .bg-emerald-600,
.pos-shell .bg-emerald-700 {
  background-color: var(--diraya-orange) !important;
  color: #000 !important;
}

.pos-shell .hover\:bg-green-600:hover,
.pos-shell .hover\:bg-green-700:hover,
.pos-shell .hover\:bg-emerald-700:hover {
  background-color: var(--diraya-orange-strong) !important;
  color: #000 !important;
}

/* Secondary actions: blue / teal / indigo → charcoal */
.pos-shell .bg-blue-500,
.pos-shell .bg-blue-600,
.pos-shell .bg-blue-700,
.pos-shell .bg-teal-500,
.pos-shell .bg-teal-600,
.pos-shell .bg-indigo-500,
.pos-shell .bg-indigo-600,
.pos-shell .bg-purple-600,
.pos-shell .bg-purple-700 {
  background-color: var(--diraya-charcoal) !important;
  color: #f9fafb !important;
}

.pos-shell .hover\:bg-blue-600:hover,
.pos-shell .hover\:bg-blue-700:hover,
.pos-shell .hover\:bg-teal-600:hover,
.pos-shell .hover\:bg-indigo-600:hover,
.pos-shell .hover\:bg-purple-700:hover {
  background-color: var(--diraya-gray) !important;
  color: #fff !important;
}

/* Text accents */
.pos-shell .text-green-600,
.pos-shell .text-green-700,
.pos-shell .text-green-800,
.pos-shell .text-green-900,
.pos-shell .text-emerald-600,
.pos-shell .text-emerald-700,
.pos-shell .text-emerald-800 {
  color: var(--diraya-orange-strong) !important;
}

.pos-shell .text-blue-600,
.pos-shell .text-blue-700,
.pos-shell .text-blue-800 {
  color: var(--diraya-gray-medium) !important;
}

.pos-shell .hover\:text-green-800:hover,
.pos-shell .hover\:text-green-900:hover,
.pos-shell .hover\:text-emerald-800:hover {
  color: var(--diraya-orange) !important;
}

.pos-shell .hover\:text-blue-800:hover,
.pos-shell .hover\:text-blue-900:hover {
  color: var(--diraya-orange-strong) !important;
}

/* Badges & highlights */
.pos-shell .bg-green-100,
.pos-shell .bg-green-50,
.pos-shell .bg-emerald-100,
.pos-shell .bg-emerald-50 {
  background-color: var(--diraya-orange-muted) !important;
}

.pos-shell .border-green-200,
.pos-shell .border-green-500 {
  border-color: rgba(245, 158, 11, 0.35) !important;
}

.pos-shell .text-green-800,
.pos-shell .bg-green-100.text-green-800 {
  color: var(--diraya-orange-strong) !important;
}

.pos-shell .bg-blue-100 {
  background-color: rgba(55, 65, 81, 0.15) !important;
}

.pos-shell .text-blue-800 {
  color: var(--diraya-charcoal) !important;
}

html[data-theme="dark"] .pos-shell .text-blue-800 {
  color: var(--diraya-gray-light) !important;
}

/* Pagination active */
.pos-shell .bg-green-50.border-green-500,
.pos-shell .border-green-500.text-green-600 {
  background-color: var(--diraya-orange-muted) !important;
  border-color: var(--diraya-orange) !important;
  color: var(--diraya-orange-strong) !important;
}

/* Tab pills (Report, Debt) */
.pos-shell a.bg-emerald-600,
.pos-shell button.bg-emerald-600 {
  background-color: var(--diraya-orange) !important;
  color: #000 !important;
}

/* Hover list items */
.pos-shell .hover\:bg-emerald-50:hover {
  background-color: var(--diraya-orange-muted) !important;
}

/* Form focus within app shell */
.pos-shell input:not([type="checkbox"]):not([type="radio"]):focus,
.pos-shell select:focus,
.pos-shell textarea:focus {
  border-color: var(--diraya-orange) !important;
  box-shadow: 0 0 0 3px var(--pos-focus-ring) !important;
  outline: none;
}

.pos-shell input[type="checkbox"],
.pos-shell input[type="radio"] {
  accent-color: var(--diraya-orange);
}

/* Bootstrap alerts & success states */
.pos-shell .alert-success {
  background-color: var(--diraya-orange-muted);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--diraya-orange-strong);
}

.pos-shell .text-success {
  color: var(--diraya-orange-strong) !important;
}

.pos-shell .btn-outline-primary {
  color: var(--diraya-orange-strong);
  border-color: var(--diraya-orange);
}

.pos-shell .btn-outline-primary:hover {
  background-color: var(--diraya-orange);
  border-color: var(--diraya-orange-strong);
  color: #000;
}

.pos-shell .btn-success {
  background-color: var(--diraya-orange);
  border-color: var(--diraya-orange-strong);
  color: #000;
}

.pos-shell .btn-success:hover {
  background-color: var(--diraya-orange-strong);
  border-color: var(--diraya-orange-strong);
  color: #000;
}

.pos-shell .btn-link {
  color: var(--diraya-orange-strong);
}

.pos-shell .btn-link:hover {
  color: var(--diraya-orange);
}

/* Identity / account pages inside shell */
.pos-content > .row,
.pos-content > div > .row {
  margin: 0;
}

.pos-content section form,
.pos-content .account-page form,
.pos-content .manage-page form {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--pos-shadow);
}

.pos-content section h1,
.pos-content section h2,
.pos-content section h3 {
  color: var(--pos-text);
}

.pos-content section a:not(.btn):not(.nav-link):not(.pos-nav-link):not(.dash-tile):not(.dash-quick-link) {
  color: var(--diraya-orange-strong);
}

.pos-content section a:not(.btn):not(.nav-link):hover {
  color: var(--diraya-orange);
}

.pos-content .nav-pills .nav-link {
  color: var(--pos-muted);
  border-radius: 0.5rem;
}

.pos-content .nav-pills .nav-link.active,
.pos-content .nav-pills .show > .nav-link {
  background-color: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.pos-content .form-control,
.pos-content .form-select {
  background-color: var(--pos-surface);
  color: var(--pos-text);
  border-color: var(--pos-border);
}

.pos-content .form-control:focus,
.pos-content .form-select:focus {
  border-color: var(--diraya-orange);
  box-shadow: 0 0 0 0.2rem var(--pos-focus-ring);
}

.pos-content hr {
  border-color: var(--pos-border);
  opacity: 1;
}

/* Toast notifications (JS-generated, often appended to body) */
body > .fixed.bg-green-500,
.pos-shell .fixed.bg-green-500 {
  background-color: var(--diraya-orange) !important;
  color: #000 !important;
}

/* Side panels & white cards in dark mode */
html[data-theme="dark"] .pos-shell .bg-white {
  background-color: var(--pos-surface) !important;
}

html[data-theme="dark"] .pos-shell .bg-gray-50,
html[data-theme="dark"] .pos-shell .bg-gray-100 {
  background-color: var(--pos-surface-2) !important;
}

html[data-theme="dark"] .pos-shell .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--pos-border);
}

html[data-theme="dark"] .pos-shell .text-gray-800,
html[data-theme="dark"] .pos-shell .text-gray-900,
html[data-theme="dark"] .pos-shell .text-gray-700 {
  color: var(--pos-text) !important;
}

html[data-theme="dark"] .pos-shell .text-gray-500,
html[data-theme="dark"] .pos-shell .text-gray-600,
html[data-theme="dark"] .pos-shell .text-gray-400 {
  color: var(--pos-muted) !important;
}

html[data-theme="dark"] .pos-shell .border-gray-200,
html[data-theme="dark"] .pos-shell .border-gray-300 {
  border-color: var(--pos-border) !important;
}

html[data-theme="dark"] .pos-shell .hover\:bg-gray-50:hover {
  background-color: var(--pos-surface-2) !important;
}

/* Readonly total fields (invoice modals) */
.pos-shell #totalAmount,
.pos-shell .border-green-500.bg-green-50 {
  border-color: rgba(245, 158, 11, 0.45) !important;
  background-color: var(--diraya-orange-muted) !important;
  color: var(--pos-text) !important;
  font-weight: 700;
}

/* POS terminal — flat light grey workspace */
.pos-shell-terminal {
  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--pos-bg);
}

/* Decorative ambient layer — disabled for flat light grey POS */
.pos-ambient-waves {
  display: none;
}

.pos-ambient-wave {
  position: absolute;
  display: block;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}

/* Bottom-left: theme yellow / amber shapes */
.pos-ambient-wave--bl-a {
  width: 760px;
  height: 380px;
  inset-inline-start: -220px;
  bottom: -230px;
  background:
    radial-gradient(ellipse 68% 58% at 48% 52%, rgba(251, 191, 36, 0.28), transparent 70%),
    radial-gradient(ellipse 50% 45% at 60% 68%, rgba(245, 158, 11, 0.16), transparent 72%);
  filter: blur(40px);
  opacity: 0.95;
  transform: rotate(-6deg);
}

.pos-ambient-wave--bl-b {
  width: 540px;
  height: 300px;
  inset-inline-start: -60px;
  bottom: -160px;
  background:
    radial-gradient(ellipse 60% 50% at 42% 58%, rgba(253, 230, 138, 0.32), transparent 70%),
    radial-gradient(ellipse 52% 46% at 55% 72%, rgba(217, 119, 6, 0.12), transparent 72%);
  filter: blur(34px);
  opacity: 0.9;
  transform: rotate(5deg);
}

/* Bottom-right: theme yellow accents in products lane */
.pos-ambient-wave--br-a {
  width: 800px;
  height: 400px;
  inset-inline-end: -180px;
  bottom: -250px;
  background:
    radial-gradient(ellipse 70% 55% at 52% 55%, rgba(245, 158, 11, 0.22), transparent 68%),
    radial-gradient(ellipse 48% 42% at 38% 70%, rgba(251, 191, 36, 0.18), transparent 72%);
  filter: blur(42px);
  opacity: 0.92;
  transform: rotate(8deg);
}

.pos-ambient-wave--br-b {
  width: 580px;
  height: 310px;
  inset-inline-end: -30px;
  bottom: -170px;
  background:
    radial-gradient(ellipse 58% 50% at 58% 60%, rgba(253, 230, 138, 0.28), transparent 70%),
    radial-gradient(ellipse 50% 45% at 45% 76%, rgba(245, 158, 11, 0.14), transparent 74%);
  filter: blur(36px);
  opacity: 0.88;
  transform: rotate(-10deg);
}

@media (min-width: 992px) {
  /* Keep right-side glow in the products lane, not under the solid cart */
  .pos-ambient-wave--br-a {
    inset-inline-end: calc(420px - 120px);
    transform: rotate(10deg) translate(8%, 0);
  }

  .pos-ambient-wave--br-b {
    inset-inline-end: calc(420px - 40px);
  }
}

@media (max-width: 991px) {
  .pos-ambient-wave--bl-a,
  .pos-ambient-wave--br-a {
    width: 480px;
    height: 260px;
    filter: blur(32px);
  }

  .pos-ambient-wave--bl-b,
  .pos-ambient-wave--br-b {
    width: 380px;
    height: 220px;
    filter: blur(26px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pos-ambient-wave {
    filter: blur(28px);
  }
}

.pos-shell-terminal > .pos-sidebar,
.pos-shell-terminal > .pos-main {
  position: relative;
  z-index: 1;
}

.pos-shell-terminal > .pos-sidebar {
  background: #fff;
  border: 1px solid var(--pos-sidebar-border);
  box-shadow: var(--pos-sidebar-shadow);
}

/* Persistent sidebar (tablet landscape+): keep floating sidebar above the shared wave surface */
@media (min-width: 992px) {
  .pos-shell-terminal > .pos-sidebar {
    position: sticky;
    top: var(--pos-sidebar-inset);
    z-index: 1;
    background: #fff;
    border: 1px solid var(--pos-sidebar-border);
    box-shadow: var(--pos-sidebar-shadow);
  }
}

.pos-shell-terminal .pos-main,
.pos-shell-terminal .pos-content-terminal,
.pos-shell-terminal .pos-terminal,
.pos-shell-terminal .employee-workstation,
.pos-shell-terminal .employee-workstation-main,
.pos-shell-terminal .employee-workstation-panel[data-panel="pos"],
.pos-shell-terminal .pos-terminal-products,
.pos-shell-terminal .pos-product-scroll,
.pos-shell-terminal.pos-shell-workstation .employee-workstation,
.pos-shell-terminal.pos-shell-workstation .employee-workstation-main {
  background: transparent !important;
}

.pos-shell-terminal .pos-topbar {
  background: #fff;
  border: 1px solid var(--pos-sidebar-border);
  box-shadow: var(--pos-sidebar-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  flex-shrink: 0;
}

.pos-shell-terminal .pos-sidebar .pos-brand,
.pos-shell-terminal .pos-sidebar-footer {
  border-color: rgba(229, 231, 235, 0.55);
}

.pos-shell-terminal .pos-terminal-cart {
  background: #fff;
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.04);
}

.pos-shell-terminal > .pos-sidebar,
.pos-shell-terminal .pos-product-card {
  background: #fff;
}

html[data-theme="dark"] .pos-shell-terminal > .pos-sidebar {
  background: var(--pos-sidebar-bg);
}

html[data-theme="dark"] .pos-shell-terminal .pos-topbar {
  background: var(--pos-sidebar-bg);
}

html[data-theme="dark"] .pos-shell-terminal .pos-terminal-cart,
html[data-theme="dark"] .pos-shell-terminal .pos-product-card {
  background: var(--pos-surface);
}

.pos-shell-terminal .pos-main {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

html[data-theme="dark"] .pos-shell-terminal {
  background: #0a0a0a;
}

html[data-theme="dark"] .pos-terminal-products,
html[data-theme="dark"] .pos-shell-terminal .pos-terminal-products,
html[data-theme="dark"] .pos-shell-terminal .pos-product-scroll {
  background: transparent !important;
}

html[data-theme="dark"] .pos-ambient-wave--bl-a {
  background:
    radial-gradient(ellipse 70% 60% at 45% 40%, rgba(251, 191, 36, 0.055), transparent 68%),
    radial-gradient(ellipse 55% 50% at 60% 65%, rgba(245, 158, 11, 0.04), transparent 70%);
}

html[data-theme="dark"] .pos-ambient-wave--bl-b {
  background:
    linear-gradient(145deg, rgba(245, 158, 11, 0.045), transparent 55%),
    radial-gradient(ellipse 65% 55% at 40% 50%, rgba(217, 119, 6, 0.03), transparent 72%);
}

html[data-theme="dark"] .pos-ambient-wave--br-a {
  background:
    radial-gradient(ellipse 72% 58% at 55% 42%, rgba(245, 158, 11, 0.05), transparent 66%),
    radial-gradient(ellipse 50% 48% at 35% 70%, rgba(251, 191, 36, 0.035), transparent 70%);
}

html[data-theme="dark"] .pos-ambient-wave--br-b {
  background:
    linear-gradient(215deg, rgba(251, 191, 36, 0.04), transparent 58%),
    radial-gradient(ellipse 60% 55% at 58% 48%, rgba(217, 119, 6, 0.03), transparent 74%);
}

html[data-theme="dark"] .pos-shell-terminal .pos-topbar {
  background: var(--pos-sidebar-bg);
  border-color: var(--pos-sidebar-border);
}

html[data-theme="dark"] .pos-shell-terminal .pos-sidebar .pos-brand,
html[data-theme="dark"] .pos-shell-terminal .pos-sidebar-footer {
  border-color: rgba(55, 65, 81, 0.7);
}

@media (min-width: 992px) {
  .pos-shell-terminal .pos-main {
    padding-inline-end: 420px;
  }

  .pos-shell-terminal .pos-topbar {
    margin-inline-end: var(--pos-sidebar-gap);
  }

  .pos-shell-terminal .pos-terminal-body {
    grid-template-columns: 1fr;
  }

  .pos-shell-terminal .pos-terminal-cart {
    position: fixed;
    top: 0;
    inset-inline-end: 0;
    width: 420px;
    height: 100vh;
    height: 100dvh;
    z-index: 28;
  }
}

.pos-content-terminal {
  max-width: none;
  padding: 0;
  flex: 1;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.pos-shell-terminal .pos-footer {
  display: none;
}

.pos-terminal {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: transparent;
}

.pos-terminal-toolbar {
  padding: 0.85rem 1rem;
  background: var(--pos-surface);
  border-bottom: 1px solid var(--pos-border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

.pos-terminal-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pos-terminal-search-wrap i,
.pos-topbar-search-icon {
  position: absolute;
  inset-inline-start: 0.95rem;
  color: var(--pos-muted);
  pointer-events: none;
  z-index: 1;
}

.pos-topbar-search-barcode {
  position: absolute;
  inset-inline-end: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pos-muted);
  pointer-events: none;
  z-index: 1;
}

.pos-topbar-search-barcode i {
  position: static;
  inset: auto;
}

.pos-terminal-search {
  width: 100%;
  padding: 0.7rem 0.85rem;
  padding-inline-start: 2.35rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.75rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  font-size: 0.95rem;
}

.pos-topbar .pos-terminal-search-wrap {
  min-height: 3.15rem;
  height: 3.15rem;
  border-radius: 999px;
  background: rgba(243, 244, 246, 0.95);
  border: 1px solid transparent;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pos-topbar .pos-terminal-search {
  height: 100%;
  padding-block: 0;
  padding-inline-start: 2.65rem;
  padding-inline-end: 2.75rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: none;
}

.pos-topbar .pos-terminal-search::placeholder {
  color: var(--pos-muted);
  font-weight: 500;
}

.pos-terminal-search:focus {
  outline: none;
  border-color: var(--diraya-orange);
  box-shadow: 0 0 0 3px var(--pos-focus-ring);
}

.pos-topbar .pos-terminal-search-wrap:focus-within {
  border-color: rgba(245, 158, 11, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px var(--pos-focus-ring);
}

.pos-topbar .pos-terminal-search:focus {
  border-color: transparent;
  box-shadow: none;
}

.pos-topbar .pos-terminal-search-wrap:focus-within .pos-topbar-search-icon,
.pos-topbar .pos-terminal-search-wrap:focus-within .pos-topbar-search-barcode {
  color: var(--diraya-orange-strong);
}

.pos-category-bar {
  position: absolute;
  top: 0.65rem;
  inset-inline: 0.65rem;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100% - 1.3rem);
  padding: 0.2rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
  touch-action: pan-x;
}

.pos-category-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  background: var(--pos-sidebar-bg, #ffffff);
  color: var(--pos-text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.pos-category-nav:hover:not(:disabled) {
  border-color: rgba(245, 158, 11, 0.35);
  background: #fff;
  color: var(--diraya-orange-strong);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.14);
}

.pos-category-nav:active:not(:disabled) {
  transform: scale(0.96);
}

.pos-category-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.pos-category-nav i {
  font-size: 0.95rem;
  line-height: 1;
}

html[dir="rtl"] .pos-category-nav i {
  transform: scaleX(-1);
}

.pos-terminal-categories {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.1rem 0.15rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.pos-terminal-categories.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.pos-terminal-categories::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.pos-category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  min-height: 2.55rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--pos-sidebar-bg, #ffffff);
  color: var(--pos-sidebar-text, #374151);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.pos-category-pill i {
  font-size: 0.9rem;
  line-height: 1;
  color: var(--diraya-orange-strong);
}

.pos-category-pill:hover {
  border-color: rgba(245, 158, 11, 0.35);
  background: #fff;
  color: var(--diraya-orange-strong);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.14);
}

.pos-category-pill:active {
  transform: scale(0.97);
}

.pos-category-pill.active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--diraya-orange-strong);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.18);
}

.pos-category-pill.active i {
  color: var(--diraya-orange-strong);
}

html[data-theme="dark"] .pos-category-nav,
html[data-theme="dark"] .pos-category-pill {
  background: var(--pos-surface);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .pos-category-pill:hover,
html[data-theme="dark"] .pos-category-nav:hover:not(:disabled) {
  background: #1f2937;
  border-color: rgba(245, 158, 11, 0.4);
}

html[data-theme="dark"] .pos-category-pill.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fbbf24;
}

html.touch-screen-mode .pos-category-nav,
html.touch-screen-mode .pos-category-pill {
  min-height: 2.85rem;
}

html.touch-screen-mode .pos-category-nav {
  width: 2.85rem;
  height: 2.85rem;
}

html.touch-screen-mode .pos-category-pill {
  padding: 0.5rem 1.05rem;
  font-size: 0.9rem;
}

@media (pointer: coarse) {
  .pos-category-nav {
    width: 2.85rem;
    height: 2.85rem;
  }

  .pos-category-pill {
    min-height: 2.85rem;
    padding: 0.5rem 1.05rem;
    font-size: 0.9rem;
  }
}

.pos-terminal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.pos-terminal-panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pos-terminal-products {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
}

.pos-category-float {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: stretch;
  padding: 0.85rem 1rem;
}

.pos-category-float.hidden {
  display: none !important;
}

.pos-category-float-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.pos-category-float-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: min(70%, 28rem);
  overflow: auto;
  padding: 0.85rem;
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  background: var(--pos-surface);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.pos-category-float-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.65rem;
}

.pos-category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  min-height: 5.25rem;
  padding: 0.85rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.85rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.pos-category-card i {
  color: var(--diraya-orange);
  font-size: 1rem;
}

.pos-category-card span {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

.pos-category-card:hover {
  border-color: var(--diraya-orange);
  box-shadow: var(--pos-shadow);
  transform: translateY(-1px);
}

.pos-category-card.active {
  border-color: var(--diraya-orange-strong);
  background: rgba(245, 158, 11, 0.14);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
}

.pos-product-scroll {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4.75rem 1rem 1rem;
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}

.pos-product-grid.is-text-mode {
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 0.7rem;
}

.pos-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 1.05rem;
  background: #fff;
  color: var(--pos-text);
  text-align: start;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 16px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  min-width: 0;
}

/* Compact text cards when product images are disabled in Settings */
.pos-product-card.is-text-card {
  gap: 0.45rem;
  min-height: 7.25rem;
  padding: 0.85rem 0.9rem;
  border-inline-start: 3px solid rgba(245, 158, 11, 0.55);
  border-radius: 0.95rem;
  background: #fff;
}

.pos-product-card.is-text-card .pos-product-body {
  gap: 0.28rem;
}

.pos-product-card.is-text-card .pos-product-name {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-size: 0.98rem;
  line-height: 1.28;
}

.pos-product-card.is-text-card .pos-product-footer {
  padding-top: 0.45rem;
  margin-top: auto;
  border-top: 1px solid rgba(229, 231, 235, 0.9);
}

.pos-product-card.is-text-card .pos-product-price {
  font-size: 1.08rem;
}

.pos-product-card.is-text-card .pos-product-oos-badge {
  top: 0.65rem;
  inset-inline-end: 0.65rem;
}

html[data-theme="dark"] .pos-product-card.is-text-card {
  background: var(--pos-surface);
  border-inline-start-color: rgba(251, 191, 36, 0.55);
}

html[data-theme="dark"] .pos-product-card.is-text-card .pos-product-footer {
  border-top-color: rgba(55, 65, 81, 0.9);
}

html[data-theme="dark"] .pos-product-card {
  background: var(--pos-surface);
  border-color: var(--pos-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.22);
}

.pos-product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 128px;
  padding: 0;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #f3f1ec;
  flex-shrink: 0;
}

html[data-theme="dark"] .pos-product-image {
  background: color-mix(in srgb, var(--pos-surface-2) 88%, #000);
}

.pos-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.pos-product-image-empty {
  color: var(--diraya-gray-light);
  font-size: 1.55rem;
}

.pos-product-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.pos-product-card:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 10px 22px rgba(15, 23, 42, 0.07);
  transform: translateY(-1.5px);
}

.pos-product-card:hover .pos-product-add {
  background: rgba(245, 158, 11, 0.2);
}

.pos-product-card:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
}

.pos-product-card:active .pos-product-add {
  background: rgba(245, 158, 11, 0.28);
  transform: scale(0.96);
}

.pos-product-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: #1f2937;
  letter-spacing: -0.01em;
}

html[data-theme="dark"] .pos-product-name {
  color: var(--pos-text);
}

.pos-product-meta {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--pos-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.pos-product-price {
  margin-top: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--diraya-orange-strong);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.pos-product-list-price {
  display: inline-block;
  margin-inline-end: 0.35rem;
  color: var(--pos-muted, #6b7280);
  font-size: 0.78em;
  font-weight: 500;
  text-decoration: line-through;
}

.product-price-list {
  display: block;
  color: var(--pos-muted, #6b7280);
  font-size: 0.8rem;
  text-decoration: line-through;
}

.product-price-sale {
  color: #b45309;
}

.product-discount-badge {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.discount-modal-dialog {
  max-width: 28rem;
}

html[data-theme="dark"] .pos-product-price {
  color: var(--diraya-orange-light);
}

.pos-product-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--diraya-orange-strong);
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

html[data-theme="dark"] .pos-product-add {
  color: var(--diraya-orange-light);
  background: rgba(245, 158, 11, 0.18);
}

.pos-product-card.is-out-of-stock {
  opacity: 0.72;
}

.pos-product-card:disabled,
.pos-product-card.is-stock-limit {
  cursor: not-allowed;
  pointer-events: none;
}

.pos-product-card.is-out-of-stock::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 252, 248, 0.35);
  pointer-events: none;
}

html[data-theme="dark"] .pos-product-card.is-out-of-stock::after {
  background: rgba(17, 24, 39, 0.35);
}

.pos-product-oos-badge {
  position: absolute;
  top: 0.85rem;
  inset-inline-end: 0.85rem;
  z-index: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(55, 65, 81, 0.82);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  pointer-events: none;
  max-width: 7.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pos-cart-line.is-stock-limit .pos-qty-btn[data-action="inc"] {
  opacity: 0.4;
}

.pos-product-stock {
  font-size: 0.72rem;
  color: var(--pos-muted);
  margin-top: auto;
}

.pos-product-service {
  color: var(--diraya-orange-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pos-terminal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem 1rem;
  color: var(--pos-muted);
}

.pos-terminal-empty.hidden,
.pos-cart-empty.hidden,
.pos-success-overlay.hidden,
.pos-tab-badge.hidden,
.pos-refund-banner.hidden,
.pos-refund-summary.hidden,
.pos-checkout-overlay.hidden,
.pos-customer-modal.hidden {
  display: none !important;
}

.pos-terminal-cart {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--pos-surface);
  border-inline-start: 1px solid var(--pos-border);
  padding: 1rem;
}

.pos-cart-header,
.pos-cart-customer,
.pos-cart-summary,
.pos-checkout-btn {
  flex-shrink: 0;
}

.pos-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pos-cart-header-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex-wrap: wrap;
}

.pos-cart-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pos-text);
}

.pos-cart-touch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.pos-cart-touch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.55rem;
  padding: 0.5rem 0.7rem 0.45rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.6rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  flex: 1 1 calc(33.333% - 0.3rem);
  min-width: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.pos-cart-touch-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-cart-touch-btn i {
  flex-shrink: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.pos-cart-touch-btn:active {
  transform: scale(0.98);
}

.pos-cart-touch-btn--secondary {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
}

.pos-cart-touch-btn--secondary:hover,
.pos-cart-touch-btn--secondary:focus-visible {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.14);
}

.pos-cart-touch-btn--danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

.pos-cart-touch-btn--danger:hover,
.pos-cart-touch-btn--danger:focus-visible {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.14);
}

.pos-cart-touch-btn--customer {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
  color: var(--diraya-orange-strong);
}

.pos-cart-touch-btn--customer:hover,
.pos-cart-touch-btn--customer:focus-visible {
  border-color: var(--diraya-orange);
  background: rgba(245, 158, 11, 0.16);
}

html.touch-screen-mode .pos-cart-touch-btn {
  min-height: 2.55rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.84rem;
}

html.touch-screen-mode .pos-cart-touch-btn i {
  font-size: 0.9rem;
}

.pos-cart-clear {
  border: none;
  background: transparent;
  color: var(--pos-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.pos-cart-clear:hover {
  color: var(--diraya-orange-strong);
}

.pos-cart-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pos-muted);
  margin-bottom: 0.35rem;
}

.pos-cart-select {
  width: 100%;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.55rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  font-size: 0.88rem;
}

.pos-cart-customer {
  position: relative;
  margin-bottom: 0.75rem;
}

.pos-cart-customer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pos-cart-customer-title {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
}

.pos-cart-customer-head .pos-cart-label {
  margin-bottom: 0;
}

.pos-cart-optional {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pos-muted);
}

.pos-customer-add-icon {
  flex-shrink: 0;
}

.pos-customer-add-icon.hidden {
  display: none !important;
}

.pos-customer-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.65rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
}

.pos-customer-chip.hidden {
  display: none !important;
}

.pos-customer-chip.is-named {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.pos-customer-chip.is-guest {
  border-color: var(--pos-border);
  background: var(--pos-surface-2);
}

.pos-customer-chip i {
  color: var(--diraya-orange);
}

.pos-customer-chip-text {
  min-width: 0;
  flex: 1;
}

.pos-customer-chip-text strong,
.pos-customer-chip-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-customer-chip-text strong {
  font-size: 0.88rem;
}

.pos-customer-chip-text small {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--pos-muted);
}

.pos-customer-chip-clear {
  width: 1.85rem;
  height: 1.85rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--pos-muted);
  cursor: pointer;
}

.pos-customer-chip-clear:hover {
  color: var(--pos-text);
  background: var(--pos-surface);
}

.pos-cart-customer-search {
  display: flex;
  gap: 0.45rem;
}

.pos-cart-customer-search.hidden {
  display: none !important;
}

.pos-cart-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.55rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  font-size: 0.88rem;
}

.pos-cart-input:focus {
  outline: none;
  border-color: var(--diraya-orange);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.pos-customer-search-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 0.55rem;
  background: var(--diraya-orange);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pos-customer-search-btn:hover:not(:disabled) {
  background: var(--diraya-orange-strong);
}

.pos-customer-search-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.pos-customer-results {
  position: absolute;
  inset-inline: 0;
  top: calc(100% - 0.15rem);
  z-index: 8;
  display: flex;
  flex-direction: column;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--pos-border);
  border-radius: 0.65rem;
  background: var(--pos-surface);
  box-shadow: var(--pos-shadow);
}

.pos-customer-result-item,
.pos-customer-result-add {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--pos-border);
  background: transparent;
  color: var(--pos-text);
  text-align: start;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
}

.pos-customer-result-item strong {
  font-size: 0.85rem;
}

.pos-customer-result-item small {
  font-size: 0.72rem;
  color: var(--pos-muted);
}

.pos-customer-result-item:hover,
.pos-customer-result-add:hover,
.pos-customer-result-item.is-active,
.pos-customer-result-add.is-active {
  background: var(--pos-surface-2);
}

.pos-customer-result-item.is-active,
.pos-customer-result-add.is-active {
  background: var(--diraya-orange-muted);
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.55);
}

.pos-customer-result-empty {
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  color: var(--pos-muted);
}

.pos-customer-result-add {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  border-bottom: none;
  color: var(--diraya-orange-strong);
  font-weight: 700;
  font-size: 0.82rem;
}

.pos-customer-error {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: #ef4444;
}

.pos-customer-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: var(--pos-overlay);
}

.pos-customer-modal.hidden {
  display: none;
}

.pos-customer-modal-sheet {
  width: min(28rem, 100%);
  background: var(--pos-surface);
  color: var(--pos-text);
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  box-shadow: var(--pos-shadow);
  overflow: hidden;
}

.pos-customer-modal-head,
.pos-customer-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--pos-border);
}

.pos-customer-modal-footer {
  border-bottom: none;
  border-top: 1px solid var(--pos-border);
  justify-content: flex-end;
}

.pos-customer-modal-head h3 {
  margin: 0;
  font-size: 1rem;
}

.pos-customer-modal-body {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  overflow: auto;
}

.pos-move-table-sheet {
  max-width: 34rem;
  max-height: min(92vh, 44rem);
  display: flex;
  flex-direction: column;
}

.pos-move-table-sheet .pos-customer-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.pos-move-table-hint {
  margin: 0 0 0.85rem;
  color: var(--pos-muted);
  font-size: 0.85rem;
}

.pos-leave-table-sheet {
  width: min(32rem, 100%);
}

.pos-leave-table-message {
  margin: 0;
  color: var(--pos-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.pos-leave-table-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding: 1rem;
}

.pos-leave-table-action {
  width: 100%;
  min-height: 3.25rem;
  font-size: 1rem;
}

.pos-leave-table-stay {
  width: 100%;
  min-height: 2.75rem;
  border: none;
  border-radius: 0.7rem;
  background: transparent;
  color: var(--pos-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.pos-leave-table-stay:hover {
  color: var(--pos-text);
  background: rgba(148, 163, 184, 0.12);
}

.pos-move-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.55rem;
}

.pos-move-table-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 5.5rem;
  padding: 0.65rem 0.45rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.75rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.pos-move-table-tile:hover:not(:disabled) {
  border-color: var(--diraya-orange);
  background: rgba(245, 158, 11, 0.08);
  transform: translateY(-1px);
}

.pos-move-table-tile:disabled {
  opacity: 0.55;
  cursor: wait;
}

.pos-move-table-number {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.pos-move-table-name,
.pos-move-table-status {
  font-size: 0.68rem;
  color: var(--pos-muted);
  text-align: center;
}

.pos-move-table-status {
  color: #16a34a;
  font-weight: 700;
  text-transform: uppercase;
}

.pos-move-table-empty {
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: var(--pos-muted);
}

@media (min-width: 640px) {
  .pos-customer-modal {
    align-items: center;
  }
}

.pos-cart-items {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.85rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.55) transparent;
}

.pos-cart-items::-webkit-scrollbar {
  width: 4px;
}

.pos-cart-items::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.55);
  border-radius: 999px;
}

.pos-cart-empty {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0.75rem;
  text-align: center;
  color: var(--pos-muted);
}

.pos-cart-empty-visual {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-cart-empty-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
}

.pos-cart-empty-ring--outer {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 68%);
  box-shadow: inset 0 0 0 1px rgba(229, 231, 235, 0.9);
}

.pos-cart-empty-ring--mid {
  inset: 0.85rem;
  background: var(--pos-surface-2);
  border: 1px solid var(--pos-border);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.pos-cart-empty-icon {
  position: relative;
  z-index: 1;
  width: 3.6rem;
  height: 3.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  color: var(--pos-muted);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.pos-cart-empty-icon i {
  font-size: 1.55rem;
  line-height: 1;
}

.pos-cart-empty-sparkles {
  position: absolute;
  top: 0.85rem;
  left: 50%;
  z-index: 2;
  width: 2.4rem;
  height: 1rem;
  transform: translateX(-50%);
  pointer-events: none;
}

.pos-cart-empty-sparkles i {
  position: absolute;
  width: 0.35rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--diraya-orange);
  opacity: 0.9;
}

.pos-cart-empty-sparkles i:nth-child(1) {
  left: 0.15rem;
  top: 0.35rem;
  transform: rotate(-28deg);
}

.pos-cart-empty-sparkles i:nth-child(2) {
  left: 50%;
  top: 0;
  width: 0.28rem;
  height: 0.7rem;
  transform: translateX(-50%);
}

.pos-cart-empty-sparkles i:nth-child(3) {
  right: 0.15rem;
  top: 0.35rem;
  transform: rotate(28deg);
}

.pos-cart-empty-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  max-width: 16rem;
}

.pos-cart-empty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--pos-text);
}

.pos-cart-empty-hint {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--pos-muted);
}

html[data-theme="dark"] .pos-cart-empty-ring--outer {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 68%);
  box-shadow: inset 0 0 0 1px rgba(55, 65, 81, 0.9);
}

html[data-theme="dark"] .pos-cart-empty-ring--mid {
  background: var(--pos-surface-2);
}

.pos-cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.55rem 0.15rem;
  border: none;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--pos-border);
}

.pos-cart-line:last-child {
  border-bottom-color: var(--pos-border);
}

.pos-cart-line-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.pos-cart-line-info strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--pos-text);
}

.pos-cart-line-info span {
  font-size: 0.78rem;
  color: var(--pos-muted);
}

.pos-cart-line-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.pos-qty-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.45rem;
  background: var(--pos-surface);
  color: var(--pos-text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pos-qty-btn:hover {
  border-color: var(--diraya-orange);
  color: var(--diraya-orange-strong);
  background: var(--diraya-orange-muted);
}

.pos-qty-btn:active {
  transform: scale(0.96);
}

.pos-qty-input {
  width: 2.9rem;
  height: 2rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.45rem;
  background: var(--pos-surface);
  color: var(--pos-text);
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
  padding: 0;
  -moz-appearance: textfield;
}

.pos-qty-input::-webkit-outer-spin-button,
.pos-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pos-qty-input:focus {
  outline: none;
  border-color: var(--diraya-orange);
}

.pos-qty-remove {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}

.pos-cart-summary {
  border-top: 1px solid var(--pos-border);
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.pos-cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--pos-muted);
  margin-bottom: 0.35rem;
}

.pos-cart-row strong {
  color: var(--pos-text);
}

.pos-cart-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pos-text);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--pos-border);
}

.pos-cart-total strong {
  color: var(--diraya-orange-strong);
  font-size: 1.15rem;
}

.pos-checkout-btn {
  position: relative;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: var(--diraya-orange);
  color: #000;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.pos-checkout-btn:hover:not(:disabled) {
  background: var(--diraya-orange-strong);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.pos-checkout-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pos-terminal-tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--pos-border);
  background: var(--pos-surface);
}

.pos-terminal-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.35rem;
  border: none;
  background: transparent;
  color: var(--pos-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.pos-terminal-tab.active {
  color: var(--diraya-orange-strong);
  box-shadow: inset 0 2px 0 var(--diraya-orange);
}

.pos-tab-badge {
  position: absolute;
  top: 0.35rem;
  inset-inline-end: 28%;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--diraya-orange);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pos-success-overlay {
  position: fixed;
  inset: 0;
  background: var(--pos-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  padding: 1rem;
}

.pos-success-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.pos-success-actions .pos-checkout-secondary,
.pos-success-actions .pos-checkout-primary {
  min-width: 7.5rem;
}

.pos-success-card {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  max-width: min(28rem, 100%);
  width: 100%;
  max-height: min(92vh, 42rem);
  overflow: auto;
  box-shadow: var(--pos-shadow);
}

.pos-success-receipt-prompt {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pos-text);
}

.pos-success-receipt-prompt.hidden {
  display: none !important;
}

.pos-success-receipt-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  color: var(--pos-muted);
  font-size: 0.88rem;
}

.pos-success-receipt-loading.hidden {
  display: none !important;
}

.pos-success-receipt {
  text-align: left;
  margin-bottom: 1rem;
  max-height: min(42vh, 16rem);
  overflow: auto;
  border: 1px solid var(--pos-border);
  border-radius: 0.75rem;
  background: var(--pos-surface-2);
}

.pos-success-receipt.hidden {
  display: none !important;
}

.pos-receipt-sheet {
  width: 80mm;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.85rem 0.7rem;
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #111;
  background: #fff;
  box-sizing: border-box;
}

.pos-receipt-brand {
  text-align: center;
  margin-bottom: 0.5rem;
}

.pos-receipt-logo {
  text-align: center;
  margin-bottom: 0.4rem;
}

.pos-receipt-logo img {
  max-width: 68%;
  max-height: 3.6rem;
  object-fit: contain;
}

.pos-receipt-store-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #111;
}

.pos-receipt-sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: #555;
  margin-top: 0.15rem;
}

.pos-receipt-shop-meta {
  font-size: 0.7rem;
  color: #555;
  margin-top: 0.12rem;
  line-height: 1.3;
}

.pos-receipt-rule,
.pos-receipt-sep {
  border: 0;
  border-top: 1px dashed #222;
  margin: 0.55rem 0;
}

.pos-receipt-rule.is-heavy {
  border-top: 2px solid #111;
}

.pos-receipt-doc {
  text-align: center;
  margin: 0.15rem 0 0.5rem;
  color: #111;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pos-receipt-doc-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #444;
}

.pos-receipt-doc-id {
  margin-top: 0.15rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.pos-receipt-head {
  display: none;
}

.pos-receipt-meta {
  text-align: right;
  font-size: 0.75rem;
  color: var(--pos-muted);
}

.pos-receipt-info {
  display: grid;
  gap: 0.28rem;
}

.pos-receipt-kv,
.pos-receipt-info > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.pos-receipt-kv span,
.pos-receipt-info span {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
  flex: 0 0 auto;
}

.pos-receipt-kv strong,
.pos-receipt-info strong {
  font-size: 0.8rem;
  font-weight: 600;
  color: #111;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pos-receipt-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  margin-bottom: 0.4rem;
}

.pos-receipt-items {
  display: grid;
  gap: 0.55rem;
}

.pos-receipt-item-name {
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pos-receipt-item-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.12rem;
  font-variant-numeric: tabular-nums;
}

.pos-receipt-item-meta {
  color: #555;
  font-size: 0.78rem;
}

.pos-receipt-item-total {
  font-weight: 700;
  font-size: 0.84rem;
  white-space: nowrap;
}

.pos-receipt-empty {
  text-align: center;
  color: #666;
  padding: 0.55rem 0;
}

.pos-receipt-summary {
  display: grid;
  gap: 0.32rem;
}

.pos-receipt-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.pos-receipt-summary-row span {
  color: #333;
  font-weight: 600;
}

.pos-receipt-summary-value {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pos-receipt-summary-row.is-muted span,
.pos-receipt-summary-row.is-muted .pos-receipt-summary-value {
  color: #555;
  font-weight: 600;
}

.pos-receipt-summary-row.is-grand {
  margin-top: 0.2rem;
  padding-top: 0.4rem;
  border-top: 1px solid #111;
  font-size: 0.95rem;
}

.pos-receipt-summary-row.is-grand span,
.pos-receipt-summary-row.is-grand .pos-receipt-summary-value {
  font-weight: 800;
}

.pos-receipt-lbp {
  display: block;
  margin-top: 0.05rem;
  font-size: 0.86em;
  font-weight: 600;
  color: #555;
}

.pos-receipt-thanks {
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  margin-top: 0.1rem;
  letter-spacing: 0.04em;
  color: #111;
}

.pos-receipt-footer {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  color: #555;
  white-space: pre-wrap;
  line-height: 1.35;
}

.pos-receipt-sheet.is-80mm {
  width: 80mm;
}

.pos-receipt-sheet.is-58mm {
  width: 58mm;
  padding: 0.55rem 0.4rem;
  font-size: 0.72rem;
}

.pos-receipt-sheet.is-58mm .pos-receipt-store-name {
  font-size: 0.95rem;
}

.pos-receipt-sheet.is-58mm .pos-receipt-sub,
.pos-receipt-sheet.is-58mm .pos-receipt-shop-meta,
.pos-receipt-sheet.is-58mm .pos-receipt-footer {
  font-size: 0.64rem;
}

.pos-receipt-sheet.is-58mm .pos-receipt-doc-label,
.pos-receipt-sheet.is-58mm .pos-receipt-section-label,
.pos-receipt-sheet.is-58mm .pos-receipt-kv span,
.pos-receipt-sheet.is-58mm .pos-receipt-info span {
  font-size: 0.6rem;
}

.pos-receipt-sheet.is-58mm .pos-receipt-doc-id {
  font-size: 0.78rem;
}

.pos-receipt-sheet.is-58mm .pos-receipt-kv strong,
.pos-receipt-sheet.is-58mm .pos-receipt-info strong,
.pos-receipt-sheet.is-58mm .pos-receipt-item-meta,
.pos-receipt-sheet.is-58mm .pos-receipt-summary-row {
  font-size: 0.7rem;
}

.pos-receipt-sheet.is-58mm .pos-receipt-item-name,
.pos-receipt-sheet.is-58mm .pos-receipt-item-total {
  font-size: 0.74rem;
}

.pos-receipt-sheet.is-58mm .pos-receipt-summary-row.is-grand {
  font-size: 0.82rem;
}

.pos-receipt-sheet.is-58mm .pos-receipt-thanks {
  font-size: 0.78rem;
}

.pos-receipt-sheet.is-58mm .pos-receipt-logo img {
  max-height: 2.6rem;
}

.pos-success-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  background: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.pos-success-card h3 {
  margin: 0 0 0.35rem;
  color: var(--pos-text);
}

.pos-success-card p {
  margin: 0 0 1rem;
  color: var(--pos-muted);
}

.pos-success-change {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: -0.35rem 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.pos-success-change span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pos-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pos-success-change strong {
  font-size: 1.55rem;
  font-weight: 800;
  color: #16a34a;
  line-height: 1.1;
}

.pos-success-change .pos-pay-alt {
  color: #15803d;
}

/* POS checkout wizard */
body.pos-checkout-open {
  overflow: hidden;
}

.pos-checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: var(--pos-overlay);
}

.pos-checkout-overlay.hidden {
  display: none !important;
}

.pos-checkout-sheet {
  width: 100%;
  max-width: min(76rem, 98vw);
  max-height: min(92vh, 52rem);
  display: flex;
  flex-direction: column;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 1.1rem 1.1rem 0 0;
  box-shadow: var(--pos-shadow);
  overflow: hidden;
}

.pos-checkout-header {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--pos-border);
}

.pos-checkout-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--pos-text);
}

.pos-checkout-customer {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--pos-muted);
}

.pos-checkout-close {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.65rem;
  background: transparent;
  color: var(--pos-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pos-checkout-close:hover {
  color: var(--pos-text);
  border-color: var(--diraya-orange);
}

.pos-checkout-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
}

.pos-checkout-step-dot {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--pos-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.pos-checkout-step-dot span {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1.5px solid var(--pos-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.pos-checkout-step-dot.active {
  color: var(--pos-text);
}

.pos-checkout-step-dot.active span,
.pos-checkout-step-dot.done span {
  background: var(--diraya-orange);
  border-color: var(--diraya-orange);
  color: #000;
}

.pos-checkout-step-line {
  flex: 1;
  height: 2px;
  background: var(--pos-border);
  border-radius: 999px;
}

.pos-checkout-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 1.15rem 0.85rem;
}

.pos-checkout-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.pos-checkout-summary .pos-checkout-grid {
  grid-template-columns: repeat(2, 1fr);
}

.pos-checkout-summary .pos-checkout-options {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--pos-border);
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0.65rem;
}

.pos-checkout-debt-block {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0.65rem;
}

.pos-checkout-debt-block.hidden {
  display: none !important;
}

#posCkDebtDueWrap.hidden {
  display: none !important;
}

.pos-checkout-payment .pos-pay-due {
  margin-bottom: 0.75rem;
  padding: 0.75rem 0.9rem;
}

.pos-checkout-payment .pos-pay-due strong {
  font-size: 1.55rem;
}

.pos-checkout-section {
  margin-bottom: 0;
  padding: 0.75rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.85rem;
  background: var(--pos-bg);
}

.pos-checkout-pane {
  display: none;
}

.pos-checkout-pane.active {
  display: block;
}

.pos-checkout-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--pos-text);
}

.pos-checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.pos-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pos-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pos-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pos-field-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.55rem;
  background: var(--pos-surface);
  color: var(--pos-text);
  font-size: 0.92rem;
}

.pos-field-input:focus {
  outline: none;
  border-color: var(--diraya-orange);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.pos-field-input:disabled,
.pos-field-input[readonly] {
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.03);
}

.pos-field-total {
  grid-column: 1 / -1;
}

.pos-field-total-input {
  font-size: 1.2rem !important;
  font-weight: 800;
  color: var(--diraya-orange-strong) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  background: var(--diraya-orange-muted) !important;
}

.pos-checkout-options {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0.75rem;
}

.pos-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pos-text);
  cursor: pointer;
}

.pos-check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--diraya-orange);
}

.pos-pay-due {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 0.85rem;
  background: var(--diraya-orange-muted);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pos-pay-due span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pos-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pos-pay-due strong {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--diraya-orange-strong);
  line-height: 1;
}

.pos-pay-grid {
  margin-bottom: 0.85rem;
}

#posPayPartialWrap:not(.is-debt) .pos-field-hint {
  display: none;
}

#posPayPartialWrap:not(.is-debt) label::after {
  content: none;
}

#posPayPartialWrap:not(.is-debt) #posPayAmountNow {
  pointer-events: none;
  opacity: 0.7;
}

.pos-field-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--pos-muted);
}

.pos-pay-dual {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  line-height: 1.15;
}

.pos-pay-dual-end {
  align-items: flex-end;
}

.pos-pay-alt {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--pos-muted);
}

.pos-received-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.pos-received-head label {
  margin: 0;
}

.pos-currency-toggle {
  display: inline-flex;
  border: 1px solid var(--pos-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--pos-bg);
}

.pos-currency-btn {
  border: none;
  background: transparent;
  color: var(--pos-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.pos-currency-btn.is-active {
  background: var(--diraya-orange);
  color: #111;
}

.pos-field-received {
  margin-bottom: 0.65rem;
}

.pos-received-mixed {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.85fr) minmax(12rem, 1.55fr);
  gap: 0.65rem;
}

.pos-field-currency label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pos-muted);
}

.pos-pay-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--pos-radius-sm, 0.5rem);
  background: var(--pos-surface-2, rgba(0, 0, 0, 0.03));
  margin-bottom: 0.5rem;
}

.pos-pay-summary-row span {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--pos-muted);
}

.pos-pay-summary-row.has-value strong {
  color: var(--diraya-orange, #f59e0b);
}

.pos-pay-remaining.is-short {
  background: rgba(180, 83, 9, 0.08);
}

.pos-pay-remaining.is-short strong {
  color: #b45309;
}

.pos-pay-received-input {
  font-size: 1.35rem !important;
  font-weight: 700;
  padding: 0.75rem 0.85rem !important;
}

/* LBP figures are often 6–9 digits — give them room so they stay large and readable */
.pos-lbp-input,
input.pos-lbp-input,
.pos-field-lbp .pos-field-input,
.page-field-lbp .page-input,
.settings-money-field-lbp .settings-money-input-row input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  min-width: 14ch;
  font-size: 1.45rem !important;
  font-weight: 700 !important;
}

.pos-field-lbp {
  min-width: 0;
}

.pos-change-sheet {
  width: min(38rem, 100%);
}

.pos-change-give-grid {
  grid-template-columns: minmax(7.5rem, 0.8fr) minmax(13rem, 1.6fr) !important;
}

.pos-change-give-grid .pos-field-lbp .pos-lbp-input {
  font-size: 1.55rem !important;
  padding: 0.85rem 0.95rem !important;
}

@media (max-width: 520px) {
  .pos-received-mixed,
  .pos-change-give-grid {
    grid-template-columns: 1fr !important;
  }
}

.pos-pay-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.pos-pay-chip {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--pos-border);
  border-radius: 999px;
  background: var(--pos-bg);
  color: var(--pos-text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.pos-pay-chip:hover {
  border-color: var(--diraya-orange);
  color: var(--diraya-orange-strong);
}

.pos-pay-change {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.1rem;
  border-radius: 0.85rem;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  text-align: inherit;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pos-pay-change:hover,
.pos-pay-change:focus-visible {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
  outline: none;
}

.pos-pay-change-edit {
  margin-inline-start: 0.35rem;
  font-size: 0.75rem;
  opacity: 0.65;
}

.pos-pay-change span {
  color: var(--pos-muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.pos-pay-change .pos-pay-dual strong {
  font-size: 1.25rem;
}

.pos-logout-btn {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.pos-topbar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--pos-topbar-control-size);
  height: var(--pos-topbar-control-size);
  padding: 0;
  border: 1px solid var(--pos-sidebar-border);
  border-radius: 0.85rem;
  background: rgba(243, 244, 246, 0.9);
  color: var(--pos-muted);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pos-topbar-logout:hover {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

/* Auth / login */
.pos-auth-body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--pos-bg, #f9fafb);
  font-family: var(--pos-font, "IBM Plex Sans", "Cairo", sans-serif);
  color: var(--pos-text, #111827);
  overflow-x: hidden;
}

html[dir="rtl"] .pos-auth-body {
  font-family: var(--pos-font-ar, "Cairo", "IBM Plex Sans", sans-serif);
}

.pos-auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: block;
  width: 100%;
  padding: 0;
}

.pos-auth-stage {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  animation: pos-auth-fade 0.55s ease both;
}

@keyframes pos-auth-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pos-auth-rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pos-auth-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
}

.pos-auth-hero-glow,
.pos-auth-hero-grid,
.pos-auth-hero-content,
.pos-auth-hero-foot,
.pos-auth-hero-logo,
.pos-auth-hero-eyebrow,
.pos-auth-hero-brand,
.pos-auth-hero-copy {
  display: none !important;
}

.pos-auth-hero-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center center;
}

.pos-auth-panel {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1.5rem 1.25rem 2rem;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 42%),
    var(--pos-bg, #f9fafb);
}

.pos-auth-panel-inner {
  width: 100%;
  max-width: 24.5rem;
  margin: auto 0;
  animation: pos-auth-rise 0.65s ease 0.16s both;
}

.pos-auth-panel-header {
  margin-bottom: 1.5rem;
}

.pos-auth-panel-logo {
  display: block;
  width: auto;
  height: 4.25rem;
  object-fit: contain;
  margin: 0 0 1.1rem;
}

.pos-auth-panel-header h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--pos-text, #111827);
}

.pos-auth-panel-header p {
  margin: 0.4rem 0 0;
  color: var(--pos-muted, #6b7280);
  font-size: 0.92rem;
  line-height: 1.45;
}

.pos-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pos-auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pos-auth-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pos-text, #111827);
}

.pos-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pos-auth-input-icon {
  position: absolute;
  inset-inline-start: 0.95rem;
  color: var(--pos-muted, #6b7280);
  font-size: 0.82rem;
  pointer-events: none;
}

.pos-auth-input {
  width: 100%;
  padding: 0.85rem 2.75rem 0.85rem 2.45rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 0.85rem;
  background: var(--pos-surface, #fff);
  color: inherit;
  font-size: 1rem;
  line-height: 1.3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

html[dir="rtl"] .pos-auth-input {
  padding: 0.85rem 2.45rem 0.85rem 2.75rem;
}

.pos-auth-input::placeholder {
  color: var(--diraya-gray-light, #9ca3af);
}

.pos-auth-input:hover {
  border-color: #d1d5db;
}

.pos-auth-input:focus {
  outline: none;
  border-color: var(--diraya-orange, #f59e0b);
  box-shadow: 0 0 0 4px var(--pos-focus-ring, rgba(245, 158, 11, 0.35));
  background: var(--pos-surface, #fff);
}

.pos-auth-toggle-password {
  position: absolute;
  inset-inline-end: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: none;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--pos-muted, #6b7280);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.pos-auth-toggle-password:hover,
.pos-auth-toggle-password[aria-pressed="true"] {
  color: var(--diraya-orange-strong, #d97706);
  background: var(--diraya-orange-muted, rgba(245, 158, 11, 0.12));
}

.identity-toggle-password {
  position: absolute;
  inset-inline-end: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--pos-muted, #6b7280);
  cursor: pointer;
}

.identity-toggle-password:hover,
.identity-toggle-password[aria-pressed="true"] {
  color: var(--diraya-orange-strong, #d97706);
  background: var(--diraya-orange-muted, rgba(245, 158, 11, 0.12));
}

.pos-auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--pos-muted, #6b7280);
  user-select: none;
  cursor: pointer;
}

.pos-auth-remember .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--diraya-orange, #f59e0b);
  cursor: pointer;
}

.pos-auth-submit {
  margin-top: 0.35rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 1.15rem;
  border: none;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, var(--diraya-orange-light, #fbbf24) 0%, var(--diraya-orange, #f59e0b) 45%, var(--diraya-orange-strong, #d97706) 100%);
  color: #111827;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(217, 119, 6, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.pos-auth-submit i {
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

html[dir="rtl"] .pos-auth-submit i {
  transform: scaleX(-1);
}

.pos-auth-submit:hover {
  filter: brightness(1.03);
  box-shadow: 0 14px 28px rgba(217, 119, 6, 0.34);
  transform: translateY(-1px);
}

.pos-auth-submit:hover i {
  transform: translateX(0.2rem);
}

html[dir="rtl"] .pos-auth-submit:hover i {
  transform: scaleX(-1) translateX(0.2rem);
}

.pos-auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(217, 119, 6, 0.24);
}

.pos-auth-alert {
  margin: 0 0 0.25rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  line-height: 1.45;
}

.pos-auth-alert:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

.pos-auth-error,
.pos-auth-field-error {
  color: #dc2626;
  font-size: 0.82rem;
}

.pos-auth-field-error:empty {
  display: none;
}

/* Legacy compact auth card (license / other auth pages) */
.pos-auth-card {
  width: 100%;
  max-width: 24rem;
  margin: 1.5rem auto;
  padding: 1.75rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 1.1rem;
  background: var(--pos-surface, #fff);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.pos-auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.pos-auth-brand img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.pos-auth-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.pos-auth-brand p {
  margin: 0.35rem 0 0;
  color: var(--pos-muted, #6b7280);
  font-size: 0.9rem;
}

html[data-theme="dark"] .pos-auth-panel {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 42%),
    #000000;
}

html[data-theme="dark"] .pos-auth-input {
  background: var(--pos-surface-2, #1f2937);
  border-color: var(--pos-border, #374151);
}

html[data-theme="dark"] .pos-auth-input:hover {
  border-color: #4b5563;
}

html[data-theme="dark"] .pos-auth-submit {
  color: #111827;
}

@media (max-width: 959.98px) {
  .pos-auth-stage {
    grid-template-rows: auto auto;
  }

  .pos-auth-hero {
    aspect-ratio: 1086 / 1448;
    width: 100%;
    max-height: min(56dvh, calc(100vw * 1448 / 1086));
  }
}

@media (min-width: 768px) {
  .pos-auth-panel {
    padding: 2.25rem 2rem 2.5rem;
  }
}

@media (min-width: 960px) {
  .pos-auth-stage {
    grid-template-columns: 75dvh 1fr;
    grid-template-rows: 1fr;
    height: 100vh;
    height: 100dvh;
  }

  html[dir="rtl"] .pos-auth-hero {
    grid-column: 2;
  }

  html[dir="rtl"] .pos-auth-panel {
    grid-column: 1;
  }

  .pos-auth-hero {
    height: 100%;
    min-height: 0;
  }

  .pos-auth-panel {
    align-items: center;
    padding: 2.5rem 3rem;
  }

  .pos-auth-panel-inner {
    max-width: 23.5rem;
  }

  .pos-auth-panel-logo {
    height: 4.75rem;
  }
}

@media (max-width: 479.98px) {
  .pos-auth-panel {
    padding: 1.4rem 1.15rem 1.9rem;
  }

  .pos-auth-panel-header {
    margin-bottom: 1.25rem;
  }

  .pos-auth-panel-logo {
    height: 3.5rem;
    margin-bottom: 0.9rem;
  }

  .pos-auth-panel-header h2 {
    font-size: 1.4rem;
  }

  .pos-auth-input {
    font-size: 16px; /* avoid iOS zoom on focus */
  }
}

@media (prefers-reduced-motion: reduce) {
  .pos-auth-stage,
  .pos-auth-panel-inner,
  .pos-auth-submit,
  .pos-auth-submit i {
    animation: none !important;
    transition: none !important;
  }
}


.pos-confirm-sheet {
  width: min(24rem, 100%);
}

#posConfirmModal {
  z-index: 10060;
}

.pos-confirm-message {
  margin: 0;
  color: var(--pos-text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.pos-pay-change.has-change {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.pos-pay-change.has-change strong {
  color: #16a34a;
}

.pos-change-sheet .pos-change-total,
.pos-change-sheet .pos-change-remaining {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  margin-bottom: 0.85rem;
}

.pos-change-sheet .pos-change-total strong,
.pos-change-sheet .pos-change-remaining strong {
  font-size: 1.15rem;
}

.pos-change-sheet .pos-change-remaining.is-covered {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

#posChangeModal {
  z-index: 10050;
}

.pos-pay-change.is-short {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}

.pos-pay-change.is-short strong {
  color: #dc2626;
}

.pos-pay-error {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
}

.pos-checkout-footer {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem 1.1rem;
  border-top: 1px solid var(--pos-border);
  background: var(--pos-surface);
}

.pos-checkout-footer-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pos-checkout-primary,
.pos-checkout-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  border-radius: 0.7rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.pos-checkout-primary {
  background: var(--diraya-orange);
  color: #000;
}

.pos-checkout-primary:hover:not(:disabled) {
  background: var(--diraya-orange-strong);
}

.pos-checkout-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pos-checkout-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  border-radius: 0.7rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: #dc2626;
  color: #fff;
}

.pos-checkout-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.pos-checkout-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pos-delivery-sheet {
  width: min(56rem, 96vw);
  max-width: min(56rem, 96vw);
  max-height: min(92vh, 48rem);
  display: flex;
  flex-direction: column;
}

.pos-delivery-sheet .pos-customer-modal-body {
  flex: 1;
  min-height: 0;
}

.pos-delivery-content {
  display: grid;
  gap: 0.9rem;
}

.pos-delivery-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pos-delivery-summary-row strong {
  font-size: 1.05rem;
}

.pos-delivery-meta {
  margin-top: 0.35rem;
  color: var(--pos-muted);
  font-size: 0.82rem;
}

.pos-delivery-field p {
  margin: 0.2rem 0 0;
  color: var(--pos-text);
  white-space: pre-wrap;
}

.pos-delivery-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pos-muted);
}

.pos-delivery-items h4 {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
}

.pos-delivery-items-table {
  overflow: auto;
  border: 1px solid var(--pos-border);
  border-radius: 0.7rem;
}

.pos-delivery-items-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.pos-delivery-items-table th,
.pos-delivery-items-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--pos-border);
  text-align: start;
}

.pos-delivery-items-table th.num,
.pos-delivery-items-table td.num {
  text-align: end;
  white-space: nowrap;
}

.pos-delivery-items-table tr:last-child td {
  border-bottom: none;
}

.pos-delivery-empty {
  margin: 0;
  color: var(--pos-muted);
  font-size: 0.85rem;
}

.pos-delivery-totals {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.25rem;
}

.pos-delivery-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--pos-muted);
}

.pos-delivery-totals > div.is-total {
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--pos-border);
  color: var(--pos-text);
  font-size: 0.95rem;
}

.pos-delivery-footer {
  flex-wrap: wrap;
}

.pos-delivery-edit .pos-field-input {
  resize: vertical;
}

@media (min-width: 768px) {
  .pos-customer-modal {
    align-items: center;
  }
}

.pos-checkout-secondary {
  background: transparent;
  border: 1px solid var(--pos-border);
  color: var(--pos-text);
}

.pos-checkout-secondary:hover {
  border-color: var(--diraya-orange);
}

@media (min-width: 640px) {
  .pos-checkout-overlay {
    align-items: center;
    padding: 1.25rem;
  }

  .pos-checkout-sheet {
    border-radius: 1.1rem;
    max-height: min(88vh, 52rem);
  }

  .pos-checkout-layout {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }

  .pos-checkout-summary .pos-checkout-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pos-checkout-options {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.75rem 1.5rem;
  }

  .pos-checkout-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .pos-checkout-summary .pos-field-total {
    grid-column: 1 / -1;
  }

  .pos-pay-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 991px) {
  .pos-content-terminal {
    height: auto;
    min-height: 0;
  }

  .pos-shell-terminal .pos-terminal-tabs {
    flex-shrink: 0;
  }

  .pos-terminal-body {
    grid-template-columns: 1fr;
  }

  .pos-terminal-panel {
    display: none;
  }

  .pos-terminal-panel.active {
    display: flex;
  }

  .pos-terminal-tabs {
    display: grid;
  }
}

@media (min-width: 992px) {
  .pos-terminal-cart {
    display: flex !important;
  }

  .pos-terminal-products {
    display: flex !important;
  }
}

.code-kind-field .code-kind-control {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}

.code-kind-field .code-kind-control > select {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.code-kind-add-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  min-height: 2.5rem;
  border: 1px solid var(--pos-border, #d1d5db);
  border-radius: 0.5rem;
  background: var(--pos-surface, #fff);
  color: var(--diraya-orange, #f59e0b);
  cursor: pointer;
}

.code-kind-add-btn:hover {
  background: #fff7ed;
  color: #d97706;
  border-color: #fbbf24;
}

.code-kind-add-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.code-kind-quick-add-dialog {
  width: min(28rem, calc(100vw - 2rem));
  max-width: 28rem;
}
/* Dining tables board / manage — Diraya POS themed */
.tables-board,
.tables-manage {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.tables-board-head,
.tables-manage .page-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.tables-board-head h1,
.tables-manage .page-list-head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--pos-text);
}

.tables-board-head p,
.tables-manage .page-list-head p {
  margin: 0.25rem 0 0;
  color: var(--pos-muted);
  font-size: 0.88rem;
}

.tables-board-actions {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* KPI strip */
.tables-board-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.tables-stat {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--pos-border);
  border-radius: 1rem;
  background: var(--pos-surface);
  box-shadow: var(--pos-shadow);
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tables-stat::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--diraya-charcoal);
  opacity: 0.35;
}

.tables-stat:hover {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.12);
}

.tables-stat.is-total::before {
  background: linear-gradient(180deg, var(--diraya-orange), var(--diraya-orange-strong));
  opacity: 1;
}

.tables-stat.is-free::before {
  background: linear-gradient(180deg, #34d399, #059669);
  opacity: 1;
}

.tables-stat.is-occupied::before {
  background: linear-gradient(180deg, var(--diraya-orange-light), var(--diraya-orange-strong));
  opacity: 1;
}

.tables-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--pos-surface-2);
  color: var(--diraya-charcoal);
  font-size: 1rem;
  flex-shrink: 0;
}

.tables-stat.is-total .tables-stat-icon {
  background: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
}

.tables-stat.is-free .tables-stat-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.tables-stat.is-occupied .tables-stat-icon {
  background: rgba(245, 158, 11, 0.16);
  color: var(--diraya-orange-strong);
}

.tables-stat-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.tables-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pos-muted);
}

.tables-stat strong {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--pos-text);
  line-height: 1.1;
}

.tables-stat.is-free strong {
  color: #059669;
}

.tables-stat.is-occupied strong {
  color: var(--diraya-orange-strong);
}

/* Table tiles grid */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.85rem;
}

.tables-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 11rem;
  padding: 1.1rem 1.1rem 1.15rem;
  border-radius: 1rem;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  box-shadow: var(--pos-shadow);
  cursor: pointer;
  text-align: start;
  overflow: hidden;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.tables-tile-accent {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: var(--diraya-charcoal);
  opacity: 0.2;
}

.tables-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.35rem;
}

.tables-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.55rem;
  background: var(--pos-surface-2);
  color: var(--pos-muted);
  font-size: 0.92rem;
  flex-shrink: 0;
}

.tables-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.tables-tile:active {
  transform: translateY(-1px);
}

.tables-tile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--pos-focus-ring), var(--pos-shadow);
}

.tables-tile.is-free {
  border-color: rgba(16, 185, 129, 0.3);
  background:
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.12), transparent 55%),
    var(--pos-surface);
}

.tables-tile.is-free .tables-tile-accent {
  background: linear-gradient(90deg, #34d399, #059669);
  opacity: 1;
}

.tables-tile.is-free .tables-tile-icon {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.tables-tile.is-occupied {
  border-color: rgba(245, 158, 11, 0.42);
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.18), transparent 55%),
    var(--pos-surface);
}

.tables-tile.is-occupied .tables-tile-accent {
  background: linear-gradient(90deg, var(--diraya-orange-light), var(--diraya-orange-strong));
  opacity: 1;
}

.tables-tile.is-occupied .tables-tile-icon {
  background: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
}

.tables-tile-status {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pos-muted);
}

.tables-tile.is-free .tables-tile-status {
  color: #059669;
}

.tables-tile.is-occupied .tables-tile-status {
  color: var(--diraya-orange-strong);
}

.tables-tile-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--pos-text);
  margin-top: 0.15rem;
}

.tables-tile-name {
  font-size: 0.86rem;
  color: var(--pos-muted);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tables-tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin-top: auto;
  padding-top: 0.45rem;
  width: 100%;
  font-size: 0.76rem;
  color: var(--pos-muted);
  border-top: 1px dashed var(--pos-border);
}

.tables-tile-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.tables-tile-meta-item i {
  color: var(--diraya-orange-strong);
  font-size: 0.7rem;
}

.tables-tile-meta-total {
  font-weight: 800;
  color: var(--diraya-orange-strong);
  font-variant-numeric: tabular-nums;
}

.tables-tile-cta {
  color: var(--diraya-orange-strong);
  font-weight: 700;
  border-top: none;
  padding-top: 0.25rem;
}

/* Empty state */
.tables-board-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 3.25rem 1.5rem;
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: 1.1rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.1), transparent 60%),
    var(--pos-surface);
  box-shadow: var(--pos-shadow);
}

.tables-board-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
  font-size: 1.35rem;
}

.tables-board-empty h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--pos-text);
}

.tables-board-empty p {
  margin: 0;
  color: var(--pos-muted);
  max-width: 24rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tables-manage-empty {
  border: none;
  border-top: 1px solid var(--pos-border);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 2rem 1rem;
}

/* Manage table */
.tables-manage-card {
  min-height: min(20rem, 60vh);
}

.tables-manage-table {
  table-layout: fixed;
  width: 100%;
  --table-row-h: 3.85rem;
}

.tables-manage-table tbody td {
  min-height: 3.85rem;
  padding-block: 0.8rem !important;
}

.tables-manage-table .tables-col-number {
  width: 4.25rem;
}

.tables-manage-table .tables-col-status {
  width: 7.25rem;
}

.tables-manage-table .tables-col-state {
  width: 8.25rem;
}

.tables-manage-table .tables-col-actions {
  width: 8.5rem;
}

.tables-manage-table thead th.tables-manage-actions-col,
.tables-manage-table td.tables-manage-actions {
  width: 8.5rem;
  text-align: end;
}

.tables-manage-table .tables-manage-col-number,
.tables-manage-table .tables-manage-col-status,
.tables-manage-table .tables-manage-col-state {
  white-space: nowrap;
}

.tables-manage-table .tables-manage-col-number {
  padding-inline: 0.45rem !important;
}

.tables-manage-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.tables-manage-actions .page-btn-sm {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tables-manage-actions .page-btn-sm i {
  margin: 0;
  font-size: 0.9rem;
}

.tables-manage .tables-edit-number,
.tables-manage .tables-edit-name {
  min-height: 2.85rem;
  height: 2.85rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.92rem;
  border-radius: 0.55rem;
}

.tables-manage-table input.tables-edit-number {
  width: 3.75rem;
  max-width: 3.75rem;
  min-width: 3.75rem;
  padding-inline: 0.35rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tables-manage .tables-edit-name {
  width: 100%;
  min-width: 0;
}

.tables-manage .tables-edit-number:focus,
.tables-manage .tables-edit-name:focus {
  border-color: var(--diraya-orange);
  box-shadow: 0 0 0 3px var(--pos-focus-ring);
}

.tables-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.tables-badge i {
  font-size: 0.55rem;
}

.tables-badge.is-free,
.tables-badge.is-active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.22);
}

.tables-badge.is-occupied {
  background: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
  border-color: rgba(245, 158, 11, 0.28);
}

.tables-badge.is-inactive {
  background: rgba(107, 114, 128, 0.1);
  color: var(--diraya-gray-medium);
  border-color: rgba(107, 114, 128, 0.2);
}

.tables-manage .tables-save-btn:hover {
  border-color: var(--diraya-orange);
  color: var(--diraya-orange-strong);
  background: var(--diraya-orange-muted);
}

.tables-manage .tables-toggle-btn[data-active="true"] {
  color: var(--diraya-orange-strong);
}

/* Add-table modal */
.tables-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1rem 1rem;
}

.tables-modal.hidden {
  display: none;
}

.tables-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--pos-overlay);
  backdrop-filter: blur(2px);
}

.tables-modal-dialog {
  position: relative;
  width: min(26rem, calc(100vw - 2rem));
  margin: 0;
  padding: 1.25rem;
  z-index: 1;
  border: 1px solid var(--pos-border);
  box-shadow: var(--pos-shadow);
}

.tables-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.tables-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
  font-size: 1rem;
}

.tables-modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pos-text);
}

.tables-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tables-modal-error {
  margin: 0;
  font-size: 0.85rem;
  color: #dc2626;
}

.tables-modal-error.hidden {
  display: none;
}

html[data-theme="dark"] .tables-tile:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 158, 11, 0.25);
}

html[data-theme="dark"] .tables-stat:hover {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .tables-stat.is-free strong {
  color: #34d399;
}

html[data-theme="dark"] .tables-badge.is-free,
html[data-theme="dark"] .tables-badge.is-active {
  color: #34d399;
}

@media (max-width: 768px) {
  .tables-board-stats {
    grid-template-columns: 1fr;
  }

  .tables-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .tables-tile {
    min-height: 10.5rem;
    padding: 1rem;
  }

  .tables-tile-number {
    font-size: 1.75rem;
  }
}

html[data-touch-screen="true"] .tables-tile {
  min-height: 12.5rem;
  padding: 1.2rem 1.15rem 1.25rem;
}

html[data-touch-screen="true"] .tables-grid {
  gap: 1rem;
}

html[data-touch-screen="true"] .tables-manage-table {
  --table-row-h: 4.35rem;
}

html[data-touch-screen="true"] .tables-manage-table tbody td {
  min-height: 4.35rem;
  padding-block: 0.95rem !important;
}

html[data-touch-screen="true"] .tables-manage .tables-edit-number,
html[data-touch-screen="true"] .tables-manage .tables-edit-name {
  min-height: 3.1rem;
  height: 3.1rem;
  font-size: 1rem;
}

html[data-touch-screen="true"] .tables-manage-actions .page-btn-sm {
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
  min-height: 3rem;
}

html[data-touch-screen="true"] .tables-manage-actions .page-btn-sm i {
  font-size: 1rem;
}

@media (min-width: 1200px) {
  .tables-grid {
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  }
}

.pos-cart-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.pos-cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.pos-cart-table-actions {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.pos-cart-table-actions .pos-hold-btn {
  flex: 1;
  width: auto;
  min-width: 0;
}

.pos-cart-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
}

.pos-cart-quick-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 3.6rem;
  padding: 0.45rem 0.35rem 0.4rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.7rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pos-cart-quick-btn i {
  font-size: 1.05rem;
  color: var(--diraya-orange-strong);
}

.pos-cart-quick-btn:hover,
.pos-cart-quick-btn:focus-visible {
  border-color: var(--diraya-orange);
  background: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
}

.pos-cart-quick-btn:active {
  transform: scale(0.97);
}

.pos-cart-quick-btn.is-open {
  border-color: var(--diraya-orange);
  background: rgba(245, 158, 11, 0.14);
  color: var(--diraya-orange-strong);
}

.pos-fkey {
  position: absolute;
  top: 0.25rem;
  inset-inline-end: 0.3rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 0.4rem;
  background: #111827;
  border: 1px solid rgba(17, 24, 39, 0.9);
  color: #f9fafb;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  pointer-events: none;
}

.pos-fkey--on-primary {
  background: rgba(17, 24, 39, 0.9);
  border-color: rgba(17, 24, 39, 0.98);
  color: #fff;
}

.pos-hold-btn,
.pos-checkout-btn {
  position: relative;
}

.pos-hold-btn .pos-fkey,
.pos-checkout-btn .pos-fkey {
  top: 0.35rem;
  inset-inline-end: 0.45rem;
}

.pos-cart-touch-btn .pos-fkey {
  top: 0.2rem;
  inset-inline-end: 0.25rem;
}

.pos-cart-quick-btn .pos-fkey {
  top: 0.2rem;
  inset-inline-end: 0.25rem;
}

.pos-cart-quick-badge {
  position: absolute;
  top: 0.2rem;
  inset-inline-start: 0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--diraya-orange);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1.1rem;
  text-align: center;
}

.pos-cart-quick-badge.hidden {
  display: none;
}

.pos-hold-btn {
  position: relative;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.75rem;
  background: var(--pos-surface);
  color: var(--pos-text);
  font-weight: 700;
  cursor: pointer;
}

.pos-hold-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pos-hold-btn:not(:disabled):hover {
  border-color: var(--diraya-orange);
  color: var(--diraya-orange-strong);
}

@media (max-width: 640px) {
  .tables-board-stats {
    grid-template-columns: 1fr;
  }

  .tables-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Employee hub */
.pos-content-employee-hub {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0.85rem 1rem 1rem;
}

.employee-hub {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.75rem;
}

.employee-hub-head h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--pos-text);
}

.employee-hub-head p {
  margin: 0.2rem 0 0;
  color: var(--pos-muted);
  font-size: 0.88rem;
}

.employee-hub-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.employee-hub-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.75rem;
  background: var(--pos-surface);
  color: var(--pos-muted);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.employee-hub-tab.active {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.1);
  color: var(--diraya-orange-strong);
}

.employee-hub-tab-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--diraya-orange);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.25rem;
}

.employee-hub-tab-badge.hidden {
  display: none !important;
}

.employee-hub-panel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.employee-hub-panel.active {
  display: flex;
}

.employee-hub-panel.hidden {
  display: none !important;
}

.employee-hub-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.employee-hub-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--pos-text);
}

.employee-hub-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.employee-hub-loading,
.employee-hub-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  color: var(--pos-muted);
  text-align: center;
}

.employee-hub-empty.is-error {
  color: #dc2626;
}

.employee-hub-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.85rem;
  background: var(--pos-surface);
}

.employee-hub-card-main {
  min-width: 0;
  flex: 1;
}

.employee-hub-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.employee-hub-card-title strong {
  font-size: 0.95rem;
  color: var(--pos-text);
}

.employee-hub-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.employee-hub-pill.is-held {
  background: rgba(245, 158, 11, 0.14);
  color: var(--diraya-orange-strong);
}

.employee-hub-pill.is-checked {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.employee-hub-pill.is-undeliverable {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}

.employee-hub-pill.is-delivered {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.employee-hub-card-meta,
.employee-hub-card-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--pos-muted);
}

.employee-hub-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.45rem;
  flex-shrink: 0;
}

.employee-hub-card-total {
  font-size: 1rem;
  font-weight: 800;
  color: var(--pos-text);
}

.employee-hub-resume-btn {
  white-space: nowrap;
}

turbo-frame.employee-hub-pos-frame {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--pos-border);
  border-radius: 0.85rem;
  overflow: hidden;
  background: var(--pos-surface);
}

turbo-frame.employee-hub-pos-frame #appContentMain,
turbo-frame.employee-hub-pos-frame main.pos-content-terminal {
  flex: 1;
  min-height: 0;
  height: 100%;
}

@media (max-width: 768px) {
  .employee-hub-tabs {
    grid-template-columns: 1fr;
  }

  .employee-hub-card {
    flex-direction: column;
  }

  .employee-hub-card-side {
    align-items: flex-start;
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
  }
}

/* Employee workstation — full-height left action rail + content pane */
.pos-shell-workstation {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.pos-shell-workstation .pos-main {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pos-shell-workstation .pos-topbar {
  flex-shrink: 0;
}

.pos-shell-workstation turbo-frame#app-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-shell-workstation #appContentMain.pos-content-employee-hub {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  padding: 0;
}

.pos-shell-workstation #appContentMain.pos-content {
  overflow: hidden;
}

.pos-shell-workstation .employee-workstation {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: var(--pos-bg);
}

/* On POS terminal, keep workstation canvas clear so shell waves span sidebar + products */
.pos-shell-workstation.pos-shell-terminal .employee-workstation,
body.workstation-panel-pos .pos-shell-workstation.pos-shell-terminal .employee-workstation-main {
  background: transparent;
}

.employee-action-toolbar {
  display: none !important;
}

@media (max-width: 991px) {
  .pos-main:has(.page-action-toolbar) .pos-topbar > #sidebarToggle,
  .pos-main:has(.employee-action-toolbar) .pos-topbar > #sidebarToggle,
  body.workstation-mode .pos-topbar > #sidebarToggle,
  .pos-shell-terminal .pos-topbar > #sidebarToggle {
    display: inline-flex !important;
  }
}

.employee-action-toolbar-scroll {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.55rem 0.75rem;
  scroll-padding-inline: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.45) transparent;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
}

.employee-action-toolbar-group[data-toolbar-group="workspace"] {
  order: 0;
}

body.workstation-panel-pos .employee-action-toolbar-group[data-rail-section="pos"] {
  order: 1;
}

body.workstation-panel-pos .employee-action-toolbar-group[data-rail-section="tables"] {
  order: 2;
}

body.workstation-panel-tables .employee-action-toolbar-group[data-rail-section="tables"] {
  order: 1;
}

body.workstation-panel-tables .employee-action-toolbar-group[data-rail-section="pos"] {
  order: 2;
}

.employee-workstation-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--pos-surface);
}

.employee-action-toolbar-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 0.75rem 0 0;
  border: none;
  border-inline-end: 1px dashed var(--pos-border);
  transition: opacity 0.15s ease;
}

.employee-action-toolbar-group:last-child {
  margin: 0;
  padding-inline-end: 0;
  border-inline-end: none;
}

.employee-action-toolbar-group.is-muted {
  opacity: 0.45;
}

.employee-action-group-label {
  display: none;
}

.employee-action-tabs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}

.employee-action-tab {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: auto;
  min-width: 5.75rem !important;
  min-height: 4.75rem !important;
  height: 4.75rem !important;
  padding: 0.5rem 0.8rem !important;
  border-radius: 0.85rem !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.employee-action-tab i {
  font-size: 1.55rem !important;
  line-height: 1;
}

.employee-action-tab.active {
  background: var(--diraya-orange) !important;
  border-color: var(--diraya-orange-strong) !important;
  color: #111827 !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.28);
}

.employee-action-tab.active i {
  color: inherit;
}

.employee-action-toolbar-btns {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.employee-action-btn {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: auto;
  min-width: 5.75rem !important;
  min-height: 4.75rem !important;
  height: 4.75rem !important;
  padding: 0.5rem 0.8rem !important;
  border-radius: 0.85rem !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  word-break: normal;
}

.employee-action-btn i {
  font-size: 1.55rem !important;
  line-height: 1;
  flex-shrink: 0;
}

.employee-action-btn--wide {
  justify-content: center;
  min-width: 6.25rem !important;
  min-height: 4.75rem !important;
  height: 4.75rem !important;
  font-size: 0.86rem !important;
}

.employee-action-btn.page-btn-primary {
  background: var(--diraya-orange) !important;
  border-color: var(--diraya-orange-strong) !important;
  color: #111827 !important;
}

.employee-action-btn.page-btn-primary i {
  color: #111827;
}

.employee-action-btn.page-btn-secondary {
  background: var(--diraya-charcoal) !important;
  border-color: var(--diraya-charcoal) !important;
  color: #fff !important;
}

.employee-action-btn.page-btn-danger {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #fff !important;
}

.employee-action-btn.page-btn-info {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
}

.employee-action-btn.page-btn-print {
  background: #4f46e5 !important;
  border-color: #4338ca !important;
  color: #fff !important;
}

.employee-action-btn.page-btn-success {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #fff !important;
}

.employee-action-btn.page-btn-secondary i,
.employee-action-btn.page-btn-danger i,
.employee-action-btn.page-btn-info i,
.employee-action-btn.page-btn-print i,
.employee-action-btn.page-btn-success i {
  color: inherit;
}

.employee-action-btn.page-btn-ghost {
  color: var(--pos-text) !important;
  background: var(--pos-surface-2) !important;
  border-color: var(--pos-border) !important;
}

.employee-action-btn.page-btn-ghost.is-open,
.employee-action-btn.page-btn-ghost.is-active {
  border-color: var(--diraya-orange) !important;
  background: rgba(245, 158, 11, 0.12) !important;
  color: var(--diraya-orange-strong) !important;
}

.employee-action-badge {
  margin-inline-start: 0.15rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--diraya-orange);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.15rem;
  text-align: center;
  flex-shrink: 0;
}

.employee-action-shortcut {
  position: relative !important;
  padding-top: 0.85rem !important;
}

.employee-action-fkey {
  position: absolute;
  top: 0.25rem;
  inset-inline-end: 0.3rem;
  min-width: 1.4rem;
  padding: 0.05rem 0.28rem;
  border-radius: 0.3rem;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  color: var(--pos-muted);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.employee-action-badge.hidden {
  display: none;
}

.employee-action-btn.page-btn-ghost:hover {
  color: var(--diraya-orange-strong) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  background: var(--diraya-orange-muted) !important;
}

.employee-action-btn.page-btn-ghost i {
  color: var(--diraya-orange-strong);
}

.employee-action-btn:active {
  transform: scale(0.97);
}

.employee-workstation-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid var(--pos-border);
  background: var(--pos-surface);
  flex-shrink: 0;
}

.employee-workstation-main-head h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pos-text);
}

.employee-workstation-main-head p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--pos-muted);
}

.employee-workstation-panel-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.employee-workstation-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 1rem 1rem;
}

.employee-workstation-panel.active {
  display: flex;
  flex-direction: column;
}

.employee-workstation-panel[data-panel="tables"] .tables-board {
  gap: 0.85rem;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.employee-workstation-panel[data-panel="pos"] {
  padding: 0;
  overflow: hidden;
}

.employee-workstation-panel[data-panel="pos"] .pos-terminal {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.employee-workstation-pos-iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: none;
  background: var(--pos-bg);
}

.pos-terminal-embedded {
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pos-embed-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--pos-border);
  background: var(--pos-surface);
  flex-shrink: 0;
}

.pos-embed-toolbar .pos-terminal-search-wrap {
  flex: 1;
  min-width: 0;
}

.pos-terminal-embedded .pos-terminal-body {
  flex: 1;
  min-height: 0;
}

body.workstation-mode .pos-topbar-title {
  display: block;
  min-width: 0;
}

body.workstation-mode .pos-topbar-title.is-pos-hidden {
  display: none;
}

body.workstation-panel-pos .pos-shell-workstation .pos-main {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body.workstation-panel-pos .pos-shell-workstation.pos-shell-terminal .pos-main {
  padding-inline-end: 420px;
}

body.workstation-panel-pos .pos-shell-workstation.pos-shell-terminal .pos-topbar {
  margin-inline-end: var(--pos-sidebar-gap);
}

body.workstation-mode .employee-workstation-main-head {
  display: none;
}

body.workstation-mode .employee-workstation-main {
  padding: 0.65rem 0.75rem 0.85rem 0.65rem;
}

body.workstation-panel-pos .employee-workstation-main {
  padding: 0;
}

@media (max-width: 640px) {
  .pos-shell-workstation .employee-workstation {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .employee-workstation-main {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    max-height: none;
  }
}

/* Touch / POS screens: keep large finger-friendly action tiles */
html.touch-screen-mode .employee-action-toolbar {
  min-height: 6rem;
}

html.touch-screen-mode .employee-action-tab,
html.touch-screen-mode .employee-action-btn {
  min-width: 6rem !important;
  min-height: 5rem !important;
  height: 5rem !important;
  font-size: 0.9rem !important;
}

html.touch-screen-mode .employee-action-tab i,
html.touch-screen-mode .employee-action-btn i {
  font-size: 1.65rem !important;
}

@media (pointer: coarse) {
  .employee-action-toolbar {
    min-height: 6rem;
  }

  .employee-action-tab,
  .employee-action-btn {
    min-width: 6rem !important;
    min-height: 5rem !important;
    height: 5rem !important;
    font-size: 0.9rem !important;
  }

  .employee-action-tab i,
  .employee-action-btn i {
    font-size: 1.65rem !important;
  }
}

body.workstation-panel-pos #posTopbarSearch {
  display: flex !important;
}

body.workstation-panel-tables #posTopbarSearch {
  display: none !important;
}

/* Embedded POS inside workstation iframe — match standalone terminal layout */
body.embed-shell {
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--pos-bg);
  color: var(--pos-text);
  font-family: var(--pos-font);
}

body.embed-shell .pos-terminal-embedded {
  height: 100%;
  min-height: 0;
}

body.embed-shell .pos-terminal-embedded .pos-terminal-tabs {
  display: none;
}

@media (min-width: 992px) {
  body.embed-shell .pos-terminal-embedded .pos-terminal-body {
    grid-template-columns: 1fr;
  }

  body.embed-shell .pos-terminal-embedded .pos-terminal-cart {
    position: fixed;
    top: 0;
    inset-inline-end: 0;
    width: 420px;
    height: 100%;
    height: 100dvh;
    z-index: 28;
  }

  body.embed-shell .pos-terminal-embedded .pos-terminal-products {
    padding-inline-end: 420px;
  }
}

@media (max-width: 991px) {
  body.embed-shell .pos-terminal-embedded .pos-terminal-tabs {
    display: grid;
  }
}

/* POS refund / return mode */
.pos-refund-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0.75rem 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.12), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(217, 119, 6, 0.25);
  color: #92400e;
}

.pos-refund-banner i {
  font-size: 1rem;
  opacity: 0.85;
}

.pos-refund-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.78rem;
}

.pos-refund-banner-text strong {
  font-size: 0.82rem;
  color: #78350f;
}

.pos-refund-exit {
  border: none;
  background: rgba(255, 255, 255, 0.65);
  color: #92400e;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  cursor: pointer;
}

.pos-refund-summary .pos-refund-removed {
  color: #b45309;
}

.pos-refund-summary .pos-refund-added {
  color: #047857;
}

.pos-refund-summary #posRefundNet.is-refund {
  color: #b45309;
}

.pos-refund-summary #posRefundNet.is-collect {
  color: #047857;
}

.pos-refund-settlement-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--pos-muted, #64748b);
  line-height: 1.35;
}

.pos-cart-line.is-last-line {
  background: transparent;
}

.pos-cart-line.is-last-line .pos-cart-line-info strong {
  color: var(--pos-text);
}

.pos-cart-line.is-invoice-line.has-return-qty {
  background: transparent;
  box-shadow: inset 3px 0 0 rgba(180, 83, 9, 0.55);
}

.pos-cart-line.is-invoice-line.has-add-qty {
  background: transparent;
  box-shadow: inset 3px 0 0 rgba(4, 120, 87, 0.55);
}

.pos-cart-line.is-addition-line {
  background: transparent;
  box-shadow: inset 3px 0 0 rgba(4, 120, 87, 0.55);
}

.pos-return-badge,
.pos-add-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.35rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.pos-return-badge {
  background: rgba(180, 83, 9, 0.15);
  color: #b45309;
}

.pos-add-badge {
  background: rgba(4, 120, 87, 0.15);
  color: #047857;
}

.pos-refund-checkout-grid {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.pos-refund-checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.pos-refund-checkout-net {
  padding-top: 0.45rem;
  border-top: 1px dashed var(--pos-border, #e2e8f0);
  font-weight: 600;
}

.pos-refund-settlement-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.65rem;
  border: 1px solid var(--pos-border, #e2e8f0);
  background: var(--pos-surface, #fff);
}

.pos-refund-settlement-card.is-refund {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(180, 83, 9, 0.06);
}

.pos-refund-settlement-card.is-collect {
  border-color: rgba(4, 120, 87, 0.35);
  background: rgba(4, 120, 87, 0.06);
}

.pos-refund-settlement-card.is-even {
  border-color: rgba(100, 116, 139, 0.35);
  background: rgba(148, 163, 184, 0.08);
}

.pos-refund-settlement-card span {
  display: block;
  font-size: 0.78rem;
  color: var(--pos-muted, #64748b);
}

.pos-refund-settlement-card strong {
  font-size: 1.15rem;
}

.pos-refund-checkout-note {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--pos-muted, #64748b);
  line-height: 1.4;
}

body.pos-refund-mode .pos-hold-btn {
  opacity: 0.45;
  pointer-events: none;
}

.pos-refund-picker-sheet {
  max-width: min(28rem, 96vw);
}

.pos-refund-picker-hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--pos-muted);
  line-height: 1.45;
}

.pos-refund-picker-search-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.pos-refund-picker-search-row .pos-field-input {
  flex: 1;
  min-width: 0;
}

.pos-refund-picker-search-row .pos-checkout-primary {
  flex-shrink: 0;
  white-space: nowrap;
}

.pos-refund-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(42vh, 18rem);
  overflow-y: auto;
  margin-top: 0.75rem;
}

.pos-refund-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--pos-border);
  border-radius: 0.65rem;
  background: var(--pos-surface-2);
  color: var(--pos-text);
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pos-refund-picker-item:hover {
  border-color: var(--diraya-orange);
  background: var(--diraya-orange-muted);
}

.pos-refund-picker-item-main,
.pos-refund-picker-item-side {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.pos-refund-picker-item-side {
  align-items: flex-end;
  flex-shrink: 0;
}

.pos-refund-picker-item-main strong,
.pos-refund-picker-item-side strong {
  font-size: 0.88rem;
}

.pos-refund-picker-item-main span,
.pos-refund-picker-item-side small {
  font-size: 0.75rem;
  color: var(--pos-muted);
}

.pos-refund-picker-empty {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--pos-muted);
  text-align: center;
}

.pos-notification-center {
  position: relative;
}

.pos-notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--pos-topbar-control-size);
  height: var(--pos-topbar-control-size);
  border: 1px solid var(--pos-sidebar-border);
  border-radius: 0.85rem;
  background: rgba(243, 244, 246, 0.9);
  color: var(--pos-sidebar-text);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pos-notification-bell:hover,
.pos-notification-bell[aria-expanded="true"] {
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--diraya-orange-muted);
  color: var(--diraya-orange-strong);
}

.pos-notification-badge {
  position: absolute;
  top: -0.2rem;
  inset-inline-end: -0.2rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--diraya-orange);
  color: #111827;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.05rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--pos-sidebar-bg);
}

.pos-notification-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(22rem, calc(100vw - 2rem));
  max-height: 24rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pos-border);
  border-radius: 0.85rem;
  background: var(--pos-surface);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  z-index: 120;
}

.pos-notification-panel.hidden {
  display: none;
}

.pos-notification-panel-head {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--pos-border);
}

.pos-notification-list {
  overflow-y: auto;
  max-height: 18rem;
}

.pos-notification-empty {
  padding: 1rem 0.9rem;
  color: var(--pos-muted);
  font-size: 0.88rem;
}

.pos-notification-item {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--pos-border);
}

.pos-notification-item:last-child {
  border-bottom: 0;
}

.pos-notification-item-title {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.pos-notification-item-message {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  color: var(--pos-muted);
}

.pos-notification-item-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.pos-notification-item-link,
.pos-notification-item-resolve {
  font-size: 0.76rem;
}

.pos-notification-item-link {
  color: var(--diraya-orange);
  text-decoration: none;
  font-weight: 600;
}

.pos-notification-item-mark-read {
  margin-left: auto;
  min-height: 1.85rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
}

.pos-notification-item.is-removing {
  opacity: 0;
  transform: translateX(0.35rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pos-notification-item-resolve {
  border: 0;
  background: transparent;
  color: var(--pos-muted);
  cursor: pointer;
  padding: 0;
}

.pos-notification-item.severity-danger .pos-notification-item-title {
  color: #dc2626;
}

.pos-notification-item.severity-warning .pos-notification-item-title {
  color: #d97706;
}

/* ===== Create / Edit Invoice modal ===== */
.simple-invoice-shell {
  display: flex;
}

.simple-invoice-shell.hidden {
  display: none !important;
}

.simple-invoice-backdrop {
  position: absolute;
  inset: 0;
  background: var(--pos-overlay, rgba(0, 0, 0, 0.28));
}

.simple-invoice-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(72rem, 96vw) !important;
  max-width: min(72rem, 96vw) !important;
  max-height: 92vh;
  overflow: hidden;
  margin: 0 !important;
  padding: 0;
  border-radius: 1rem;
  box-shadow: var(--pos-shadow);
  background: var(--pos-surface, #fff);
}

.simple-invoice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--pos-border, #e5e7eb);
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 42%),
    var(--pos-surface, #fff);
  position: relative;
  flex-shrink: 0;
  z-index: 5;
}

.simple-invoice-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--pos-text, #111827);
}

.simple-invoice-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--pos-muted, #6b7280);
}

.simple-invoice-close {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 0.65rem;
  background: var(--pos-surface, #fff);
  color: var(--pos-muted, #6b7280);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.simple-invoice-close:hover {
  color: var(--pos-text, #111827);
  border-color: #d1d5db;
}

.simple-invoice-form {
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.35rem 1.35rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.simple-invoice-panel {
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 0.9rem;
  background: var(--pos-surface-2, #f3f4f6);
  padding: 1rem;
}

.simple-invoice-panel-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.simple-invoice-panel-head i {
  color: var(--diraya-orange-strong, #d97706);
}

.simple-invoice-panel-head h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--pos-text, #111827);
}

.simple-invoice-grid {
  display: grid;
  gap: 0.85rem;
}

.simple-invoice-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.simple-invoice-add-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1.6fr) 7rem 7.5rem 7.5rem;
  gap: 0.75rem;
  align-items: end;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  background: var(--pos-surface, #fff);
}

.simple-invoice-add-action label {
  display: block;
  min-height: 1.25rem;
}

.simple-invoice-table-wrap {
  max-height: min(16rem, 34vh);
  overflow: auto;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 0.75rem;
  background: var(--pos-surface, #fff);
  -webkit-overflow-scrolling: touch;
}

.simple-invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.simple-invoice-table th,
.simple-invoice-table td {
  padding: 0.7rem 0.85rem;
  text-align: start;
  border-bottom: 1px solid var(--pos-border, #e5e7eb);
  font-size: 0.9rem;
}

.simple-invoice-shell table thead,
.simple-invoice-dialog table thead,
.simple-invoice-table thead {
  position: sticky !important;
  top: 0 !important;
  z-index: 1 !important;
}

.simple-invoice-table thead th {
  background: rgba(245, 158, 11, 0.08) !important;
  color: var(--pos-text, #111827) !important;
  font-weight: 650;
}

.simple-invoice-table tbody tr:last-child td {
  border-bottom: 0;
}

.simple-invoice-empty-row td {
  text-align: center;
  color: var(--pos-muted, #6b7280);
  padding: 1.75rem 0.85rem;
}

.simple-invoice-summary-panel {
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.06), transparent 38%),
    var(--pos-surface-2, #f3f4f6);
}

.simple-invoice-summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(14rem, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.simple-invoice-summary-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.simple-invoice-options {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  background: var(--pos-surface, #fff);
  min-height: 100%;
}

.simple-invoice-options-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--pos-text, #111827);
}

.simple-invoice-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.6rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  background: var(--pos-surface-2, #f9fafb);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--pos-text, #111827);
}

.simple-invoice-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--diraya-orange-strong, #d97706);
}

.simple-invoice-total-field {
  grid-column: span 1;
}

.simple-invoice-total-input {
  font-weight: 700;
  font-size: 1.05rem;
  border-color: rgba(217, 119, 6, 0.45) !important;
  background: rgba(245, 158, 11, 0.08) !important;
  color: var(--pos-text, #111827);
}

.simple-invoice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--pos-border, #e5e7eb);
  margin-top: 0.15rem;
  padding-top: 1rem;
}

@media (max-width: 1100px) {
  .simple-invoice-summary-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simple-invoice-add-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simple-invoice-add-item,
  .simple-invoice-add-action {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .simple-invoice-grid-3,
  .simple-invoice-summary-layout {
    grid-template-columns: 1fr;
  }

  .simple-invoice-add-row {
    grid-template-columns: 1fr;
  }

  .simple-invoice-add-item,
  .simple-invoice-add-action {
    grid-column: auto;
  }
}

/* ===== Product create/edit modal ===== */
.product-modal-shell {
  display: flex;
}

.product-modal-shell.hidden {
  display: none !important;
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--pos-overlay, rgba(0, 0, 0, 0.28));
}

.product-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(52rem, 94vw) !important;
  max-width: min(52rem, 94vw) !important;
  max-height: 90vh;
  overflow: auto;
  margin: 0 !important;
  padding: 0;
  border-radius: 0.9rem;
  background: var(--pos-surface, #fff);
  box-shadow: var(--pos-shadow);
}

.product-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--pos-border, #e5e7eb);
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--pos-surface, #fff);
}

.product-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pos-text, #111827);
}

.product-modal-close {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 0.55rem;
  background: var(--pos-surface, #fff);
  color: var(--pos-muted, #6b7280);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-modal-form {
  padding: 0.85rem 1rem 1rem;
}

.product-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem 0.75rem;
}

.product-modal-image-field {
  grid-column: 1 / -1;
}

.product-modal-image-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.product-modal-image-preview {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 0.65rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  overflow: hidden;
  background: color-mix(in srgb, var(--pos-border, #e5e7eb) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-modal-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-modal-image-placeholder {
  color: var(--pos-muted, #9ca3af);
  font-size: 1.35rem;
}

.product-modal-image-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: min(100%, 16rem);
  flex: 1;
}

.product-modal-remove-image {
  align-self: flex-start;
}

.product-modal-grid .page-field {
  margin: 0;
}

.product-modal-grid .page-field label {
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}

.product-modal-grid .page-input {
  min-height: 2.15rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.875rem;
}

.product-modal-form .searchable-select-trigger {
  min-height: 2.15rem;
  height: 2.15rem;
  padding: 0.35rem 2rem 0.35rem 0.55rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
}

.product-modal-barcode-row,
.product-modal-category-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.product-modal-barcode-row .page-input,
.product-modal-category-control .page-input {
  flex: 1;
  min-width: 0;
}

.product-modal-icon-btn {
  width: 2.15rem;
  height: 2.15rem;
  flex-shrink: 0;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 0.5rem;
  background: var(--pos-surface-2, #f3f4f6);
  color: var(--diraya-orange-strong, #d97706);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-modal-icon-btn:hover {
  background: rgba(245, 158, 11, 0.12);
}

.product-modal-category-dropdown {
  position: absolute;
  left: 0;
  right: 2.5rem;
  top: calc(100% + 0.2rem);
  z-index: 30;
  max-height: 12rem;
  overflow: auto;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 0.55rem;
  background: var(--pos-surface, #fff);
  box-shadow: var(--pos-shadow);
}

.product-modal-category-dropdown.hidden {
  display: none !important;
}

.product-modal-check {
  display: flex;
  align-items: end;
}

.product-modal-check-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.15rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 0.5rem;
  background: var(--pos-surface-2, #f9fafb);
  font-size: 0.84rem;
  font-weight: 550;
  cursor: pointer;
  width: 100%;
}

.product-modal-check-label input {
  accent-color: var(--diraya-orange-strong, #d97706);
}

.product-modal-hint {
  display: flex;
  align-items: end;
}

.product-modal-tax-hint {
  display: block;
  width: 100%;
  min-height: 2.15rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.5rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--pos-muted, #6b7280);
  font-size: 0.8rem;
  line-height: 1.3;
}

.product-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pos-border, #e5e7eb);
}

@media (max-width: 860px) {
  .product-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .product-modal-grid {
    grid-template-columns: 1fr;
  }
}

.product-modal-hint-wide {
  grid-column: 1 / -1;
}

.package-list-card {
  margin-top: 1rem;
}

.package-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.35rem;
}

.package-list-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.package-list-head p {
  margin: 0.2rem 0 0;
  color: var(--pos-muted, #6b7280);
  font-size: 0.84rem;
}

.package-row-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.inventory-view-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.inventory-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.15rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 999px;
  background: var(--pos-surface, #fff);
  color: var(--pos-muted, #6b7280);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.inventory-view-tab:hover {
  color: var(--pos-text, #111827);
  border-color: #d1d5db;
}

.inventory-view-tab.active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--diraya-orange-strong, #d97706);
}

.inventory-view-panel.hidden,
.inventory-view-toolbar.hidden {
  display: none !important;
}

#packagesTable tr.is-selected {
  background: rgba(245, 158, 11, 0.08);
}

.package-status-active {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.package-status-inactive {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

.package-modal-dialog {
  max-width: 42rem;
}

.package-items-block {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pos-border, #e5e7eb);
}

.package-items-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}

.package-items-hint {
  margin: 0.2rem 0 0.65rem;
  color: var(--pos-muted, #6b7280);
  font-size: 0.8rem;
}

.package-product-picker {
  position: relative;
  margin-bottom: 0.65rem;
}

.package-product-dropdown {
  max-height: 14rem;
}

.package-product-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  text-align: start;
  padding: 0.55rem 0.7rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.package-product-option:hover {
  background: rgba(245, 158, 11, 0.08);
}

.package-product-option span {
  color: var(--pos-muted, #6b7280);
  font-size: 0.78rem;
}

.package-items-table {
  width: 100%;
}

.package-items-table th,
.package-items-table td {
  padding: 0.45rem 0.35rem;
  vertical-align: middle;
}

.package-item-qty {
  max-width: 5rem;
}

.package-pricing-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pos-border, #e5e7eb);
}

@media (max-width: 560px) {
  .package-pricing-block {
    grid-template-columns: 1fr;
  }
}

.package-savings-hint {
  margin-top: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #047857;
  font-size: 0.84rem;
  font-weight: 550;
}

.package-below-cost-hint {
  margin-top: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #b45309;
  font-size: 0.84rem;
  font-weight: 550;
}

.package-item-flag {
  margin-top: 0.2rem;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 650;
  color: #b45309;
}

.package-item-below-cost td:first-child,
.package-row-below-cost td:nth-child(2) {
  box-shadow: inset 3px 0 0 #f59e0b;
}

.package-items-table .package-item-price {
  min-width: 5.5rem;
}

/* ===== Payments page navigation + modal ===== */
.payment-type-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.payment-type-tab {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 999px;
  background: var(--pos-surface, #fff);
  color: var(--pos-muted, #6b7280);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.payment-type-tab:hover {
  color: var(--pos-text, #111827);
  border-color: #d1d5db;
}

.payment-type-tab.active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--diraya-orange-strong, #d97706);
}

.payment-modal-dialog {
  width: min(40rem, 94vw) !important;
  max-width: min(40rem, 94vw) !important;
  margin: 0 auto !important;
  padding: 0;
  overflow: hidden;
}

.payment-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--pos-border, #e5e7eb);
}

.payment-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pos-text, #111827);
}

.payment-modal-form {
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
}

.payment-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.payment-modal-grid .page-field {
  margin: 0;
}

.payment-modal-field-wide {
  grid-column: 1 / -1;
}

.payment-modal-hint {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
  color: var(--pos-muted, #6b7280);
  min-height: 1rem;
}

.payment-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--pos-border, #e5e7eb);
}

@media (max-width: 640px) {
  .payment-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Product print / barcode preview modal ===== */
.product-print-modal-shell {
  display: flex;
}

.product-print-modal-shell.hidden {
  display: none !important;
}

.product-print-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--pos-overlay, rgba(0, 0, 0, 0.28));
}

.product-print-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(52rem, 94vw) !important;
  max-width: min(52rem, 94vw) !important;
  max-height: 90vh;
  margin: 0 !important;
  padding: 0;
  border-radius: 0.9rem;
  background: var(--pos-surface, #fff);
  box-shadow: var(--pos-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-print-modal-shell[data-mode="barcode"] .product-print-modal-dialog {
  width: min(28rem, 94vw) !important;
  max-width: min(28rem, 94vw) !important;
}

.product-print-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--pos-border, #e5e7eb);
  background: var(--pos-surface, #fff);
  flex-shrink: 0;
}

.product-print-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pos-text, #111827);
}

.product-print-modal-hint {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--pos-muted, #6b7280);
}

.product-print-modal-close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--pos-muted, #6b7280);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-print-modal-close:hover {
  background: var(--pos-surface-2, #f3f4f6);
  color: var(--pos-text, #111827);
}

.product-print-modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--pos-border, #e5e7eb);
  background: var(--pos-surface, #fff);
  flex-shrink: 0;
}

.product-print-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  background: var(--pos-bg, #f9fafb);
}

.product-print-sheet {
  background: #fff;
  border: 1px solid var(--pos-border, #e5e7eb);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 1.25rem;
  color: #111827;
}

.product-print-sheet h1 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.product-print-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.product-print-sheet th,
.product-print-sheet td {
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.55rem;
  text-align: start;
  vertical-align: top;
}

.product-print-sheet th {
  background: #f3f4f6;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #4b5563;
}

.product-print-barcode-label {
  text-align: center;
  padding: 1rem 0.5rem;
}

.product-print-barcode-label .product-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #111827;
}

.product-print-barcode-label .barcode {
  margin: 0.5rem 0;
}

.product-print-barcode-label .barcode svg {
  max-width: 100%;
  height: auto;
}

.product-print-barcode-label .price {
  font-size: 0.9rem;
  color: #4b5563;
  margin-top: 0.5rem;
}

.product-print-barcode-label .shop-name {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.35rem;
}

@media print {
  body * {
    visibility: hidden !important;
  }

  #productPrintModal,
  #expensePrintModal,
  #paymentReceiptModal,
  #poPrintModal,
  #productPrintModal *,
  #expensePrintModal *,
  #paymentReceiptModal *,
  #poPrintModal * {
    visibility: visible !important;
  }

  #productPrintModal,
  #expensePrintModal,
  #paymentReceiptModal,
  #poPrintModal {
    position: static !important;
    inset: auto !important;
    display: block !important;
    background: #fff !important;
    padding: 0 !important;
    z-index: auto !important;
  }

  #productPrintModal .product-print-modal-backdrop,
  #expensePrintModal .product-print-modal-backdrop,
  #paymentReceiptModal .product-print-modal-backdrop,
  #poPrintModal .product-print-modal-backdrop {
    display: none !important;
  }

  #productPrintModal .product-print-modal-dialog,
  #expensePrintModal .product-print-modal-dialog,
  #paymentReceiptModal .product-print-modal-dialog,
  #poPrintModal .product-print-modal-dialog {
    box-shadow: none !important;
    max-height: none !important;
    max-width: none !important;
    width: 100% !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  #productPrintModal .print\:hidden,
  #expensePrintModal .print\:hidden,
  #paymentReceiptModal .print\:hidden,
  #poPrintModal .print\:hidden {
    display: none !important;
  }

  #productPrintModal .product-print-modal-body,
  #expensePrintModal .product-print-modal-body,
  #paymentReceiptModal .product-print-modal-body,
  #poPrintModal .product-print-modal-body {
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  #productPrintSheet,
  #expensePrintSheet,
  #paymentReceiptSheet,
  #poPrintSheet {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }

  #expensePrintModal .expense-print-modal-body {
    display: block !important;
    background: #fff !important;
    padding: 0 !important;
  }

  #expensePrintSheet .pos-receipt-sheet,
  #expensePrintSheet .expense-receipt-sheet {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }

  /* Barcode-only fallback: print just the label, no empty full page */
  body.printing-product-barcode {
    background: #fff !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.printing-product-barcode * {
    visibility: hidden !important;
  }

  body.printing-product-barcode #productPrintSheet,
  body.printing-product-barcode #productPrintSheet * {
    visibility: visible !important;
  }

  body.printing-product-barcode #productPrintModal,
  body.printing-product-barcode #productPrintModal .product-print-modal-dialog,
  body.printing-product-barcode #productPrintModal .product-print-modal-body {
    position: static !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.printing-product-barcode #productPrintModal .product-print-modal-backdrop,
  body.printing-product-barcode #productPrintModal .print\:hidden {
    display: none !important;
  }

  body.printing-product-barcode #productPrintSheet {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: auto !important;
    max-width: 90mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.printing-product-barcode .product-print-barcode-label {
    padding: 2mm 3mm !important;
  }
}

/* Expense print — 80mm thermal receipt style */
.expense-print-modal-body {
  display: flex;
  justify-content: center;
  background: #f3f4f6;
  padding: 1rem !important;
}

.expense-print-sheet {
  width: 100%;
  display: flex;
  justify-content: center;
}

.expense-print-sheet .pos-receipt-sheet,
.expense-print-sheet .expense-receipt-sheet {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  border-radius: 0.35rem;
}

.expense-receipt-item {
  margin-bottom: 0.15rem;
}

.expense-receipt-item-title {
  font-weight: 700;
  margin-bottom: 0.15rem;
  overflow-wrap: anywhere;
}

.expense-receipt-item-title span {
  font-weight: 600;
  color: #555;
  font-size: 0.92em;
}

.expense-receipt-total {
  font-size: 1.05em;
}

.expense-receipt-total strong {
  font-size: 1.12em;
}

/* Payment receipt preview (wide modal) */
.payment-receipt-modal-dialog {
  width: min(72rem, 96vw) !important;
  max-width: min(72rem, 96vw) !important;
}

.payment-receipt-sheet-host {
  padding: 1.35rem 1.5rem;
}

.receipt-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.receipt-sheet-brand {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
}

.receipt-sheet-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.receipt-sheet-meta {
  text-align: end;
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.45;
}

.receipt-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
}

.receipt-sheet-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.15rem;
}

.receipt-sheet-value {
  font-weight: 600;
  color: #111827;
}

.receipt-sheet-value--paid {
  color: #047857;
}

.receipt-sheet-value-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(4, 120, 87, 0.85);
}

.receipt-sheet-muted {
  color: #9ca3af;
  font-weight: 400;
}

.receipt-sheet-remarks {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.receipt-sheet-section {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #374151;
}

.receipt-sheet-table-wrap {
  overflow-x: auto;
}

.receipt-sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.receipt-sheet-table th,
.receipt-sheet-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: start;
}

.receipt-sheet-table th {
  background: #f9fafb;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  font-weight: 600;
}

.receipt-sheet-table .num {
  text-align: end;
}

.receipt-sheet-table .muted {
  color: #6b7280;
}

.receipt-sheet-table .strong {
  font-weight: 600;
  color: #111827;
}

.receipt-sheet-table .empty {
  text-align: center;
  color: #6b7280;
  padding: 1.5rem 0.65rem;
}

.receipt-sheet-table .foot-label {
  font-weight: 600;
  color: #374151;
}

.receipt-sheet-table .foot-total {
  font-weight: 700;
  color: #111827;
}

.receipt-sheet-table .foot-paid {
  font-weight: 700;
  color: #047857;
}

.receipt-sheet-table .foot-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  margin-top: 0.15rem;
}

@media (max-width: 720px) {
  .receipt-sheet-grid {
    grid-template-columns: 1fr;
  }
}

