:root {
  color-scheme: light;
  /* Encanto / Coco — cempasúchil, magenta, teal, atardecer */
  --color-primary: #B45309;
  --color-primary-strong: #92400E;
  --color-on-primary: #ffffff;
  --color-secondary: #D97706;
  --color-secondary-strong: #D97706;
  --color-accent: #0D9488;
  --color-accent-strong: #0F766E;
  --color-accent-soft: #CCFBF1;
  --color-magenta: #B45309;
  --color-marigold: #D97706;
  --color-cobalt: #4F46E5;
  --color-background: #FAFAF9;
  --color-surface: #ffffff;
  --color-surface-soft: #F5F5F4;
  --color-foreground: #292524;
  --color-muted: #78716C;
  --color-border: #E7E5E4;
  --color-border-strong: #D6D3D1;
  --color-destructive: #DC2626;
  --color-destructive-soft: #FEF2F2;
  --color-success: #0D9488;
  --color-success-soft: #F0FDFA;
  --color-warning: #D97706;
  --color-warning-soft: #FFFBEB;
  --color-ring: #E879F9;
  --shadow-sm: 0 2px 4px rgba(61, 31, 15, 0.06);
  --shadow-md: 0 8px 24px rgba(41, 37, 36, 0.08);
  --shadow-festiva: 0 2px 8px rgba(41, 37, 36, 0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --transition: 200ms ease-out;
  --font: "Nunito", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Baloo 2", "Fredoka", var(--font);
  --gradient-fiesta: linear-gradient(135deg, #D97706 0%, #B45309 100%);
  --gradient-sunset: linear-gradient(160deg, #FAFAF9 0%, #F5F5F4 100%);
  --gradient-marigold: linear-gradient(180deg, #FFD54F 0%, #FFB703 55%, #F59E0B 100%);
  --focus-ring: 0 0 0 3px rgba(219, 39, 119, 0.28);
  --focus-ring-accent: 0 0 0 3px rgba(13, 148, 136, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--color-background);
  color: var(--color-foreground);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.employee-shell {
  min-height: 100dvh;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: var(--color-background);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-accent-strong); }

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -48px;
  z-index: 1000;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.skip-link:focus {
  top: var(--space-4);
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ——— Topbar (employee) ——— */
.topbar {
  background: rgba(255, 251, 245, 0.92);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: var(--shadow-sm);
}
.topbar::after { content: none; }
.topbar .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  padding-left: max(var(--space-6), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-6), env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-foreground);
  font-weight: 800;
  min-height: 44px;
}
.brand:hover { color: var(--color-foreground); }
.brand-mark {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.brand-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.1;
}
.brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--color-primary-strong);
}
.brand-tagline {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-muted);
}

.employee-admin-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  color: var(--color-muted);
  font-weight: 700;
  font-size: 0.9375rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.employee-admin-link:hover {
  color: var(--color-primary);
  border-color: var(--color-border-strong);
  background: var(--color-surface-soft);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) var(--space-8);
}

/* ——— Admin layout ——— */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100dvh;
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-primary);
  color: #e2e8f0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 50;
}
.admin-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-compact { color: #f8fafc; }
.brand-compact .brand-mark { background: rgba(255, 255, 255, 0.12); }
.sidebar-close {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sidebar-close:hover { background: rgba(255, 255, 255, 0.08); }

.admin-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}
.nav-item[aria-current="page"],
.nav-item.is-active {
  background: rgba(5, 150, 105, 0.22);
  color: #ecfdf5;
}
.nav-item-muted { opacity: 0.85; margin-top: var(--space-1); }
.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: var(--space-2) var(--space-2);
}

.admin-sidebar-foot {
  padding: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-logout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.nav-logout:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

.admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  display: none;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.sidebar-toggle {
  appearance: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-primary);
}
.sidebar-toggle:hover { background: var(--color-surface-soft); }
.admin-topbar-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-foreground);
}
.admin-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 45;
}
.admin-page {
  max-width: 1280px;
  width: 100%;
}

