/*
 * UPOS professional visual system and responsive refinement
 * Release: 2026-08-24g
 *
 * This layer is deliberately separate from the generated Vite bundle. It
 * improves the existing TanStack application without weakening the live
 * MySQL-backed workflows or tenant isolation.
 */

:root {
  --upos-canvas: #f7f9fc;
  --upos-surface: #ffffff;
  --upos-ink: #0b1220;
  --upos-muted: #64748b;
  --upos-border: #e2e8f0;
  --upos-border-strong: #cbd5e1;
  --upos-primary: #5b5cf0;
  --upos-primary-strong: #4f46e5;
  --upos-primary-soft: #eef0ff;
  --upos-success: #059669;
  --upos-success-soft: #e8f8f2;
  --upos-warning: #d97706;
  --upos-warning-soft: #fff5df;
  --upos-danger: #dc2626;
  --upos-danger-soft: #fff0f0;
  --upos-sidebar: #07111f;
  --upos-sidebar-2: #0b1728;
  --upos-sidebar-text: #dbe5f3;
  --upos-shadow-sm: 0 1px 2px rgb(15 23 42 / 0.04);
  --upos-shadow-card: 0 10px 30px -24px rgb(15 23 42 / 0.42),
    0 1px 3px rgb(15 23 42 / 0.06);
  --upos-shadow-float: 0 24px 60px -28px rgb(15 23 42 / 0.44),
    0 8px 20px -14px rgb(15 23 42 / 0.2);
  --upos-radius-sm: 0.625rem;
  --upos-radius: 0.875rem;
  --upos-radius-lg: 1rem;

  --background: oklch(98.5% 0.006 255);
  --foreground: oklch(18% 0.03 260);
  --card: oklch(100% 0 0);
  --card-foreground: oklch(18% 0.03 260);
  --popover: oklch(100% 0 0);
  --popover-foreground: oklch(18% 0.03 260);
  --primary: oklch(55% 0.22 275);
  --primary-foreground: oklch(99% 0.005 250);
  --ring: oklch(55% 0.22 275);
  --muted: oklch(97% 0.008 255);
  --muted-foreground: oklch(50% 0.035 260);
  --border: oklch(91.5% 0.012 255);
  --input: oklch(91.5% 0.012 255);
  --success: oklch(63% 0.16 155);
  --warning: oklch(72% 0.16 75);
  --destructive: oklch(58% 0.23 27);
  --sidebar: oklch(15% 0.035 260);
  --sidebar-foreground: oklch(92% 0.012 255);
  --sidebar-primary: oklch(63% 0.2 275);
  --sidebar-accent: oklch(22% 0.04 265);
  --sidebar-border: oklch(26% 0.03 265);
}

html {
  color-scheme: light;
  background: var(--upos-canvas);
}

body {
  background: var(--upos-canvas);
  color: var(--upos-ink);
  font-feature-settings: "kern" 1, "liga" 1;
}

::selection {
  color: #fff;
  background: var(--upos-primary);
}

:where(a, button, input, select, textarea, [role="button"]):focus-visible {
  outline: 3px solid rgb(91 92 240 / 0.24) !important;
  outline-offset: 2px !important;
}

button,
[role="button"],
input,
select,
textarea {
  font-family: inherit;
}

/* Authenticated application shell */
aside.app-print-shell {
  background: linear-gradient(180deg, var(--upos-sidebar), var(--upos-sidebar-2));
  border-color: rgb(148 163 184 / 0.16);
  box-shadow: 8px 0 30px -28px rgb(2 6 23 / 0.9);
}

aside.app-print-shell > a:first-child,
aside.app-print-shell > div:first-child {
  min-height: 5rem;
  border-bottom-color: rgb(148 163 184 / 0.16) !important;
}

aside.app-print-shell nav {
  padding: 0.875rem 0.625rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgb(148 163 184 / 0.25) transparent;
}

aside.app-print-shell nav a,
aside.app-print-shell nav button {
  min-height: 2.625rem;
  border-radius: 0.7rem;
  transition: color 160ms ease, background-color 160ms ease,
    transform 160ms ease;
}

aside.app-print-shell nav a:hover,
aside.app-print-shell nav button:hover {
  background: rgb(255 255 255 / 0.07);
  color: #fff;
}

