:root {
  color-scheme: light;
  --ink: #141413;
  --muted: #74716a;
  --line: #e7e1d6;
  --paper: #eef6ff;
  --panel: #ffffff;
  --charcoal: #1f2421;
  --copper: #b55f34;
  --green: #2f7d5c;
  --blue: #315c9c;
  --gold: #d6a238;
  --danger: #ba443c;
  --shadow: 0 24px 70px rgba(31, 36, 33, 0.12);
  --home-width: 1040px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.ai-float-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.ai-rail {
  position: absolute;
  top: 96px;
  bottom: 32px;
  width: calc((100vw - var(--home-width)) / 2 - 18px);
  overflow: hidden;
}

.ai-rail-left {
  left: 12px;
}

.ai-rail-right {
  right: 12px;
}

.ai-badge {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(52px, 4.2vw, 62px);
  height: clamp(52px, 4.2vw, 62px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  color: rgba(31, 36, 33, 0.72);
  box-shadow: 0 18px 50px rgba(49, 92, 156, 0.12);
  backdrop-filter: blur(16px) saturate(1.25);
  font-size: 12px;
  font-weight: 900;
  user-select: none;
  will-change: transform;
}

.ai-badge::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: -1;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(125, 196, 255, 0.34), rgba(255, 214, 134, 0.24));
}

.ai-badge img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.ai-badge b {
  display: none;
  font-size: 11px;
}

.ai-badge img:not([src]),
.ai-badge img[style*="display: none"] + b {
  display: block;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 34px;
  height: 100vh;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, var(--charcoal), #3b463e);
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(31, 36, 33, 0.22);
}

.brand strong,
.brand small {
  display: block;
  text-align: left;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--ink);
  background: #f0eadf;
}

.nav-list a:hover {
  transform: translateX(2px);
}

.nav-list svg,
.top-actions svg,
.tool-row svg,
.order-lookup svg,
.pay-btn svg {
  width: 18px;
  height: 18px;
}

.status-panel {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--charcoal);
  color: #fff;
}

.status-panel div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-panel p,
.status-panel small {
  margin: 0;
}

.status-panel p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.status-panel strong {
  display: block;
  margin: 14px 0 4px;
  font-size: 34px;
  line-height: 1;
}

.status-panel small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7ee2a5;
  box-shadow: 0 0 0 7px rgba(126, 226, 165, 0.18);
}

.workspace {
  width: min(var(--home-width), calc(100% - 48px));
  min-width: 0;
  margin: 0 auto;
  padding: 28px 0;
}

.header-brand {
  max-width: min(680px, 100%);
}

.header-brand-wrap {
  display: grid;
  gap: 8px;
}

.header-brand .brand-mark {
  width: 52px;
  height: 52px;
}

.header-brand strong {
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0;
}

.topbar,
.tool-row,
.order-lookup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: -28px 0 0;
  padding: 18px 0;
  border-bottom: 1px solid rgba(231, 225, 214, 0.8);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: 0 10px 30px rgba(31, 36, 33, 0.06);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 50%;
  z-index: -1;
  margin-inline: -50vw;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(22px) saturate(1.35);
  border-bottom: 1px solid rgba(231, 225, 214, 0.8);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 0.98;
  font-weight: 900;
}

.title-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.title-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(46px, 5vw, 64px);
  height: clamp(46px, 5vw, 64px);
  border: 1px solid rgba(214, 162, 56, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 30px rgba(31, 36, 33, 0.09);
}

.title-icon svg {
  width: 66%;
  height: 66%;
  fill: none;
  stroke: var(--charcoal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title-icon svg path:first-child {
  fill: rgba(214, 162, 56, 0.84);
  stroke: var(--charcoal);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
  font-weight: 900;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.ghost-btn,
.primary-btn,
.order-lookup button,
.pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
}

.icon-btn {
  position: relative;
  width: 44px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 36, 33, 0.08);
}

.dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--danger);
}