/* ——— Typography ——— */
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
  font-weight: 800;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  margin-bottom: var(--space-3);
  font-weight: 700;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1.0625rem;
  margin-bottom: var(--space-2);
  font-weight: 700;
}
.eyebrow {
  margin-bottom: var(--space-2);
  color: var(--color-magenta);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.employee-shell .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.employee-shell .eyebrow::before {
  content: "";
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--gradient-fiesta);
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.page-heading p:last-child { margin-bottom: 0; color: var(--color-muted); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.section-header h2 { margin-bottom: 0; }
.live-updated {
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-weight: 600;
}

/* ——— Surfaces ——— */
.panel,
.admin-card,
.kpi,
.result-card,
.confirm-panel,
.preview-panel,
.empty-state,
.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.panel { padding: var(--space-5); margin: var(--space-4) 0; }
.panel > h2:first-child { margin-top: 0; }
.panel-lead {
  color: var(--color-muted);
  margin: 0 0 var(--space-4);
  max-width: 62ch;
}
.empty-state {
  padding: var(--space-8) var(--space-5);
  color: var(--color-muted);
  text-align: center;
}
.empty-state strong {
  display: block;
  color: var(--color-foreground);
  font-size: 1.125rem;
  margin-bottom: var(--space-2);
}

/* ——— Buttons ——— */
.button, button {
  appearance: none;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-on-primary);
  font-weight: 800;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 0.9375rem;
  min-height: 44px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: background var(--transition), transform var(--transition), opacity var(--transition), box-shadow var(--transition);
}
.button:hover, button:hover {
  background: var(--color-accent-strong);
  transform: translateY(-1px);
}
.button.primary, button.primary,
.confirm-submit-desktop,
.mobile-sticky-bar .large.primary {
  background: var(--gradient-marigold);
  color: #451a03;
  box-shadow: var(--shadow-festiva);
  border: 2px solid rgba(255, 255, 255, 0.55);
}
.button.primary:hover, button.primary:hover,
.confirm-submit-desktop:hover,
.mobile-sticky-bar .large.primary:hover {
  background: linear-gradient(180deg, #FFE082 0%, #FFC107 55%, #FFB703 100%);
  color: #451a03;
}
.button:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-accent);
}
.button.secondary, button.secondary {
  background: var(--color-surface-soft);
  color: var(--color-foreground);
  border: 1px solid var(--color-border);
}
.button.secondary:hover, button.secondary:hover {
  background: var(--color-border);
}
.button.danger, button.danger {
  background: var(--color-destructive);
  color: #fff;
}
.button.danger:hover, button.danger:hover { background: #b91c1c; }
.button.large, button.large {
  font-size: 1.125rem;
  padding: 16px 24px;
  min-height: 56px;
  width: auto;
}
button:disabled, .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ——— Flash ——— */
.flash {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin: 0 0 var(--space-4);
  background: var(--color-warning-soft);
  border: 1px solid #fde68a;
  font-weight: 600;
  color: var(--color-warning);
}
.flash.error, .flash.danger {
  background: var(--color-destructive-soft);
  border-color: #fecaca;
  color: var(--color-destructive);
}
.flash.success {
  background: var(--color-success-soft);
  border-color: #a7f3d0;
  color: var(--color-success);
}

.warning {
  border-left: 4px solid var(--color-warning);
  padding: var(--space-3) var(--space-4);
  background: var(--color-warning-soft);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: #92400e;
  margin: var(--space-3) 0;
}

.status { font-weight: 700; }
.status.ok, .ok { color: var(--color-success); }
.status.bad, .bad { color: var(--color-destructive); }
.waiting { color: var(--color-warning); }

/* ——— Employee ——— */
.employee-shell .page { max-width: 1120px; }

.employee-hero {
  display: flex;
  justify-content: space-between;
  gap: var(--space-5);
  align-items: flex-end;
  padding: var(--space-3) 0 var(--space-5);
}
.employee-hero > div:first-child {
  position: relative;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--gradient-sunset);
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.employee-hero > div:first-child::after {
  content: "";
  position: absolute;
  inset: auto 12px -6px 12px;
  height: 6px;
  border-radius: 0 0 8px 8px;
  background: repeating-linear-gradient(
    90deg,
    #DB2777 0 10px,
    #FFB703 10px 20px,
    #14B8A6 20px 30px
  );
  opacity: 0.75;
}
.employee-hero.compact { align-items: flex-start; padding-bottom: var(--space-3); }
.employee-hero.compact > div:first-child::after { display: none; }
.employee-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  color: var(--color-foreground);
  line-height: 1.15;
}
.hero-note {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.2), rgba(219, 39, 119, 0.12));
  color: var(--color-primary-strong);
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-weight: 800;
  font-size: 0.9375rem;
  max-width: 300px;
  line-height: 1.45;
}