aside.app-print-shell nav a[aria-current="page"],
aside.app-print-shell nav a[class*="bg-sidebar-primary"] {
  color: #fff;
  background: linear-gradient(135deg, #5b5cf0, #6c74ff);
  box-shadow: 0 10px 26px -16px rgb(99 102 241 / 0.9),
    inset 0 1px rgb(255 255 255 / 0.18);
}

header.app-print-shell {
  min-height: 4rem;
  height: 4rem;
  background: rgb(255 255 255 / 0.94);
  border-color: var(--upos-border);
  box-shadow: 0 1px 0 rgb(15 23 42 / 0.03);
  backdrop-filter: blur(16px) saturate(1.25);
}

header.app-print-shell button,
header.app-print-shell [role="button"] {
  min-width: 2.625rem;
  min-height: 2.625rem;
}

main.app-print-main {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.42), transparent 16rem),
    var(--upos-canvas);
}

body[data-upos-route^="/admin/"] main.app-print-main {
  max-width: 100%;
}

body[data-upos-route^="/admin/"] main .shadow-card,
body[data-upos-route^="/admin/"] main [class*="shadow-card"] {
  border-color: var(--upos-border);
  border-radius: var(--upos-radius-lg);
  background: var(--upos-surface);
  box-shadow: var(--upos-shadow-card);
}

body[data-upos-route^="/admin/"] main h1 {
  color: var(--upos-ink);
  letter-spacing: -0.035em;
}

body[data-upos-route^="/admin/"] main h2,
body[data-upos-route^="/admin/"] main h3 {
  color: #111827;
  letter-spacing: -0.018em;
}

body[data-upos-route="/admin/dashboard"] main > div > .mb-6.grid {
  align-items: stretch;
}

body[data-upos-route="/admin/dashboard"] main > div > .mb-6.grid > * {
  min-width: 0;
}

body[data-upos-route="/admin/dashboard"] main .shadow-card [class~="p-5"] {
  min-height: 7.25rem;
  padding: 1.25rem;
}

body[data-upos-route="/admin/dashboard"] main .text-2xl.font-bold {
  color: #07111f;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  overflow: visible;
  text-overflow: clip;
}

body[data-upos-route="/admin/dashboard"] main .border-dashed {
  border-color: var(--upos-border-strong);
  background: linear-gradient(180deg, #fbfcff, #f8fafc);
}

.upos-chart-empty {
  min-height: 16rem;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  color: var(--upos-muted);
  text-align: center;
}

.upos-chart-empty__icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  color: var(--upos-primary);
  background: var(--upos-primary-soft);
  border: 1px solid #dfe2ff;
  border-radius: 0.875rem;
}

.upos-chart-empty__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.upos-chart-empty__title {
  color: #1e293b;
  font-size: 0.95rem;
  font-weight: 650;
}

