:root {
  --sp-ink: #171033;
  --sp-muted: #625f73;
  --sp-panel: rgba(255, 255, 255, 0.94);
  --sp-border: rgba(224, 0, 151, 0.16);
  --sp-pink: #ff2fa8;
  --sp-purple: #5f20b5;
  --sp-blue: #1736bd;
  --sp-yellow: #ffc414;
  --sp-green: #00b871;
  --sp-green-dark: #008f57;
  --sp-danger: #e54865;
  --sp-shadow: 0 18px 48px rgba(95, 32, 181, 0.12);
}

body .hidden {
  display: none !important;
}

html {
  background: #f7f7fb;
}

body {
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 47, 168, 0.12), transparent 26%),
    radial-gradient(circle at 90% 6%, rgba(255, 196, 20, 0.15), transparent 24%),
    linear-gradient(135deg, #fff 0%, #f8f7ff 45%, #fff7fb 100%);
  color: var(--sp-ink);
}

body.bg-mist,
body.bg-slate-100 {
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 47, 168, 0.12), transparent 26%),
    radial-gradient(circle at 90% 6%, rgba(255, 196, 20, 0.15), transparent 24%),
    linear-gradient(135deg, #fff 0%, #f8f7ff 45%, #fff7fb 100%) !important;
}

header.bg-white,
header .bg-white,
body > header {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(18px);
  border-color: rgba(224, 0, 151, 0.12) !important;
  box-shadow: 0 12px 36px rgba(95, 32, 181, 0.08);
}

.pos-header-clock {
  align-items: flex-end;
  border-right: 1px solid rgba(95, 32, 181, 0.16);
  color: var(--sp-muted);
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
  padding-right: 12px;
  white-space: nowrap;
}

.pos-header-clock span:first-child {
  color: var(--sp-ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.pos-header-clock span:last-child {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

a,
button,
input,
select,
textarea,
.pos-button,
.pos-button-primary,
.category-chip,
.admin-nav a,
.border,
.rounded-lg,
.rounded-xl,
.rounded-2xl {
  transition-duration: 0.18s;
  transition-property: background, background-color, background-position, border-color, box-shadow, color, transform;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.bg-ink,
.pos-button-primary,
.admin-page .bg-ink,
header .bg-ink {
  background: linear-gradient(135deg, var(--sp-pink), var(--sp-purple) 58%, var(--sp-blue)) !important;
  background-size: 180% 180%;
  color: #fff !important;
}

.pos-button-primary:hover,
.admin-page .bg-ink:hover,
header .bg-ink:hover {
  background-position: 100% 50%;
}

.pos-shell {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 251, 0.88)),
    radial-gradient(circle at 72% 8%, rgba(255, 196, 20, 0.18), transparent 28%),
    radial-gradient(circle at 12% 20%, rgba(255, 47, 168, 0.14), transparent 26%) !important;
}

.pos-shell .bg-white,
.admin-page .bg-white,
.admin-page section,
.admin-page table,
.max-w-md.bg-white {
  background: var(--sp-panel) !important;
  border-color: var(--sp-border) !important;
  box-shadow: var(--sp-shadow);
}

.pos-shell .bg-slate-50\/70 {
  background: rgba(255, 255, 255, 0.42) !important;
}

.pos-product-card {
  position: relative;
  transform-origin: center;
  will-change: transform;
}

.pos-product-card::after {
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.7) 42%, transparent 72%);
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-60%);
  transition: opacity 0.18s ease, transform 0.45s ease;
}

.pos-product-card:hover,
.pos-product-card:focus-visible {
  box-shadow: 0 18px 44px rgba(95, 32, 181, 0.18), 0 10px 24px rgba(255, 47, 168, 0.14) !important;
  transform: translateY(-4px) scale(1.035);
  z-index: 1;
}

.pos-product-card:hover::after,
.pos-product-card:focus-visible::after {
  opacity: 1;
  transform: translateX(62%);
}

.pos-input,
.form-control,
.form-select,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
  border-color: rgba(95, 32, 181, 0.18) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.pos-input:focus,
.form-control:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--sp-pink) !important;
  box-shadow: 0 0 0 3px rgba(255, 47, 168, 0.13), 0 0 0 6px rgba(255, 196, 20, 0.12) !important;
  outline: none;
}

.pos-button,
.btn,
.admin-nav a,
.max-w-md a {
  border-color: rgba(95, 32, 181, 0.2) !important;
}