.ghost-btn {
  padding: 0 16px;
  color: var(--green);
  background: rgba(47, 125, 92, 0.1);
}

.lookup-link {
  position: relative;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lookup-link:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 125, 92, 0.36);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(31, 36, 33, 0.1), 0 0 0 4px rgba(47, 125, 92, 0.08);
}

.lookup-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(47, 125, 92, 0.12);
}

.lookup-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-band {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
  margin: 30px 0 22px;
  padding: 28px;
  border: 1px solid rgba(31, 36, 33, 0.08);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 20%, rgba(125, 196, 255, 0.58), transparent 34%),
    radial-gradient(circle at 82% 24%, rgba(255, 214, 134, 0.5), transparent 32%),
    radial-gradient(circle at 58% 88%, rgba(142, 224, 187, 0.45), transparent 38%),
    linear-gradient(135deg, #f8fbff, #eaf5ff 46%, #fff7e8);
  background-position: center;
  background-size: cover;
  color: var(--ink);
  overflow: hidden;
  min-height: 250px;
}

.hero-copy {
  align-self: end;
}

.hero-copy p {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--green);
  font-size: 13px;
}

.hero-copy h2 {
  max-width: 720px;
  color: var(--ink);
}

.notice-board ul {
  display: grid;
  gap: 9px;
  max-width: 720px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.notice-board li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.notice-board li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-self: end;
}

.metric-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(16px);
}

.metric-grid span,
.metric-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-grid strong {
  display: block;
  margin: 7px 0 4px;
  font-size: clamp(22px, 2vw, 31px);
  line-height: 1;
  color: var(--ink);
}

.online-label {
  display: flex !important;
  align-items: center;
  gap: 7px;
}

.online-label i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7ee2a5;
  box-shadow: 0 0 0 6px rgba(126, 226, 165, 0.18);
}

.tool-row {
  margin-bottom: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  flex: 1;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.segments {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.segments button {
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
}

.segments button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 36, 33, 0.08);
}

.primary-btn {
  min-width: 124px;
  padding: 0 14px;
  color: #fff;
  background: var(--charcoal);
}

.primary-btn b {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--charcoal);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 286px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 40px rgba(31, 36, 33, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 125, 92, 0.3);
  box-shadow: var(--shadow);
}

.product-card {
  cursor: pointer;
}

.product-art {
  position: relative;
  aspect-ratio: 3 / 2;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--art);
  color: #fff;
}

.product-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-art.has-image,
.modal-art.has-image {
  background: #dcecff;
}

.product-art.has-image::after,
.modal-art.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20, 20, 19, 0.05), rgba(20, 20, 19, 0.36));
}

.product-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(135deg, #000, transparent 72%);
}

.product-art b {
  position: absolute;
  z-index: 3;
  left: 14px;
  bottom: 12px;
  font-size: 23px;
  line-height: 1;
}

.product-art span {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.product-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.product-title h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.28;
}