.upos-chart-empty__copy {
  max-width: 24rem;
  color: var(--upos-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.upos-chart-empty__action {
  display: inline-flex;
  min-height: 2.625rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0.9rem;
  color: var(--upos-primary-strong);
  background: #fff;
  border: 1px solid #cfd3ff;
  border-radius: 0.7rem;
  box-shadow: var(--upos-shadow-sm);
  font-size: 0.8125rem;
  font-weight: 650;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease,
    transform 160ms ease;
}

.upos-chart-empty__action svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.upos-chart-empty__action:hover {
  background: #f7f7ff;
  border-color: #aeb4ff;
  transform: translateY(-1px);
}

.upos-recent-store-row {
  position: relative;
  min-height: 3.45rem;
  margin-inline: -0.5rem;
  padding: 0.55rem 2.25rem 0.7rem 0.5rem !important;
  border-radius: 0.65rem;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.upos-recent-store-row:hover,
.upos-recent-store-row:focus-visible {
  background: #f8faff;
  transform: translateX(2px);
}

.upos-recent-store-row__chevron {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
  transform: translateY(-50%);
  pointer-events: none;
}

.upos-store-targeted {
  position: relative;
  background: linear-gradient(90deg, #eef0ff, #f8f9ff 72%, #fff) !important;
  box-shadow: inset 4px 0 var(--upos-primary);
}

.upos-store-targeted:focus {
  outline: 3px solid rgb(91 92 240 / 0.22);
  outline-offset: -3px;
}

.upos-store-target-badge {
  display: inline-flex;
  min-height: 1.35rem;
  align-items: center;
  margin-top: 0.35rem;
  padding: 0 0.45rem;
  color: var(--upos-primary-strong);
  background: #fff;
  border: 1px solid #cfd3ff;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.upos-scroll-hint {
  display: none;
}

/* Login surface */
.upos-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden auto;
  background-color: #fff !important;
  background-image: none !important;
}

.upos-login-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.upos-login-page > .pointer-events-none.fixed {
  display: none !important;
}

.upos-login-page > .relative.z-10.flex.justify-end {
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
}

.upos-login-page > .relative.z-10.flex-1 {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.upos-login-page .w-full.max-w-md {
  max-width: 30rem;
}

.upos-login-page .text-center.mb-6 {
  margin-bottom: 1.25rem;
}

.upos-login-page .h-24.w-24 {
  width: 5.5rem;
  height: 5.5rem;
  margin-bottom: 0.75rem;
  padding: 0.45rem;
  border: 1px solid var(--upos-border);
  border-radius: 1.5rem;
  background: rgb(255 255 255 / 0.96);
  background-image: none !important;
  box-shadow: 0 20px 44px -26px rgb(79 70 229 / 0.6),
    0 4px 14px rgb(15 23 42 / 0.08);
  animation: none !important;
}

.upos-login-page .h-24.w-24 > img {
  visibility: visible;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upos-login-page .text-4xl.font-black {
  color: #172554;
  background: none;
  font-size: clamp(2rem, 4vw, 2.5rem);
  letter-spacing: 0.16em;
  animation: none;
}

.upos-login-page h1 {
  color: #111827 !important;
  font-size: 1.075rem !important;
  font-weight: 700 !important;
}

.upos-login-page .text-center.mb-6 > p {
  color: #64748b;
  font-size: 0.875rem;
}

.upos-login-page .text-center.mb-6 > p svg {
  display: none;
}

.upos-login-page .glass-card {
  background: rgb(255 255 255 / 0.97) !important;
  border-color: var(--upos-border) !important;
  backdrop-filter: none !important;
}

.upos-login-page .glass-card.shadow-elegant {
  border-radius: 1rem;
  box-shadow: var(--upos-shadow-float) !important;
}

.upos-login-page .glass-card [class~="p-6"] {
  padding: 1.75rem;
}

.upos-login-page form label {
  color: #334155;
  font-size: 0.875rem;
  font-weight: 600;
}

.upos-login-page form input {
  min-height: 3rem;
  color: #0f172a !important;
  background: #fff !important;
  border: 1px solid #dbe2ea !important;
  border-radius: 0.7rem;
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.025);
}

.upos-login-page form input:hover {
  border-color: #c5ced9 !important;
}

.upos-login-page form input:focus {
  border-color: #8b8df7 !important;
  box-shadow: 0 0 0 4px rgb(91 92 240 / 0.12) !important;
}

.upos-login-page form button[type="submit"] {
  min-height: 3rem;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, #4f46e5, #6769f4) !important;
  box-shadow: 0 14px 26px -18px rgb(79 70 229 / 0.9) !important;
  font-weight: 700;
  transform: none !important;
}

.upos-login-page form button[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338ca, #585af0) !important;
  box-shadow: 0 16px 30px -18px rgb(79 70 229 / 0.95) !important;
}

.upos-login-page form button[type="submit"]:disabled {
  opacity: 0.68;
  cursor: progress;
}

.upos-login-page > .relative.z-10:last-child {
  padding: 0.75rem 1rem 1.25rem;
  color: #64748b;
}

/* Password recovery and branded 404 surfaces */
body[data-upos-route="/forgot-password"] .upos-forgot-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #0f172a;
  background:
    radial-gradient(circle at 16% 12%, rgb(199 210 254 / 0.62), transparent 30%),
    radial-gradient(circle at 86% 82%, rgb(207 250 254 / 0.7), transparent 30%),
    linear-gradient(145deg, #fbfcff, #f2f5fb) !important;
}

body[data-upos-route="/forgot-password"] .upos-forgot-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(79 70 229 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(79 70 229 / 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 86%);
}

body[data-upos-route="/forgot-password"] .upos-forgot-page > * {
  position: relative;
  z-index: 1;
}

body[data-upos-route="/forgot-password"] .upos-forgot-page > .flex-1 {
  padding: 2rem 1rem;
}

body[data-upos-route="/forgot-password"] .upos-forgot-page .max-w-md {
  max-width: 30rem;
  border: 1px solid var(--upos-border);
  border-radius: 1.1rem;
  background: rgb(255 255 255 / 0.96);
  box-shadow: var(--upos-shadow-float) !important;
}

body[data-upos-route="/forgot-password"] .upos-forgot-page .p-6 {
  padding: 2rem;
}

body[data-upos-route="/forgot-password"] .upos-forgot-page input,
body[data-upos-route="/forgot-password"] .upos-forgot-page button[type="submit"] {
  min-height: 3rem;
  border-radius: 0.7rem;
}

body[data-upos-route="/forgot-password"] .upos-forgot-page input {
  background: #fff;
  border-color: #dbe2ea;
}

body[data-upos-route="/forgot-password"] .upos-forgot-page button[type="submit"] {
  font-weight: 700;
  box-shadow: 0 14px 26px -18px rgb(79 70 229 / 0.9);
}

body[data-upos-route="/forgot-password"] .upos-forgot-page > :last-child {
  color: #64748b !important;
}

.upos-not-found {
  background:
    radial-gradient(circle at 18% 12%, rgb(224 231 255 / 0.72), transparent 28%),
    radial-gradient(circle at 84% 84%, rgb(207 250 254 / 0.68), transparent 28%),
    #f8fafc !important;
}

.upos-not-found > .max-w-md {
  width: min(29rem, 100%);
  padding: clamp(2rem, 6vw, 3.25rem);
  border: 1px solid var(--upos-border);
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 0.96);
  box-shadow: var(--upos-shadow-float);
}

.upos-not-found__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  color: #172554;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.upos-not-found__brand img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 22px -12px rgb(79 70 229 / 0.7);
}

.upos-not-found h1 {
  color: #312e81;
  letter-spacing: -0.05em;
}

.upos-not-found a {
  min-height: 2.75rem;
  border-radius: 0.7rem;
  box-shadow: 0 12px 24px -16px rgb(79 70 229 / 0.85);
}

/* Operational alerts */
.upos-alert-button {
  position: relative;
  display: inline-grid;
  width: 2.625rem;
  height: 2.625rem;
  flex: 0 0 auto;
  place-items: center;
  color: #475569;
  background: #fff;
  border: 1px solid var(--upos-border);
  border-radius: 0.7rem;
  box-shadow: var(--upos-shadow-sm);
  transition: color 160ms ease, border-color 160ms ease,
    background-color 160ms ease;
}

.upos-alert-button:hover,
.upos-alert-button[aria-expanded="true"] {
  color: var(--upos-primary-strong);
  background: #f8f8ff;
  border-color: #cfd3ff;
}

.upos-alert-button svg {
  width: 1.125rem;
  height: 1.125rem;
}

.upos-alert-button__badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  display: grid;
  min-width: 1.15rem;
  height: 1.15rem;
  place-items: center;
  padding: 0 0.25rem;
  color: #fff;
  background: var(--upos-danger);
  border: 2px solid #fff;
  border-radius: 999px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.625rem;
  font-weight: 750;
  line-height: 1;
}

.upos-alert-panel {
  position: fixed;
  z-index: 1000;
  top: 4.25rem;
  right: max(0.75rem, env(safe-area-inset-right));
  width: min(24rem, calc(100vw - 1.5rem));
  max-height: min(36rem, calc(100dvh - 5rem));
  overflow: hidden;
  color: var(--upos-ink);
  background: rgb(255 255 255 / 0.98);
  border: 1px solid var(--upos-border);
  border-radius: 1rem;
  box-shadow: var(--upos-shadow-float);
  backdrop-filter: blur(18px) saturate(1.15);
}

.upos-alert-panel[hidden] {
  display: none !important;
}

.upos-alert-panel__header,
.upos-alert-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
}