.catalog-section { margin-top: var(--space-6); }
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-border);
}
.section-title-row h2 {
  margin: 0;
  font-size: 1.125rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-primary-strong);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: var(--space-4);
}
.shop-card {
  display: grid;
  grid-template-rows: 136px auto auto;
  gap: var(--space-2);
  min-height: 220px;
  padding: var(--space-3);
  padding-top: calc(var(--space-3) + 4px);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}
.shop-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--card-stripe, linear-gradient(90deg, #DB2777, #FFB703));
}
.shop-card:nth-child(5n+1) { --card-stripe: linear-gradient(90deg, #DB2777, #FFB703); }
.shop-card:nth-child(5n+2) { --card-stripe: linear-gradient(90deg, #FFB703, #14B8A6); }
.shop-card:nth-child(5n+3) { --card-stripe: linear-gradient(90deg, #14B8A6, #7C3AED); }
.shop-card:nth-child(5n+4) { --card-stripe: linear-gradient(90deg, #7C3AED, #F97316); }
.shop-card:nth-child(5n+5) { --card-stripe: linear-gradient(90deg, #F97316, #DB2777); }
.shop-card:hover {
  border-color: var(--color-magenta);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px) rotate(-0.25deg);
}
.shop-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-accent);
}
.shop-card.unavailable { opacity: 0.72; }
.shop-thumb {
  width: 100%;
  height: 136px;
  object-fit: contain;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.shop-name {
  font-weight: 800;
  color: var(--color-foreground);
  min-height: 2.6em;
  line-height: 1.25;
  font-size: 0.9375rem;
}
.shop-meta {
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-weight: 600;
}
.shop-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-1);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-destructive);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--color-muted);
  font-weight: 700;
  min-height: 44px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
}
.back-link:hover { color: var(--color-primary); }

.confirm-layout {
  display: grid;
  grid-template-columns: minmax(260px, 400px) 1fr;
  gap: var(--space-6);
  align-items: start;
}
.preview-panel { padding: var(--space-4); }
.sticker-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.confirm-panel { padding: var(--space-5); }
.form-section { margin: var(--space-5) 0; }
.form-section-title {
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin: 0 0 var(--space-3);
}

.detail-list {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}
.detail-list div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}
.detail-list span {
  color: var(--color-muted);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-list strong { font-weight: 700; }

.confirm-check {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  min-height: 44px;
  transition: border-color var(--transition);
}
.confirm-check:has(input:checked) {
  border-color: var(--color-magenta);
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.15), rgba(219, 39, 119, 0.08));
}
.confirm-check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-magenta);
}

.qty-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-3) 0;
}
.qty-option {
  position: relative;
  cursor: pointer;
}
.qty-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.qty-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 52px;
  padding: 0 var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1.125rem;
  font-weight: 800;
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.qty-option input:focus-visible + span {
  box-shadow: var(--focus-ring-accent);
}
.qty-option input:checked + span {
  border-color: var(--color-magenta);
  background: linear-gradient(180deg, rgba(255, 183, 3, 0.35), rgba(219, 39, 119, 0.12));
  color: var(--color-primary-strong);
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(217, 119, 6, 0.25);
}
.qty-option.printer-option span {
  font-size: 0.875rem;
  font-weight: 700;
  min-height: 48px;
  min-width: 120px;
  text-align: center;
  line-height: 1.2;
}

.final-check {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  color: var(--color-foreground);
  font-weight: 600;
}

/* ——— Forms ——— */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}
label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin: var(--space-2) 0 var(--space-1);
  color: var(--color-foreground);
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  font: inherit;
  background: var(--color-surface);
  min-height: 44px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring-accent);
}
textarea { min-height: 96px; resize: vertical; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
  align-items: center;
}

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
}
th, td {
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  padding: 12px 14px;
  vertical-align: top;
}
th {
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }

/* ——— Admin KPIs & cards ——— */
.admin-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.kpi {
  padding: var(--space-4);
  border-left: 4px solid var(--color-accent);
}
.kpi-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin-bottom: var(--space-1);
}
.kpi strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 800;
  color: var(--color-foreground);
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.admin-card { padding: var(--space-4); }
.admin-card.inactive { opacity: 0.7; }
.admin-card-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
  margin-bottom: var(--space-2);
}
.admin-card h3 { margin: 0; font-size: 1rem; }
.admin-card p { margin: var(--space-1) 0; font-size: 0.875rem; color: var(--color-muted); }
.admin-card p strong { color: var(--color-foreground); }
.admin-thumb {
  width: 100%;
  height: 148px;
  object-fit: contain;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}
.import-page {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--transition);
}
.import-page:has(input:checked) {
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring-accent);
}
.import-page input { width: auto; accent-color: var(--color-accent); }
.import-page img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
}
.import-page span { font-weight: 800; font-size: 0.875rem; }

/* Printer visuals */
.printer-visual {
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--color-surface-soft), #e8eef4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.printer-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-3);
}
.device-illustration {
  position: relative;
  width: 76%;
  height: 70%;
  border-radius: var(--radius-md);
  background: #1e293b;
  box-shadow: inset 0 -16px 0 rgba(255, 255, 255, 0.06);
}
.device-illustration::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 42%;
  height: 14%;
  border-radius: 4px;
  background: #0f172a;
}
.device-illustration::after {
  content: "";
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: -24%;
  height: 34%;
  border-radius: 0 0 6px 6px;
  background: #fff;
  border: 1px solid var(--color-border);
}
.device-illustration span {
  position: absolute;
  right: 10%;
  top: 12%;
  width: 34px;
  height: 10px;
  border-radius: 999px;
  background: #34d399;
}
.printer-visual.laser .device-illustration { height: 78%; background: #475569; }
.printer-visual.laser .device-illustration::after {
  left: 20%; right: 20%; bottom: 18%; height: 18%;
  background: #1e293b; border: 0;
}
.printer-visual.thermal .device-illustration { width: 82%; height: 48%; }
.printer-visual.thermal .device-illustration::after {
  left: 26%; right: 26%; bottom: -42%; height: 64%;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: lowercase;
  background: var(--color-surface-soft);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}
.pill.ok { background: var(--color-success-soft); color: var(--color-success); border-color: #a7f3d0; }
.pill.bad { background: var(--color-destructive-soft); color: var(--color-destructive); border-color: #fecaca; }
.pill.waiting { background: var(--color-warning-soft); color: var(--color-warning); border-color: #fde68a; }

.actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--space-3);
}
.actions form { margin: 0; }

.live-message {
  max-height: 88px;
  overflow: auto;
  font-size: 0.8125rem;
  color: var(--color-muted);
  white-space: pre-wrap;
}
.live-job-list { display: grid; gap: var(--space-2); }
.live-job-row {
  display: grid;
  grid-template-columns: 1.1fr auto 1fr 1fr 2fr;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 0.875rem;
}

/* ——— Auth ——— */
.auth-page {
  min-height: calc(100dvh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) 0;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-8) var(--space-6);
}
.auth-card h1 {
  text-align: center;
  margin-bottom: var(--space-2);
  font-size: 1.75rem;
}
.auth-card .eyebrow { text-align: center; }
.auth-lead {
  text-align: center;
  color: var(--color-muted);
  margin: 0 0 var(--space-5);
}
.auth-card .form-actions { justify-content: stretch; }
.auth-card .form-actions button { width: 100%; }

/* ——— Result / success ——— */
.result-card {
  padding: var(--space-8) var(--space-6);
  max-width: 640px;
  margin: var(--space-4) auto;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--gradient-sunset);
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--gradient-fiesta);
}
.result-card.waiting {
  border-color: #fde68a;
  background: var(--color-warning-soft);
}
.result-card.bad {
  border-color: #fecaca;
  background: var(--color-destructive-soft);
}
.result-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-success-soft);
  color: var(--color-success);
  margin: 0 auto var(--space-4);
}
.result-icon svg { width: 32px; height: 32px; }
.result-card.waiting .result-icon { background: var(--color-warning-soft); color: var(--color-warning); }
.result-card.bad .result-icon { background: var(--color-destructive-soft); color: var(--color-destructive); }
.result-card h1 {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-family: var(--font-display);
  font-weight: 800;
}
.result-subtitle {
  font-size: 1.0625rem;
  color: var(--color-muted);
  margin: 0 0 var(--space-5);
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}
.result-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
  text-align: left;
}
.result-details div {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
}
.result-details dt {
  font-size: 0.6875rem;
  color: var(--color-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.result-details dd {
  margin: var(--space-1) 0 0;
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.result-alert {
  min-height: 24px;
  color: var(--color-destructive);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
}
.result-card .button.large { width: 100%; max-width: 320px; }

/* ——— Responsive ——— */
@media (max-width: 960px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 88vw);
    transform: translateX(-105%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-md);
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-backdrop.is-visible { display: block; }
  .sidebar-close { display: inline-flex; }
  .admin-topbar { display: flex; }
  .admin-page { padding-top: var(--space-4); }
}

@media (max-width: 820px) {
  .topbar .inner { padding: var(--space-3) var(--space-4); }
  .page { padding: var(--space-5) var(--space-4) var(--space-8); }
  .employee-hero { flex-direction: column; align-items: flex-start; }
  .hero-note { max-width: none; width: 100%; }
  .confirm-layout { grid-template-columns: 1fr; }
  .button.large, button.large { width: 100%; }
  .live-job-row { grid-template-columns: 1fr; }
  .result-details { grid-template-columns: 1fr; }
  .detail-list div { grid-template-columns: 1fr; gap: var(--space-1); }
}

@media (max-width: 520px) {
  .shop-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .shop-card {
    grid-template-columns: 88px 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
    align-items: center;
  }
  .shop-thumb {
    grid-row: 1 / span 2;
    height: 88px;
    width: 88px;
  }
  .shop-name { min-height: 0; }
  .shop-badge { grid-column: 2; }
  .brand-text { font-size: 0.95rem; }
}

/* ——— PWA / mobile webapp ——— */
.install-banner {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.install-banner[hidden] { display: none !important; }
.install-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.install-banner-text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1 1 220px;
}
.install-banner-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.install-banner .button.small {
  min-height: 44px;
  padding: 0 var(--space-4);
}
.install-banner .button.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.install-banner .button.primary {
  background: var(--color-accent);
  color: #fff;
  border: 0;
}

.offline-banner {
  background: var(--color-warning-soft);
  color: #92400e;
  border-bottom: 1px solid #fcd34d;
  text-align: center;
  font-weight: 700;
  font-size: 0.875rem;
  padding: var(--space-2) var(--space-4);
}
.offline-banner[hidden] { display: none !important; }

.employee-shell .page {
  padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--space-6), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-6), env(safe-area-inset-right, 0px));
}