.tag {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(49, 92, 156, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.product-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.product-meta strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.price {
  font-size: 26px;
  font-weight: 900;
}

.buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
}

.checkout-panel {
  position: sticky;
  top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 50px rgba(31, 36, 33, 0.08);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.panel-head strong {
  margin-right: auto;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.selected-product {
  display: grid;
  gap: 12px;
  min-height: 132px;
  padding: 16px;
  border: 1px dashed #d6cdbf;
  border-radius: 8px;
  background: #fbf7ef;
}

.selected-product.active {
  border-style: solid;
  background: linear-gradient(145deg, #232922, #465044);
  color: #fff;
}

.selected-product p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.selected-product.active p {
  color: rgba(255, 255, 255, 0.66);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #fff;
  color: var(--green);
}

.order-form {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.order-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.order-form input,
.order-form select,
.order-lookup input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.order-form input:focus,
.order-form select:focus,
.order-lookup input:focus,
.search-box:focus-within {
  border-color: rgba(47, 125, 92, 0.58);
  box-shadow: 0 0 0 4px rgba(47, 125, 92, 0.1);
}

.pay-btn {
  width: 100%;
  margin-top: 6px;
  min-height: 50px;
  color: #fff;
  background: var(--copper);
}

.order-lookup {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.order-lookup form {
  display: flex;
  flex: 1;
  max-width: 580px;
  gap: 10px;
}

.order-lookup button {
  min-width: 110px;
  padding: 0 16px;
  color: #fff;
  background: var(--blue);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  transform: translateY(20px);
  max-width: min(360px, calc(100vw - 48px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.hidden {
  display: none !important;
}

.empty-state,
.delivery-result,
.lookup-results,
.admin-panel,
.admin-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.empty-state {
  padding: 22px;
  color: var(--muted);
}

.delivery-result,
.lookup-results {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding: 22px;
}

.muted-line {
  margin: 8px 0 0;
  color: var(--muted);
}

.code-list {
  display: grid;
  gap: 8px;
}

.code-list code {
  display: block;
  overflow-wrap: anywhere;
  padding: 11px 12px;
  border-radius: 8px;
  background: #1f2421;
  color: #f8f0dc;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.payment-note {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background: #1f2421;
  color: #fff;
}

.payment-note span {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.order-card:last-child {
  border-bottom: 0;
}

.order-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.order-card .code-list {
  grid-column: 1 / -1;
}

.buy-btn:disabled {
  cursor: not-allowed;
  background: #a5a199;
}

.admin-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(125, 196, 255, 0.24), transparent 34vw),
    linear-gradient(180deg, #eef6ff 0%, #f7fbff 46%, #eef6ff 100%);
}

.admin-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 14px max(28px, calc((100vw - 1280px) / 2 + 28px));
  border-bottom: 1px solid rgba(231, 225, 214, 0.86);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(22px) saturate(1.25);
}

.admin-main {
  display: grid;
  gap: 20px;
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  background:
    linear-gradient(105deg, rgba(31, 36, 33, 0.93), rgba(49, 92, 156, 0.66)),
    url("https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
  box-shadow: 0 24px 70px rgba(49, 92, 156, 0.16);
}

.admin-hero .eyebrow,
.admin-hero h1 {
  color: #fff;
}

.admin-hero h1 {
  max-width: 460px;
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.06;
}

.admin-hero .metric-grid {
  align-self: stretch;
}

.admin-workbench,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.admin-panel {
  min-width: 0;
  padding: 18px;
  border-color: rgba(205, 218, 230, 0.9);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 44px rgba(49, 92, 156, 0.08);
  backdrop-filter: blur(16px);
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-form label:has(textarea),
.admin-form .switch-line,
.admin-form .pay-btn {
  grid-column: 1 / -1;
}

.admin-workbench .admin-stack:first-child .admin-form {
  grid-template-columns: 1fr;
}

.admin-workbench .admin-stack:first-child .admin-form label,
.admin-workbench .admin-stack:first-child .admin-form .switch-line,
.admin-workbench .admin-stack:first-child .admin-form .pay-btn {
  grid-column: 1;
}

.admin-form select,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(31, 36, 33, 0.03);
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: rgba(49, 92, 156, 0.46);
  box-shadow: 0 0 0 4px rgba(49, 92, 156, 0.1);
}

.admin-list {
  display: grid;
  gap: 11px;
}

.inventory-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: start;
}

.inventory-import {
  position: sticky;
  top: 96px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(223, 231, 239, 0.95);
  border-radius: 8px;
  background: #f7fbff;
}

.compact-head {
  margin-bottom: 12px;
}

.inventory-import .admin-form {
  grid-template-columns: 1fr;
}

.inventory-import .admin-form label,
.inventory-import .admin-form .pay-btn {
  grid-column: 1;
}

.admin-list-row {
  display: grid;
  grid-template-columns: auto 76px minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(223, 231, 239, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(49, 92, 156, 0.06);
}

.draggable-row {
  cursor: grab;
}

.draggable-row.dragging {
  opacity: 0.58;
  border-color: rgba(47, 125, 92, 0.55);
  box-shadow: 0 12px 30px rgba(31, 36, 33, 0.12);
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 48px;
  border: 1px solid rgba(223, 231, 239, 0.95);
  border-radius: 8px;
  background: #f7fbff;
  color: var(--muted);
  cursor: grab;
  font-weight: 900;
  line-height: 1;
}

.admin-product-thumb {
  position: relative;
  aspect-ratio: 3 / 2;
  width: 76px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--art);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.admin-product-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 18px 18px;
}

.admin-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-product-thumb.has-image::after {
  display: none;
}

.admin-product-thumb span {
  position: absolute;
  right: 8px;
  bottom: 7px;
  z-index: 1;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.admin-list-row strong,
.admin-list-row span {
  display: block;
}

.admin-list-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-list-row b {
  white-space: nowrap;
  color: var(--green);
  font-size: 15px;
}

.admin-product-info {
  min-width: 0;
}

.admin-product-info strong,
.table-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.orders-table {
  overflow-x: auto;
  border: 1px solid rgba(223, 231, 239, 0.95);
  border-radius: 8px;
  background: #fff;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) minmax(150px, 0.72fr) 100px 104px 112px;
  min-width: 900px;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
}

.table-head {
  background: #f7fbff;
  color: #6f8499;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-row {
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.table-row:hover {
  background: #fbfdff;
}

.table-row b {
  color: var(--ink);
}

.admin-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(49, 92, 156, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.admin-status.online,
.admin-status.delivered {
  background: rgba(47, 125, 92, 0.12);
  color: var(--green);
}

.admin-status.offline,
.admin-status.failed {
  background: rgba(186, 68, 60, 0.12);
  color: var(--danger);
}

.admin-status.pending {
  background: rgba(214, 162, 56, 0.18);
  color: #a86f10;
}

.mini-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
}

.mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.mini-btn.secondary {
  background: var(--charcoal);
}

.mini-btn.danger {
  background: var(--danger);
}

.edit-modal {
  max-width: 520px;
}

.admin-form input[type="text"],
.admin-form input[type="url"],
.admin-form input[type="password"],
.admin-form input[type="number"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.switch-line {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(223, 231, 239, 0.95);
  border-radius: 8px;
  background: #f7fbff;
  color: var(--ink) !important;
}

.switch-line input {
  width: 18px;
  height: 18px;
}

.cards-modal {
  max-width: 860px;
}

.card-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 14px;
}

.cards-list {
  display: grid;
  gap: 10px;
}

.card-secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.card-secret-row code,
.card-secret-row span,
.card-secret-row small {
  display: block;
}

.card-secret-row code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.card-secret-row span {
  margin-top: 5px;
  color: var(--muted);
}

.card-secret-row small {
  margin-top: 3px;
  color: #9a948a;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 19, 0.48);
  backdrop-filter: blur(10px);
}

.product-modal {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(31, 36, 33, 0.18);
}

.modal-art {
  position: relative;
  aspect-ratio: 3 / 2;
  min-height: 0;
  margin-bottom: 18px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--art);
  color: #fff;
}

.modal-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.17) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(135deg, #000, transparent 76%);
}

.modal-art span,
.modal-art strong {
  position: absolute;
  z-index: 3;
}

.modal-art span {
  top: 16px;
  left: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.modal-art strong {
  right: 18px;
  bottom: 16px;
  font-size: 34px;
}

.modal-title,
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.modal-stats span {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.modal-stats strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
}

.detail-block {
  padding: 16px;
  border-radius: 8px;
  background: #fbf7ef;
}

.detail-block ul {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.detail-actions {
  margin-top: 16px;
}

.detail-actions .pay-btn,
.detail-actions .ghost-btn {
  flex: 1;
}

.checkout-page {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px 0;
}

.checkout-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

.checkout-summary {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 40px rgba(31, 36, 33, 0.06);
}

.checkout-sticky {
  top: 28px;
}

.lookup-page {
  max-width: 980px;
  margin: 0 auto;
}

.lookup-hero,
.lookup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 40px rgba(31, 36, 33, 0.06);
}

.lookup-hero {
  padding: 28px;
  margin-bottom: 18px;
}

.lookup-hero p:last-child {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.lookup-card {
  padding: 18px;
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.6fr) 150px;
  gap: 12px;
  align-items: end;
}

.lookup-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.lookup-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.lookup-order-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.lookup-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.lookup-order-head h2 {
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.pending {
  background: var(--copper);
}

.status-pill.delivered {
  background: var(--green);
}

.status-pill.failed {
  background: var(--danger);
}

.lookup-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lookup-detail-grid span {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.lookup-detail-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.lookup-product-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lookup-product-card .product-art {
  width: 100%;
}

.lookup-product-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.lookup-product-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.lookup-product-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.lookup-product-card mark {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(214, 162, 56, 0.22);
  color: #e2a92e;
  font-weight: 900;
}

.clean-art span,
.clean-art b {
  display: none;
}

.clean-art.has-image::before,
.clean-art.has-image::after {
  display: none;
}

.content-title {
  display: block;
  margin-bottom: -6px;
  font-size: 16px;
}

.order-detail-box {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
}

.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-lines {
  display: grid;
  gap: 10px;
}

.detail-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.detail-lines strong {
  color: var(--ink);
  text-align: right;
}

.detail-lines .total-line {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
}

.detail-lines .total-line strong {
  color: var(--copper);
  font-size: 22px;
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.payment-option.active {
  border-color: rgba(47, 125, 92, 0.55);
  background: rgba(47, 125, 92, 0.09);
  box-shadow: 0 0 0 3px rgba(47, 125, 92, 0.08);
}

.payment-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--charcoal);
  color: #fff;
}

.payment-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  display: grid;
  gap: 24px;
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.login-copy h1 {
  margin-bottom: 12px;
}

.login-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.login-back {
  color: var(--green);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 1279px) {
  .ai-float-layer {
    display: none;
  }
}

@media (max-width: 1180px) {

  .shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 14px;
    align-items: center;
  }

  .sidebar .brand span:not(.brand-mark),
  .nav-list span,
  .status-panel small,
  .status-panel p {
    display: none;
  }

  .status-panel {
    width: 62px;
    padding: 12px;
    text-align: center;
  }

  .status-panel strong {
    font-size: 18px;
  }

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

  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkout-panel {
    position: static;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .tool-row,
  .order-lookup {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
    padding: 14px 0;
    align-items: flex-end;
    flex-direction: row;
  }

  .header-brand {
    min-width: 0;
    flex: 1;
  }

  .header-brand .brand-mark {
    width: 44px;
    height: 44px;
  }

  .header-brand strong {
    font-size: 24px;
  }

  .top-actions,
  .segments,
  .order-lookup form {
    width: 100%;
  }

  .top-actions {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .lookup-link {
    width: auto;
    min-height: 42px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .ghost-btn,
  .segments button,
  .primary-btn {
    flex: 1;
  }

  .hero-band {
    grid-template-columns: 1fr;
    padding: 22px;
  }

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

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .title-lockup {
    align-items: flex-start;
  }

  .title-lockup span:last-child {
    min-width: 0;
    line-height: 1.08;
  }

  .checkout-page {
    padding: 18px;
  }

  .checkout-top,
  .modal-title,
  .detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .checkout-layout,
  .admin-hero,
  .admin-workbench,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .checkout-sticky {
    position: static;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }

  .modal-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .product-modal {
    padding: 14px;
  }

  .modal-art strong {
    font-size: 26px;
  }

  .admin-main {
    width: min(100% - 36px, 1280px);
    padding: 18px 0 32px;
  }

  .admin-top {
    align-items: stretch;
    flex-direction: column;
    padding: 16px 18px;
  }

  .admin-top .top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .admin-top .ghost-btn,
  .admin-top .primary-btn {
    min-width: 0;
    padding: 0 10px;
    white-space: nowrap;
  }

  .admin-form,
  .admin-workbench .admin-stack:first-child .admin-form {
    grid-template-columns: 1fr;
  }

  .inventory-board {
    grid-template-columns: 1fr;
  }

  .inventory-import {
    position: static;
  }

  .admin-list-row {
    grid-template-columns: auto 72px minmax(0, 1fr);
  }

  .admin-row-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .segments {
    overflow-x: auto;
  }

  .segments button {
    white-space: nowrap;
  }

  .order-lookup form {
    flex-direction: column;
  }

  .status-panel {
    display: none;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 24px;
  }

  .title-icon {
    width: 44px;
    height: 44px;
  }

  .top-actions,
  .order-lookup form,
  .card-footer,
  .product-title,
  .detail-lines div {
    align-items: stretch;
    flex-direction: column;
  }

  .product-title .tag,
  .buy-btn,
  .order-lookup button {
    width: 100%;
  }

  .hero-band {
    margin-top: 20px;
    min-height: auto;
  }

  .notice-board ul {
    margin-top: 14px;
  }

  .metric-grid article,
  .product-card,
  .checkout-panel,
  .checkout-summary,
  .order-lookup,
  .delivery-result,
  .lookup-results {
    padding: 14px;
  }

  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card {
    gap: 10px;
    min-height: 0;
    padding: 10px;
  }

  .product-art b {
    left: 10px;
    bottom: 9px;
    font-size: 18px;
  }

  .product-art span {
    top: 9px;
    right: 9px;
    font-size: 9px;
  }

  .product-title {
    gap: 8px;
  }

  .product-title h3 {
    font-size: 14px;
  }

  .tag,
  .product-meta {
    font-size: 11px;
  }

  .product-meta strong {
    font-size: 12px;
  }

  .buy-btn {
    min-height: 36px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .metric-grid article {
    padding: 10px 8px;
  }

  .metric-grid span,
  .metric-grid small {
    font-size: 10px;
  }

  .metric-grid strong {
    font-size: 18px;
  }

  .product-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .price {
    font-size: 22px;
  }

  .modal {
    padding: 14px;
    align-items: end;
  }

  .product-modal {
    width: min(94vw, 420px);
    max-height: calc(100vh - 32px);
    padding: 12px;
  }

  .modal-close {
    top: 8px;
    right: 8px;
    width: 42px;
    height: 42px;
    background: var(--charcoal);
    color: #fff;
    font-size: 28px;
    box-shadow: 0 12px 28px rgba(31, 36, 33, 0.24);
  }

  .modal-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 12px 0;
  }

  .modal-stats span {
    padding: 9px 6px;
    font-size: 10px;
    text-align: center;
  }

  .modal-stats strong {
    font-size: 11px;
  }

  .checkout-top .ghost-btn,
  .admin-top .ghost-btn,
  .admin-top .primary-btn {
    width: 100%;
  }

  .payment-option {
    min-height: 46px;
  }

  .order-card {
    grid-template-columns: 1fr;
  }

  .lookup-form {
    grid-template-columns: 1fr;
  }

  .lookup-order-head {
    align-items: stretch;
    flex-direction: column;
  }

  .lookup-detail-grid {
    grid-template-columns: 1fr;
  }

  .lookup-product-card {
    grid-template-columns: 1fr;
  }

  .admin-list-row,
  .admin-row-actions,
  .card-tools,
  .card-secret-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .card-filter {
    overflow-x: auto;
  }

  .admin-list-row {
    grid-template-columns: 32px 72px minmax(0, 1fr);
  }

  .admin-product-thumb {
    grid-column: auto;
    width: 72px;
  }

  .admin-row-actions {
    grid-column: 1 / -1;
    flex-flow: row wrap;
    align-items: center;
  }

  .admin-row-actions .mini-btn {
    flex: 1;
  }
}
