/*
 * VRP Catalog shared application design system.
 * Loaded after legacy page styles and scoped to the staff/customer shells so
 * existing behavior remains intact while every route shares one visual language.
 */

:root {
  --bg: #f3f6fa;
  --card: #ffffff;
  --text: #142033;
  --muted: #64748b;
  --border: #dce4ee;
  --dark: #132238;
  --dark-soft: #203653;
  --gold: #b58a39;
  --gold-soft: #fbf3df;
  --danger: #c2414f;
  --danger-soft: #fff0f2;
  --success: #15805e;
  --success-soft: #e9f8f2;
  --warning: #b56918;
  --warning-soft: #fff6e5;
  --info: #2668c9;
  --info-soft: #edf4ff;
  --primary: #2563a9;
  --primary-strong: #174a82;
  --primary-soft: #eaf3ff;
  --ring: rgba(37, 99, 169, 0.22);
  --shadow-sm: 0 1px 2px rgba(20, 32, 51, 0.05), 0 5px 16px rgba(20, 32, 51, 0.05);
  --shadow: 0 14px 38px rgba(20, 32, 51, 0.09);
  --shadow-lg: 0 24px 70px rgba(20, 32, 51, 0.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --content: 1500px;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body.staff-portal,
body.customer-portal,
body:has(.mobile-weight-page) {
  min-height: 100vh;
  background:
    radial-gradient(circle at 6% -8%, rgba(84, 139, 200, 0.13), transparent 30rem),
    radial-gradient(circle at 94% 4%, rgba(181, 138, 57, 0.10), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.006em;
}

body.staff-portal::before,
body.customer-portal::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(36, 74, 116, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 74, 116, 0.022) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 65%);
}

::selection {
  background: #cfe3fb;
  color: #102138;
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 72px;
  padding: 10px clamp(16px, 3vw, 40px);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  background: rgba(15, 30, 49, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 34px rgba(7, 19, 34, 0.19);
  backdrop-filter: blur(18px) saturate(145%);
}

.app-brand,
.app-brand:visited {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.app-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  color: #ffe4a7;
  background: linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.app-brand-copy {
  display: grid;
  line-height: 1.15;
}

.app-brand-copy strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.app-brand-copy small {
  margin-top: 3px;
  color: #aebdd0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.app-nav > a,
.app-nav-menu > summary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #d6e0ec;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.app-nav > a:hover,
.app-nav-menu > summary:hover,
.app-nav > a.active,
.app-nav-menu.active > summary,
.app-nav-menu[open] > summary {
  color: #fff;
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.10);
}

.app-nav > a.active,
.app-nav-menu.active > summary {
  box-shadow: inset 0 -2px 0 #e6bd65;
}

.app-nav > .app-nav-logout {
  margin-left: 6px;
  color: #ffe4a7;
  border-color: rgba(230, 189, 101, 0.28);
}

.app-nav-menu {
  position: relative;
}

.app-nav-menu > summary {
  list-style: none;
}

.app-nav-menu > summary::-webkit-details-marker {
  display: none;
}

.app-nav-menu > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.app-nav-menu[open] > summary::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.app-nav-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  min-width: 210px;
  padding: 8px;
  display: grid;
  gap: 3px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(18, 34, 54, 0.985);
  box-shadow: var(--shadow-lg);
}

.app-nav-menu-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
  border-left: 1px solid rgba(255,255,255,.12);
  background: #122236;
  transform: rotate(45deg);
}

.app-nav-menu-panel a {
  position: relative;
  z-index: 1;
  padding: 10px 12px;
  border-radius: 9px;
  color: #d6e0ec;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.app-nav-menu-panel a:hover,
.app-nav-menu-panel a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.app-nav-menu-panel a.active::before {
  content: "";
  width: 5px;
  height: 5px;
  display: inline-block;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: #e6bd65;
}

.app-nav-toggle {
  display: none;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  color: #fff;
  background: rgba(255,255,255,.08);
  font-size: 13px;
}

.app-shell,
.customer-main {
  width: min(100%, var(--content));
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: clamp(22px, 3vw, 42px);
}

.customer-main {
  max-width: none;
}

.app-shell h1,
.customer-main h1 {
  color: #132238;
  font-weight: 820;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.app-shell h2,
.app-shell h3,
.customer-main h2,
.customer-main h3 {
  color: #1b2d45;
  font-weight: 780;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.app-shell > h1,
.app-shell .catalog-title {
  margin-top: 0;
  font-size: clamp(30px, 3vw, 42px);
}

.app-shell a,
.customer-main a {
  text-underline-offset: 3px;
}

.app-shell button,
.app-shell .button,
.app-shell .btn,
.app-shell .simple-btn,
.app-shell input[type="submit"],
.customer-main button,
.customer-main .button,
.customer-main .btn {
  min-height: 42px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 750;
  box-shadow: none;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease;
}

.app-shell button:hover:not(:disabled),
.app-shell .button:hover,
.app-shell .btn:hover,
.customer-main button:hover:not(:disabled),
.customer-main .button:hover,
.customer-main .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(20, 32, 51, 0.12);
}

.app-shell button:active:not(:disabled),
.app-shell .button:active,
.customer-main button:active:not(:disabled) {
  transform: translateY(0);
}

.app-shell button:disabled,
.customer-main button:disabled,
.app-shell [aria-disabled="true"],
.customer-main [aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
}

.app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
.app-shell select,
.app-shell textarea,
.customer-main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
.customer-main select,
.customer-main textarea {
  min-height: 42px;
  border: 1px solid #ccd7e5;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #fff;
  font-family: inherit;
  box-shadow: inset 0 1px 2px rgba(20, 32, 51, 0.025);
  transition: border-color .14s ease, box-shadow .14s ease;
}

.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus,
.customer-main input:focus,
.customer-main select:focus,
.customer-main textarea:focus {
  border-color: #6f9bd0;
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.app-shell label,
.customer-main label {
  color: #40536b;
  font-weight: 700;
}

.app-shell table,
.customer-main table {
  border-collapse: separate;
  border-spacing: 0;
}

.app-shell table th,
.customer-main table th {
  color: #52657d;
  background: #f6f8fb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.app-shell table td,
.app-shell table th,
.customer-main table td,
.customer-main table th {
  border-bottom-color: #e6ecf3;
}

.app-shell table tbody tr,
.customer-main table tbody tr {
  transition: background-color .14s ease;
}

.app-shell table tbody tr:hover,
.customer-main table tbody tr:hover {
  background: #f8fafd;
}

.app-shell dialog,
.app-shell [class*="modal-content"],
.app-shell [class*="-modal"] > [class*="panel"],
.customer-main dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.app-shell [class*="badge"],
.app-shell [class*="status"],
.customer-main [class*="badge"],
.customer-main [class*="status"] {
  font-weight: 750;
}

.app-shell [class*="empty"],
.customer-main [class*="empty"] {
  border-radius: var(--radius);
}

form[aria-busy="true"] {
  cursor: progress;
}

.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 17px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: app-spin .7s linear infinite;
}

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

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

/* Home */
.app-shell .hero {
  min-height: min(66vh, 640px);
  padding: clamp(52px, 8vw, 112px) clamp(24px, 8vw, 100px);
  display: grid;
  place-content: center;
  border: 1px solid rgba(122, 145, 172, .25);
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(54, 118, 184, .17), transparent 30%),
    radial-gradient(circle at 85% 75%, rgba(196, 149, 66, .18), transparent 33%),
    linear-gradient(145deg, #fff, #f7faff);
  box-shadow: var(--shadow);
}

.app-shell .hero::before {
  content: "VRP";
  margin: 0 auto 22px;
  padding: 7px 12px;
  border: 1px solid #cad9e9;
  border-radius: 999px;
  color: var(--primary-strong);
  background: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
}

.app-shell .hero h1 {
  max-width: 780px;
  margin: 0 auto 14px;
  font-size: clamp(40px, 6vw, 74px);
}

.app-shell .hero p {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
}

.app-shell .hero .button {
  min-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 5px;
  padding: 12px 20px !important;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  text-decoration: none;
}

.app-shell .hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.app-shell .hero .button-secondary {
  background: linear-gradient(135deg, #1d2d42, #111d2d);
}

/* Admin hubs and reporting pages */
.app-shell .admin-page,
.app-shell .quotes-page,
.app-shell .quote-detail-page,
.app-shell .activity-page,
.app-shell .lookup-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 4px 0 60px;
}

.app-shell .admin-page > h1,
.app-shell .quotes-page > h1,
.app-shell .activity-page > h1,
.app-shell .lookup-page > h1 {
  margin: 0 0 7px;
  font-size: clamp(31px, 3vw, 42px);
}

.app-shell .admin-page > p,
.app-shell .quotes-page > p,
.app-shell .activity-page > p,
.app-shell .lookup-page > p {
  max-width: 680px;
  margin: 0 0 28px;
  color: var(--muted);
}

.app-shell .admin-grid {
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

.app-shell .admin-card {
  min-height: 176px;
  padding: 22px;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
}

.app-shell .admin-card:hover {
  border-color: #aec6e0;
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.app-shell .admin-card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 7px;
  border-radius: 12px;
  background: var(--primary-soft);
  font-size: 22px;
}

.app-shell .admin-card-title {
  color: #182b43;
  font-size: 17px;
}

.app-shell .admin-card-desc {
  color: var(--muted);
  line-height: 1.48;
}

.app-shell .quotes-section,
.app-shell .quote-section,
.app-shell .activity-section,
.app-shell .lookup-result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
}

.app-shell .quotes-filter-bar,
.app-shell .lookup-form {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-sm);
}

/* Catalog */
.app-shell .filter-bar {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.app-shell .vendor-dark {
  background: linear-gradient(145deg, #9f2d34, #c34047);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

.app-shell .product-card,
.app-shell .category-card,
.app-shell .account-card,
.app-shell .order-card {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.app-shell .product-card:hover,
.app-shell .category-card:hover,
.app-shell .order-card:hover {
  border-color: #b8cbe0;
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.app-shell .product-image-wrap,
.app-shell .category-image-wrap {
  background: linear-gradient(150deg, #f7f9fc, #edf2f7);
}

.app-shell .pagination a,
.app-shell .pagination span {
  border-radius: 10px;
}

/* Ideas Board */
.app-shell .ib-shell {
  max-width: 1320px;
}

.app-shell .ib-hero {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 82% 15%, rgba(218, 175, 89, .20), transparent 30%),
    linear-gradient(145deg, #132944, #1c4770);
  box-shadow: var(--shadow);
}

.app-shell .ib-hero h1 {
  color: #fff;
}

.app-shell .ib-hero h1 {
  color: #fff;
}

.app-shell .ib-hero p {
  color: #d7e5f4;
}

.app-shell .ib-hero .ib-eyebrow {
  color: #9fc9f7;
}

.app-shell .ib-stats,
.app-shell .ib-toolbar,
.app-shell .ib-card {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.app-shell .ib-card:hover {
  border-color: #b8cbe0;
  box-shadow: var(--shadow);
}

/* Designers */
.app-shell .dh {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0;
}

.app-shell .dh-head {
  align-items: center;
  margin: 0 0 20px;
}

.app-shell .dh-head h1 {
  font-size: clamp(31px, 3vw, 42px);
}

.app-shell .dh-head > a {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--primary-strong);
  background: #fff;
  text-decoration: none;
  font-weight: 750;
}

.app-shell .dh-tabs {
  gap: 4px;
  padding: 6px 6px 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #f6f8fb;
}

.app-shell .dh-tabs button {
  color: var(--muted);
  border-radius: 9px 9px 0 0;
}

.app-shell .dh-tabs button.active {
  color: var(--primary-strong);
  border-color: var(--primary);
  background: #fff;
}

.app-shell .dh-frame {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.app-shell .template-controls,
.app-shell .field-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

/* Inventory and weight scanner */
.app-shell .inventory-page,
.app-shell .weight-page {
  max-width: 1440px;
}

.app-shell .inventory-header,
.app-shell .weight-header,
.app-shell .simple-header,
.app-shell .repair-header {
  margin-bottom: 22px;
  align-items: center;
}

.app-shell .inventory-header h1,
.app-shell .weight-header h1,
.app-shell .simple-header h1,
.app-shell .repair-header h1 {
  margin: 0;
  font-size: clamp(30px, 3vw, 42px);
}

.app-shell .batch-panel,
.app-shell .inventory-panel,
.app-shell .scan-panel,
.app-shell .summary-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
}

.app-shell .item-box,
.app-shell .count-item {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.app-shell .btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.app-shell .btn.danger {
  background: linear-gradient(135deg, #cf4d58, #a92e3a);
}

/* Repairs and orders */
.app-shell .simple-page,
.app-shell .repair-page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.app-shell .simple-filters,
.app-shell .repair-filters,
.app-shell .repair-search {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
}

.app-shell .simple-card,
.app-shell .repair-card,
.app-shell .repair-line {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.app-shell .simple-card:hover,
.app-shell .repair-card:hover {
  box-shadow: var(--shadow);
}

.app-shell .simple-card.status-0,
.app-shell .repair-line.status-0 {
  border-left: 4px solid #8090a3;
}

.app-shell .simple-card.status-1,
.app-shell .repair-line.status-1 {
  border-left: 4px solid var(--info);
}

.app-shell .simple-card.status-2,
.app-shell .repair-line.status-2 {
  border-left: 4px solid var(--warning);
}

.app-shell .simple-card.status-3,
.app-shell .repair-line.status-3,
.app-shell .simple-card.ready-card {
  border-left: 4px solid var(--success);
  background: linear-gradient(90deg, var(--success-soft), #fff 18%);
}

.app-shell .simple-card.status-4,
.app-shell .repair-line.status-4,
.app-shell .simple-card.simple-closed {
  border-left: 4px solid #8794a5;
  background: #f4f6f8;
}

/* Customer portal and shop */
.customer-portal .app-header {
  background: rgba(18, 36, 57, 0.95);
}

.customer-portal .app-nav .shop-nav-account-dot {
  background: #4cd3a1;
  box-shadow: 0 0 0 4px rgba(76, 211, 161, .12);
}

.customer-portal .app-nav .shop-cart-link {
  color: #ffe4a7;
  border-color: rgba(230, 189, 101, .28);
}

.customer-portal .shop-cart-badge {
  color: #152337;
  background: #f0c973;
}

.customer-portal .shop-wrap {
  max-width: 1260px;
  padding: 0;
}

.customer-portal .shop-h1 {
  font-size: clamp(30px, 3.5vw, 46px);
}

.customer-portal .shop-filter-bar,
.customer-portal .shop-checkout-card,
.customer-portal .portal-card,
.customer-portal .portal-login-card,
.customer-portal .portal-receipt-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow-sm);
}

.customer-portal .shop-product-card,
.customer-portal .shop-category-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.customer-portal .shop-product-card:hover,
.customer-portal .shop-category-card:hover {
  border-color: #b8cbe0;
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.customer-portal .shop-product-image-wrap,
.customer-portal .shop-detail-image {
  background: linear-gradient(150deg, #f8fafc, #edf2f7);
}

.customer-portal .shop-btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.customer-portal .shop-btn--gold {
  color: #2e240f;
  background: linear-gradient(135deg, #e4bd69, #c89a42);
}

.customer-portal .shop-empty-state {
  padding: clamp(38px, 7vw, 76px) 24px;
  border: 1px dashed #b9c8d8;
  background: rgba(255,255,255,.7);
}

.customer-portal .shop-cart-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.customer-portal .portal-error,
.customer-portal .shop-flag--danger {
  color: #9f2633;
  border-color: #f1c4ca;
  background: var(--danger-soft);
}

.customer-portal .portal-success,
.customer-portal .shop-stock-good {
  color: #0c6d4e;
}

/* Standalone handheld scanner */
body:has(.mobile-weight-page) .mobile-topbar {
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(15, 30, 49, .96);
  box-shadow: 0 8px 28px rgba(7,19,34,.2);
  backdrop-filter: blur(16px);
}

body:has(.mobile-weight-page) .mobile-weight-page {
  background: transparent;
}

body:has(.mobile-weight-page) .batch-panel,
body:has(.mobile-weight-page) .scan-panel,
body:has(.mobile-weight-page) .item-box {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

body.designer-embed {
  min-height: 100vh;
  margin: 0;
  padding: clamp(18px, 3vw, 34px);
  background:
    radial-gradient(circle at 8% -10%, rgba(84, 139, 200, .12), transparent 26rem),
    #f5f7fa;
}

body.designer-embed > main {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

@media (max-width: 1060px) {
  .app-header {
    gap: 12px;
  }

  .app-brand-copy small {
    display: none;
  }

  .app-nav > a,
  .app-nav-menu > summary {
    padding-inline: 10px;
  }
}

@media (max-width: 840px) {
  .app-header {
    min-height: 66px;
    padding: 9px 15px;
  }

  .app-brand-mark {
    width: 38px;
    height: 38px;
  }

  .app-nav-toggle {
    display: inline-flex;
  }

  .app-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    left: 12px;
    max-height: calc(100vh - 86px);
    padding: 10px;
    display: none;
    overflow-y: auto;
    align-items: stretch;
    justify-content: stretch;
    grid-template-columns: minmax(0, 1fr);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: var(--radius);
    background: rgba(17, 33, 53, .985);
    box-shadow: var(--shadow-lg);
  }

  .app-nav.is-open {
    display: grid;
  }

  .app-nav > a,
  .app-nav-menu > summary {
    width: 100%;
    justify-content: flex-start;
    padding: 12px;
  }

  .app-nav > .app-nav-logout {
    margin: 4px 0 0;
  }

  .app-nav-menu-panel {
    position: static;
    min-width: 0;
    margin: 3px 0 5px 10px;
    padding: 4px 4px 4px 10px;
    transform: none;
    border: 0;
    border-left: 1px solid rgba(255,255,255,.14);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .app-nav-menu-panel::before {
    display: none;
  }

  .app-shell,
  .customer-main {
    min-height: calc(100vh - 66px);
    padding: 22px 16px 34px;
  }

  .app-shell .filter-top-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell .big-search-icon {
    width: 100%;
  }

  .app-shell .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell .dh-frame {
    height: calc(100vh - 210px);
    min-height: 520px;
  }
}

@media (max-width: 600px) {
  .app-brand-copy strong {
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell,
  .customer-main {
    padding: 18px 12px 30px;
  }

  .app-shell > h1,
  .app-shell .catalog-title,
  .app-shell .admin-page > h1,
  .app-shell .weight-header h1,
  .app-shell .inventory-header h1,
  .app-shell .repair-header h1,
  .app-shell .simple-header h1 {
    font-size: 29px;
  }

  .app-shell .hero {
    min-height: 62vh;
    border-radius: 20px;
  }

  .app-shell .hero h1 {
    font-size: 38px;
  }

  .app-shell .hero .button {
    width: 100%;
    margin: 5px 0 !important;
  }

  .app-shell .hero-actions {
    width: 100%;
  }

  .app-shell .admin-grid {
    grid-template-columns: 1fr;
  }

  .app-shell .admin-card {
    min-height: 0;
  }

  .app-shell .quotes-filter-bar,
  .app-shell .lookup-form,
  .app-shell .simple-filters,
  .app-shell .repair-filters {
    flex-direction: column;
  }

  .app-shell .dh-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell .dh-tabs {
    overflow-x: auto;
  }

  .app-shell .dh-tabs button {
    min-width: max-content;
  }

  .app-shell .filter-top-row {
    grid-template-columns: 1fr;
  }

  .app-shell .tag-print-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell .tag-print-row input {
    width: 100%;
    box-sizing: border-box;
  }

  .app-shell .repair-line {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .app-shell .repair-photo-panel,
  .app-shell .repair-photos-wrap {
    width: 100%;
    max-width: 100%;
  }

  .app-shell .main-repair-photo,
  .app-shell .no-photo-box,
  .app-shell .line-photo,
  .app-shell .photo-thumb {
    max-width: 100%;
  }

  .customer-portal .shop-cart-table {
    display: block;
    overflow-x: auto;
  }
}
