/* ── Reset & base tokens ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #6b6b6b;
  --color-accent: #57391d;
  --color-accent-hover: #452d16;
  --color-border: #e8e4de;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 6%);
  --shadow-md: 0 4px 16px rgb(0 0 0 / 8%);
  --transition: 150ms ease;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── Global mobile safeguards ─────────────────────────────────────── */
/* Prevent iOS Safari from auto-zooming when focusing small form fields. */
@media (max-width: 640px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* ── Boot screen (shared) ────────────────────────────────────────── */
.boot-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: 1rem;
  color: var(--color-muted);
}

.boot-screen__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.boot-error {
  max-width: 28rem;
  margin: 4rem auto;
  padding: 2rem;
  text-align: center;
}

.boot-error button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Offline connectivity banner (Admin + POS) */
.offline-banner {
  z-index: 40;
  padding: 0.45rem 0.85rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1208;
  background: linear-gradient(90deg, #e0b34d, #c9a84c);
  border-bottom: 1px solid rgb(0 0 0 / 20%);
}

.dashboard-app .offline-banner {
  position: sticky;
  top: 0;
}
