:root {
  --focus-ring: #2563eb;
}

html {
  min-width: 320px;
}

body {
  min-width: 320px;
}

button,
[role="button"],
a,
input,
select,
textarea {
  outline-offset: 3px;
}

:where(button, [role="button"], a, input, select, textarea):focus-visible {
  outline: 3px solid #60a5fa;
  outline-color: color-mix(in srgb, var(--focus-ring) 72%, white);
}

.skip-to-content {
  position: fixed;
  z-index: 2000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .15s ease;
}

.skip-to-content:focus {
  transform: translateY(0);
}

.app-shell {
  width: 100%;
  min-width: 0;
  background: #f6f8fc;
}

.sidebar-backdrop {
  position: fixed;
  z-index: 999;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, .48);
}

.login-page {
  min-height: 100dvh !important;
  height: auto !important;
  overflow: auto !important;
}

.login-page .hint {
  color: #64748b !important;
}

.dashboard-page__stats.is-loading .dashboard-page__stat small,
.dashboard-page__stats.is-loading .dashboard-page__stat strong {
  color: transparent !important;
  border-radius: 5px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
  background-size: 200% 100%;
  animation: ui-skeleton 1.2s linear infinite;
}

.dashboard-page__stats.is-loading .dashboard-page__stat small {
  width: 58%;
}

.dashboard-page__stats.is-loading .dashboard-page__stat strong {
  width: 74%;
}

.order-surface-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@keyframes ui-skeleton {
  to { background-position: -200% 0; }
}

@media (max-width: 900px) {
  .app-shell {
    display: block !important;
  }

  .app-shell > .sidebar {
    position: fixed !important;
    z-index: 1000;
    inset: 0 auto 0 0;
    width: min(82vw, 288px) !important;
    height: 100dvh;
    box-shadow: 18px 0 48px rgba(15, 23, 42, .26);
    transition: transform .2s ease;
  }

  .app-shell > .sidebar.is-collapsed {
    width: 0 !important;
    overflow: hidden;
    border: 0;
    transform: translateX(-100%);
  }

  .app-shell > .el-container {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    padding: 0 12px;
  }

  .main-content {
    min-width: 0;
    padding: 12px !important;
  }

  .user-label {
    display: none;
  }

  .dashboard-page__quick-grid,
  .dashboard-page__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .order-surface-heading,
  .order-surface-error {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .login-card {
    width: calc(100% - 28px) !important;
    padding: 28px 22px !important;
  }

  .dashboard-page__quick-grid,
  .dashboard-page__stats {
    grid-template-columns: 1fr !important;
  }
}

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