.confirm-form.has-sticky-bar {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.mobile-sticky-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
  background: rgba(255, 251, 245, 0.97);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #DB2777, #FFB703, #14B8A6) 1;
  box-shadow: 0 -6px 20px rgba(192, 38, 211, 0.1);
  backdrop-filter: blur(12px);
  gap: var(--space-2);
}
.mobile-sticky-summary {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 600;
}
.mobile-sticky-summary strong { color: var(--color-foreground); }

@media (max-width: 820px) {
  .confirm-submit-desktop { display: none; }
  .confirm-form { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .mobile-sticky-bar {
    display: grid;
    grid-template-columns: 1fr;
  }
  .mobile-sticky-bar .large {
    width: 100%;
    min-height: 48px;
  }
  .qty-option {
    min-width: 52px;
    min-height: 48px;
  }
  .confirm-check input {
    width: 24px;
    height: 24px;
  }
}

@media (display-mode: standalone) {
  .install-banner { display: none !important; }
  .employee-shell .topbar {
    padding-top: max(env(safe-area-inset-top, 0px), var(--space-1));
  }
}

/* ——— Print counter (odometer) ——— */
.print-counter-panel {
  margin: var(--space-5) 0;
  padding: var(--space-4) var(--space-5);
  border: 2px dashed var(--color-marigold);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.12), rgba(219, 39, 119, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.print-counter-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-foreground);
}
.print-counter-number {
  display: inline-block;
  min-width: 3ch;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary-strong);
  line-height: 1.1;
}
.print-counter-hint {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.45;
}
.custom-copies-label input {
  min-height: 44px;
  font-size: 16px;
}
.shop-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-1);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  color: #451a03;
  background: linear-gradient(180deg, #FFE082, #FFB703);
  border: 1px solid rgba(217, 119, 6, 0.35);
  font-variant-numeric: tabular-nums;
}