.upos-alert-panel__header {
  border-bottom: 1px solid var(--upos-border);
}

.upos-alert-panel__title {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 750;
}

.upos-alert-panel__meta {
  margin-top: 0.1rem;
  color: var(--upos-muted);
  font-size: 0.7rem;
}

.upos-alert-panel__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.upos-alert-panel__icon-button {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: #475569;
  border-radius: 0.65rem;
}

.upos-alert-panel__icon-button:hover {
  color: var(--upos-primary-strong);
  background: var(--upos-primary-soft);
}

.upos-alert-panel__icon-button svg {
  width: 1rem;
  height: 1rem;
}

.upos-alert-panel__list {
  max-height: min(27rem, calc(100dvh - 12rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.35rem;
}

.upos-alert-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: start;
  min-height: 4.3rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  transition: background-color 160ms ease;
}

.upos-alert-item:hover {
  background: #f8fafc;
}

.upos-alert-item__icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 0.65rem;
}

.upos-alert-item__icon svg {
  width: 1rem;
  height: 1rem;
}

.upos-alert-item[data-severity="danger"] .upos-alert-item__icon {
  color: var(--upos-danger);
  background: var(--upos-danger-soft);
}

.upos-alert-item[data-severity="warning"] .upos-alert-item__icon {
  color: var(--upos-warning);
  background: var(--upos-warning-soft);
}

