/* TouchPOS Base Styles & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--color-bg-app);
  color: var(--color-text-main);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Allow text selection in inputs and tables */
input, textarea, [contenteditable="true"], .selectable {
  user-select: text;
  -webkit-user-select: text;
}

/* Tabular Numbers for all currency and metrics */
.tabular-nums, .price, .total, .badge-qty, .stat-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Focus Rings for Accessibility (WCAG 2.1 AA) */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), transform 80ms ease, box-shadow var(--transition-fast);
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* Custom Scrollbars optimized for touch dragging & clean UI */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-surface);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-subtle);
}

/* Utility Icons Helper */
.icon {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 36px; height: 36px; }

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}
.badge-success { background: var(--color-primary-light); color: var(--color-primary); }
.badge-warning { background: var(--color-warning-light); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-light); color: var(--color-danger); }
.badge-info { background: var(--color-accent-light); color: var(--color-accent); }