.pos-button:hover,
.btn:hover,
.admin-nav a:hover,
.max-w-md a:hover {
  border-color: rgba(255, 47, 168, 0.36) !important;
  box-shadow: 0 12px 28px rgba(255, 47, 168, 0.12);
  transform: translateY(-1px);
}

.pos-button-primary,
.max-w-md a.bg-slate-900 {
  border-color: rgba(95, 32, 181, 0.2) !important;
  box-shadow: 0 14px 30px rgba(95, 32, 181, 0.18);
}

.pos-button-primary:hover,
.max-w-md a.bg-slate-900:hover {
  box-shadow: 0 18px 38px rgba(255, 47, 168, 0.24);
  transform: translateY(-1px);
}

.category-chip {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(95, 32, 181, 0.16) !important;
  color: var(--sp-ink) !important;
}

.category-chip:hover {
  background: rgba(255, 47, 168, 0.09) !important;
  border-color: rgba(255, 47, 168, 0.42) !important;
  color: var(--sp-purple) !important;
  transform: translateY(-1px);
}

.category-chip.is-selected,
.category-chip.is-selected:hover {
  background: linear-gradient(135deg, var(--sp-green), var(--sp-green-dark)) !important;
  border-color: var(--sp-green) !important;
  box-shadow: 0 12px 26px rgba(0, 184, 113, 0.25) !important;
  color: #fff !important;
}

.admin-nav {
  border-color: rgba(224, 0, 151, 0.1) !important;
}

.admin-nav a {
  color: var(--sp-muted) !important;
}

.admin-nav a:hover {
  background: linear-gradient(135deg, rgba(255, 47, 168, 0.1), rgba(95, 32, 181, 0.08)) !important;
  color: var(--sp-ink) !important;
}

.text-basil {
  color: var(--sp-green-dark) !important;
}

.bg-basil,
.bg-basil\/80 {
  background: linear-gradient(135deg, var(--sp-green), var(--sp-green-dark)) !important;
}

.border-basil {
  border-color: var(--sp-green) !important;
}

.bg-saffron,
.bg-yellow-50,
.bg-amber-50 {
  background: rgba(255, 196, 20, 0.14) !important;
}

.pos-register-shell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(360px, 31vw);
  min-height: calc(100vh - 66px);
}

.pos-rail {
  align-items: center;
  background: rgba(23, 16, 51, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 10px;
}

.pos-rail-action {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  font-size: 1.05rem;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.pos-rail-action:hover,
.pos-rail-action.is-active {
  background: linear-gradient(135deg, var(--sp-pink), var(--sp-purple) 58%, var(--sp-blue));
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 16px 34px rgba(255, 47, 168, 0.22);
  color: #fff;
  transform: translateY(-1px);
}

.pos-workspace {
  min-width: 0;
  overflow: hidden;
}

.pos-register-toolbar {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(95, 32, 181, 0.14);
  padding: 14px 18px;
}

.pos-search-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pos-search-tabs button {
  border: 1px solid rgba(95, 32, 181, 0.16);
  border-radius: 8px;
  color: var(--sp-muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 12px;
}

.pos-search-tabs button:hover,
.pos-search-tabs button.is-active {
  background: linear-gradient(135deg, rgba(255, 47, 168, 0.14), rgba(23, 54, 189, 0.11));
  border-color: rgba(255, 47, 168, 0.4);
  color: var(--sp-ink);
}

.pos-register-search-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 250px);
}

.pos-search-wrap {
  align-items: center;
  display: flex;
  position: relative;
}

.pos-search-wrap > span {
  color: var(--sp-muted);
  font-size: 1.1rem;
  font-weight: 900;
  left: 12px;
  position: absolute;
  z-index: 1;
}

.pos-search-wrap .pos-input {
  padding-left: 38px;
}

.pos-status-strip,
.pos-category-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pos-status-pill {
  background: rgba(0, 184, 113, 0.1);
  border: 1px solid rgba(0, 184, 113, 0.22);
  border-radius: 999px;
  color: var(--sp-green-dark);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 10px;
}

.pos-status-pill.is-offline {
  background: rgba(229, 72, 101, 0.1);
  border-color: rgba(229, 72, 101, 0.24);
  color: var(--sp-danger);
}

.pos-product-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 18px;
}

.pos-product-media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(255, 47, 168, 0.1), rgba(255, 196, 20, 0.13));
  display: grid;
  place-items: center;
}

.pos-product-media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.pos-product-media span {
  color: var(--sp-muted);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 12px;
  text-align: center;
}

.pos-product-body {
  padding: 12px;
}