.upos-alert-item[data-severity="info"] .upos-alert-item__icon {
  color: var(--upos-primary-strong);
  background: var(--upos-primary-soft);
}

.upos-alert-item__title {
  display: block;
  color: #1e293b;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.45;
}

.upos-alert-item__message {
  display: block;
  margin-top: 0.15rem;
  color: var(--upos-muted);
  font-size: 0.725rem;
  line-height: 1.55;
}

.upos-alert-item__arrow {
  width: 1rem;
  height: 1rem;
  margin-top: 0.45rem;
  color: #94a3b8;
}

.upos-alert-panel__empty,
.upos-alert-panel__loading,
.upos-alert-panel__error {
  display: grid;
  min-height: 11rem;
  place-items: center;
  padding: 1.5rem;
  color: var(--upos-muted);
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.65;
}

.upos-alert-panel__error {
  color: var(--upos-danger);
}

.upos-alert-panel__footer {
  min-height: 3.5rem;
  border-top: 1px solid var(--upos-border);
}

.upos-alert-panel__acknowledge {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.8rem;
  color: var(--upos-primary-strong);
  border-radius: 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.upos-alert-panel__acknowledge:hover {
  background: var(--upos-primary-soft);
}

@media (max-width: 639.98px) {
  .upos-login-page {
    background-image: linear-gradient(180deg, #fff, #f6f8ff 58%, #fff) !important;
  }

  .upos-login-backdrop {
    display: none;
  }

  body[data-upos-route="/forgot-password"] .upos-forgot-page > .flex-1 {
    align-items: flex-start;
    padding-top: 7rem;
  }

  body[data-upos-route="/forgot-password"] .upos-forgot-page .p-6 {
    padding: 1.5rem;
  }

  .upos-not-found > .max-w-md {
    padding: 2rem 1.25rem;
  }

  .upos-login-page > .relative.z-10.flex.justify-end {
    padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem 0;
  }

  .upos-login-page > .relative.z-10.flex-1 {
    align-items: flex-start;
    padding: 0.5rem 1rem 1.5rem;
  }

  .upos-login-page .h-24.w-24 {
    width: 4.75rem;
    height: 4.75rem;
  }

  .upos-login-page .glass-card [class~="p-6"] {
    padding: 1.25rem;
  }

  .upos-login-page form .flex.items-center.justify-between.text-sm {
    gap: 0.5rem;
  }

  header.app-print-shell {
    min-height: 3.5rem;
    height: 3.5rem;
  }

  body[data-upos-route^="/admin/"] main.app-print-main {
    padding: 1rem;
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }

  body[data-upos-route^="/admin/"] main h1 {
    font-size: clamp(1.5rem, 7vw, 1.8rem);
    white-space: normal;
  }

  body[data-upos-route^="/admin/"] main .text-2xl.font-bold {
    max-width: none;
    overflow: visible;
    font-size: clamp(1rem, 4.8vw, 1.25rem);
    line-height: 1.25;
    text-overflow: clip;
    white-space: nowrap;
  }

  body[data-upos-route="/admin/dashboard"] main .shadow-card [class~="p-5"] {
    min-height: 7.4rem;
    padding: 1rem;
  }

  body[data-upos-route="/admin/dashboard"] main .shadow-card .flex.items-start.justify-between.gap-3,
  body[data-upos-route="/admin/subscriptions"] main .shadow-card .flex.items-start.justify-between.gap-3 {
    position: relative;
    display: block;
  }

  body[data-upos-route="/admin/dashboard"] main .shadow-card .flex.items-start.justify-between.gap-3 > .min-w-0,
  body[data-upos-route="/admin/subscriptions"] main .shadow-card .flex.items-start.justify-between.gap-3 > .min-w-0 {
    width: 100%;
    padding-right: 2.8rem;
  }

  body[data-upos-route="/admin/dashboard"] main .shadow-card .flex.items-start.justify-between.gap-3 > :last-child,
  body[data-upos-route="/admin/subscriptions"] main .shadow-card .flex.items-start.justify-between.gap-3 > :last-child {
    position: absolute;
    top: 0;
    right: 0;
  }

  body[data-upos-route="/admin/dashboard"] main .text-2xl.font-bold {
    width: calc(100% + 2.8rem);
    max-width: none;
    font-size: clamp(1.05rem, 5vw, 1.3rem);
    white-space: nowrap;
  }

  body[data-upos-route="/admin/dashboard"] main > div > .mb-6.grid.grid-cols-2.gap-3 > :nth-child(3) .text-2xl.font-bold {
    font-size: clamp(0.95rem, 4.3vw, 1.1rem);
    letter-spacing: -0.045em;
  }

  body[data-upos-route="/admin/subscriptions"] main .shadow-card .text-2xl.font-bold {
    width: calc(100% + 2.8rem);
    font-size: clamp(0.95rem, 4.3vw, 1.1rem);
    letter-spacing: -0.04em;
  }

  body[data-upos-route="/admin/dashboard"] main .border-dashed {
    min-height: 15rem;
  }

  nav.no-print.fixed.inset-x-0.bottom-0 {
    padding-bottom: env(safe-area-inset-bottom);
    background: rgb(255 255 255 / 0.97);
    box-shadow: 0 -12px 30px -24px rgb(15 23 42 / 0.52);
    backdrop-filter: blur(18px) saturate(1.2);
  }

  nav.no-print.fixed.inset-x-0.bottom-0 a,
  nav.no-print.fixed.inset-x-0.bottom-0 button {
    min-height: 4rem;
  }

  .upos-scroll-hint {
    display: flex;
    min-height: 2.25rem;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    color: #475569;
    background: linear-gradient(90deg, #f8f9ff, #fff);
    border-top: 1px solid var(--upos-border);
    border-bottom: 1px solid var(--upos-border);
    font-size: 0.7rem;
    font-weight: 600;
    transition: opacity 180ms ease, max-height 180ms ease, padding 180ms ease;
  }

  .upos-scroll-hint svg {
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 auto;
    color: var(--upos-primary-strong);
    animation: upos-horizontal-cue 1.5s ease-in-out infinite;
  }

  .upos-scroll-hint.is-hidden {
    max-height: 0;
    min-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
  }

  .upos-scroll-shell {
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #c7ccff transparent;
    -webkit-overflow-scrolling: touch;
  }

  .upos-alert-button {
    width: 2.5rem;
    height: 2.5rem;
  }

  .upos-alert-panel {
    top: 3.85rem;
    right: 0.5rem;
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 4.4rem - env(safe-area-inset-bottom));
  }
}

@keyframes upos-horizontal-cue {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(0.25rem);
  }
}

@media (min-width: 640px) and (max-width: 1023.98px) {
  body[data-upos-route^="/admin/"] main.app-print-main {
    padding: 1.25rem;
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .upos-login-page *,
  .upos-alert-panel *,
  .upos-scroll-hint svg,
  .upos-recent-store-row,
  aside.app-print-shell nav a,
  aside.app-print-shell nav button {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .upos-alert-button,
  .upos-alert-panel {
    display: none !important;
  }
}