/* ——— Job status bar (thin, non-blocking) ——— */
.employee-shell.has-job-status-bar .page {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.job-status-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  background: rgba(255, 251, 245, 0.98);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #DB2777, #FFB703, #14B8A6) 1;
  box-shadow: 0 -4px 16px rgba(219, 39, 119, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.job-status-bar.is-finished {
  background: rgba(255, 255, 255, 0.98);
}
.job-status-bar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-2) var(--space-4);
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  justify-content: space-between;
}
.job-status-main { min-width: 0; flex: 1 1 160px; }
.job-status-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--color-primary-strong);
}
.job-status-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-status-counter {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.25), rgba(20, 184, 166, 0.15));
  border: 2px solid rgba(255, 183, 3, 0.45);
}
.job-status-counter-label {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-secondary-strong);
}
.job-status-counter-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary-strong);
}
.job-status-cancel {
  margin: 0;
  flex: 0 0 auto;
}
.job-status-cancel .button.small {
  min-height: 44px;
  min-width: 88px;
}
.job-status-cancel[hidden] { display: none !important; }
.job-status-counter[hidden] { display: none !important; }

@media (max-width: 820px) {
  .employee-shell.has-job-status-bar .page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}


.job-status-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
}
.job-status-live.is-active {
  background: #FFFBEB;
  border-color: #FCD34D;
}
.job-status-live-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}
.job-status-live-value {
  font-size: 1.5rem;
  line-height: 1.1;
  font-weight: 800;
  color: var(--color-foreground);
  font-variant-numeric: tabular-nums;
}
.job-status-bar[data-phase="printing"] .job-status-live-value,
.job-status-bar[data-phase="queued"] .job-status-live-value {
  color: var(--color-primary-strong);
}
.job-status-bar {
  border-top: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -4px 16px rgba(41, 37, 36, 0.06);
}

.employee-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.employee-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--color-border);
}
.employee-nav-link.is-active,
.employee-nav-link[aria-current="page"] {
  color: var(--color-primary-strong);
  border-color: rgba(219, 39, 119, 0.28);
  background: rgba(219, 39, 119, 0.08);
}
.employee-nav-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  background: var(--color-primary);
  color: #fff;
}
.employee-hero-compact {
  margin-bottom: 1rem;
}
.employee-jobs-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 1.1rem;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}
.employee-jobs-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.employee-jobs-header h2 {
  margin: 0;
  font-size: 1.2rem;
}
.employee-jobs-subtitle {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.employee-jobs-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}
.employee-jobs-updated {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.employee-jobs-list {
  display: grid;
  gap: 0.85rem;
}
.employee-job-card {
  border: 1px solid var(--color-border);
  border-radius: 0.95rem;
  padding: 0.9rem 1rem;
  background: #fff;
}
.employee-job-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.employee-job-title {
  margin: 0;
  font-size: 1.05rem;
}
.employee-job-number {
  margin: 0.2rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}
.employee-job-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0 0;
}
.employee-job-details div {
  min-width: 0;
}
.employee-job-details dt {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.employee-job-details dd {
  margin: 0.15rem 0 0;
  font-weight: 700;
}
.employee-job-error {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--color-destructive);
}
.employee-job-note {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}
.employee-job-note-info {
  color: var(--color-text-muted);
}
.employee-job-note-success {
  color: var(--color-success);
  background: var(--color-success-soft);
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
}
.employee-job-note-error {
  color: var(--color-destructive);
  background: var(--color-destructive-soft);
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
}
.result-note {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}
.result-note-info {
  color: var(--color-text-muted);
}
.result-note-success {
  color: var(--color-success);
  background: var(--color-success-soft);
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
}
.result-note-error {
  color: var(--color-destructive);
  background: var(--color-destructive-soft);
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
}
.employee-job-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}
.employee-job-cancel {
  margin: 0;
}
.employee-jobs-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}
.employee-jobs-footer .button.large {
  width: 100%;
  max-width: 360px;
}
@media (max-width: 640px) {
  .employee-job-details {
    grid-template-columns: 1fr;
  }
  .employee-jobs-header {
    flex-direction: column;
  }
  .employee-jobs-meta {
    align-items: flex-start;
  }
}