.pos-cart-panel {
  background: rgba(255, 255, 255, 0.96);
  border-left: 1px solid rgba(95, 32, 181, 0.14);
  box-shadow: -22px 0 46px rgba(95, 32, 181, 0.08);
  min-width: 0;
}

.pos-cart-header {
  align-items: center;
  border-bottom: 1px solid rgba(95, 32, 181, 0.12);
  display: flex;
  justify-content: space-between;
  padding: 16px;
}

.pos-customer-card {
  align-items: center;
  border-bottom: 1px solid rgba(95, 32, 181, 0.1);
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  padding: 12px 16px;
}

.pos-customer-avatar,
.pos-result-icon {
  align-items: center;
  background: linear-gradient(135deg, var(--sp-pink), var(--sp-purple));
  border-radius: 10px;
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.pos-mini-button {
  border: 1px solid rgba(95, 32, 181, 0.18);
  border-radius: 8px;
  color: var(--sp-muted);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 9px;
}

.pos-cart-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 16px 0;
}

.pos-cart-lines {
  flex: 1 1 auto;
  max-height: calc(100vh - 468px);
  min-height: 150px;
  overflow: auto;
  padding: 14px 16px;
}

.pos-cart-line {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 247, 255, 0.92));
  border: 1px solid rgba(95, 32, 181, 0.14);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(95, 32, 181, 0.07);
  margin-bottom: 10px;
  padding: 12px;
}

.pos-line-remove {
  border: 1px solid rgba(229, 72, 101, 0.22);
  border-radius: 8px;
  color: var(--sp-danger);
  font-size: 1.1rem;
  height: 30px;
  line-height: 1;
  width: 30px;
}

.pos-payment-footer {
  border-top: 1px solid rgba(95, 32, 181, 0.12);
  padding: 16px;
}

.pos-payment-footer .pos-button-primary {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.pos-context-results {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 18px;
}

.pos-result-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(95, 32, 181, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  padding: 12px;
  text-align: left;
}

.pos-result-row strong,
.pos-result-row small {
  display: block;
}

.pos-result-row small {
  color: var(--sp-muted);
  margin-top: 2px;
}

.pos-result-row em {
  color: var(--sp-green-dark);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 900;
}

.sync-recovery-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 196, 20, 0.36);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px;
}

.sync-recovery-row strong,
.sync-recovery-row span,
.sync-recovery-row small {
  display: block;
}

.sync-recovery-row small {
  color: var(--sp-muted);
  margin-top: 2px;
}

.pos-empty-state,
.pos-empty-cart {
  border: 1px dashed rgba(95, 32, 181, 0.24);
  border-radius: 8px;
  color: var(--sp-muted);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 22px;
  text-align: center;
}

.pos-lock-overlay {
  align-items: center;
  background: rgba(23, 16, 51, 0.72);
  display: none;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 100;
}

.pos-lock-overlay.is-visible {
  display: flex;
}

.pos-lock-overlay > div {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 47, 168, 0.18);
  border-radius: 8px;
  box-shadow: 0 28px 72px rgba(23, 16, 51, 0.3);
  display: grid;
  gap: 18px;
  min-width: 280px;
  padding: 28px;
  text-align: center;
}

.pos-lock-overlay strong {
  color: var(--sp-ink);
  font-size: 1.25rem;
}

@media (max-width: 1180px) {
  .pos-register-shell {
    grid-template-columns: 58px minmax(0, 1fr) 360px;
  }
}

@media (max-width: 960px) {
  .pos-register-shell {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .pos-cart-panel {
    border-left: 0;
    border-top: 1px solid rgba(95, 32, 181, 0.14);
    grid-column: 1 / -1;
  }

  .pos-cart-lines,
  .pos-product-grid,
  .pos-context-results {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .pos-register-shell {
    display: block;
  }

  .pos-rail {
    flex-direction: row;
    justify-content: center;
    position: sticky;
    top: 64px;
    z-index: 8;
  }

  .pos-register-search-row {
    grid-template-columns: 1fr;
  }
}

.border-saffron,
.border-amber-300 {
  border-color: rgba(255, 196, 20, 0.46) !important;
}

.text-ember,
.text-red-600,
.text-red-800 {
  color: var(--sp-danger) !important;
}

table tr:hover {
  background: rgba(255, 47, 168, 0.045);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  .pos-header-clock {
    align-items: flex-start;
    border-right: 0;
    border-bottom: 1px solid rgba(95, 32, 181, 0.16);
    padding-bottom: 6px;
    padding-right: 0;
  }
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow-x: auto;
  border-bottom: 1px solid #dbe2ea;
  background: #fff;
}

.setup-steps a,
.setup-steps button {
  min-width: 116px;
  border-bottom: 3px solid transparent;
  padding: 12px 14px;
  color: #475569;
  font-size: .875rem;
  font-weight: 650;
  text-align: center;
  background: transparent;
}

.setup-steps a:hover,
.setup-steps a.is-active,
.setup-steps button:hover,
.setup-steps button.is-active {
  border-bottom-color: var(--sp-accent);
  color: var(--sp-ink);
  background: rgba(255, 47, 168, .055);
}

.setup-surface {
  min-height: 520px;
  border: 1px solid #dbe2ea;
  background: #fff;
  padding: clamp(18px, 3vw, 34px);
}

.receipt-preview {
  align-self: start;
  display: grid;
  gap: 5px;
  width: 100%;
  max-width: 340px;
  min-height: 440px;
  border: 1px solid #cbd5e1;
  padding: 30px 24px;
  background: #fff;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

.report-centre-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 650px; border: 1px solid #dbe2ea; background: #fff; }
.report-category-nav { border-right: 1px solid #dbe2ea; background: #f8fafc; }
.report-category-nav a { display: block; border-left: 3px solid transparent; padding: 11px 14px; color: #334155; font-size: .875rem; font-weight: 650; }
.report-category-nav a:hover, .report-category-nav a.is-active { border-left-color: var(--sp-success); background: #dcfce7; color: #14532d; }
.report-catalogue { min-width: 0; }
.report-group { padding: 18px 20px 4px; }
.report-group h3 { border-bottom: 1px solid #dbe2ea; padding-bottom: 8px; font-size: .875rem; font-weight: 750; }
.report-catalogue-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 16px; border-bottom: 1px solid #eef2f7; padding: 13px 6px; }
.report-title { color: #174ea6; font-weight: 700; text-align: left; }
.report-title:hover { text-decoration: underline; }
.report-catalogue-row p { margin-top: 3px; color: #64748b; font-size: .8rem; }
.report-access { white-space: nowrap; color: #64748b; font-size: .75rem; }
.report-options-dialog { width: min(720px, calc(100vw - 28px)); border: 0; border-radius: 8px; padding: 0; box-shadow: 0 24px 70px rgba(15,23,42,.28); }
.report-options-dialog::backdrop { background: rgba(15,23,42,.5); }
@media (max-width: 760px) { .report-centre-layout { grid-template-columns: 1fr; } .report-category-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid #dbe2ea; } .report-category-nav a { min-width: max-content; border-left: 0; border-bottom: 3px solid transparent; } .report-catalogue-row { grid-template-columns: minmax(0,1fr) auto; } .report-access { display: none; } }

.pin-login-shell {
  display: grid;
  min-height: calc(100vh - 66px);
  place-items: center;
  padding: 28px 16px;
  background: #f4f6f8;
}

.pin-login-panel {
  width: min(100%, 390px);
  border: 1px solid #d9dee5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(23, 32, 42, .12);
  padding: 28px;
}

.pin-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.pin-login-brand span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 7px; background: #17202a; color: #fff; font-weight: 800; }
.pin-login-brand strong { font-size: 1.05rem; }
.pin-login-eyebrow { color: #64748b; font-size: .7rem; font-weight: 750; }
.pin-login-panel h1 { margin: 3px 0 20px; font-size: 1.65rem; font-weight: 750; }
.pin-login-form { display: grid; gap: 14px; }
.pin-login-form label { display: grid; gap: 6px; color: #334155; font-size: .8rem; font-weight: 700; }
.pin-login-code { font-size: 1.35rem; letter-spacing: .25rem !important; text-align: center; }
.pin-login-error { margin-bottom: 16px; border: 1px solid #fecaca; border-radius: 6px; background: #fef2f2; color: #991b1b; padding: 9px 11px; font-size: .82rem; }
.pin-login-validation { color: #b91c1c; font-size: .75rem; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-keypad button { min-height: 48px; border: 1px solid #cbd5e1; border-radius: 6px; background: #f8fafc; color: #17202a; font-weight: 750; }
.pin-keypad button:hover, .pin-keypad button:focus-visible { border-color: #2f6f5e; background: #eef3f0; outline: none; }
.pin-login-submit { min-height: 48px; border: 1px solid #17202a; border-radius: 6px; background: #17202a; color: #fff; font-weight: 750; }
.pin-login-submit:hover { background: #263646; }
