:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #0f172a;
  background:
    radial-gradient(circle at top left, rgba(22, 163, 74, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 24%),
    #f4f7f6;
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; }
button, input, textarea { font: inherit; }

button {
  border: 0;
  border-radius: 16px;
  background: #0f172a;
  color: #fff;
  padding: 0.85rem 1rem;
  cursor: pointer;
}

button:hover { opacity: 0.95; }
#app { min-height: 100vh; }

.app-shell {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  background: #fff;
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 18px 10px;
}

.side-rail__brand {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #0f172a;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
}

.side-rail__nav { display: grid; gap: 10px; width: 100%; }

.side-rail__link {
  background: transparent;
  color: #64748b;
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  position: relative;
}

.side-rail__link--active {
  background: rgba(16, 185, 129, 0.14);
  color: #0f9f5a;
  font-weight: 700;
}

.side-rail__link--cart {
  min-height: 46px;
  display: grid;
  place-items: center;
}

.cart-glyph {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 16px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  position: relative;
}

.cart-glyph::before {
  content: '';
  position: absolute;
  left: 2px;
  top: -6px;
  width: 12px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.cart-glyph::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.cart-count {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #0f9f5a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

.workspace { padding: 20px; display: grid; gap: 18px; }

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.7fr) auto;
  gap: 18px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: #64748b;
}

.topbar__copy h1 { margin: 0; font-size: clamp(2rem, 3vw, 3rem); line-height: 1.05; }
.topbar__subcopy { margin: 8px 0 0; color: #667085; max-width: 60ch; }

.status-pill {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #dcfce7, #ecfeff);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #166534;
}

.status-pill--error {
  background: #fff7ed;
  color: #9a3412;
  border-color: rgba(249, 115, 22, 0.22);
}

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

.topbar__tool {
  background: #fff;
  color: #0f172a;
  min-height: 48px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.topbar__tool--admin,
.primary-cta {
  background: linear-gradient(135deg, #0f9f5a, #10b981);
  color: #fff;
  box-shadow: 0 14px 26px rgba(15, 159, 90, 0.24);
}

.primary-cta--small { padding: 0.75rem 1rem; }
.button-secondary { background: #e2e8f0; color: #0f172a; }
.button-danger { background: #fee2e2; color: #991b1b; }

.store-view,
.catalog-view,
.admin-view,
.aux-view,
.main-column,
.right-rail { display: grid; gap: 18px; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.summary-strip--admin { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary-strip--catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.summary-card,
.hero-strip,
.featured-card,
.side-card,
.cart-card,
.admin-hero,
.admin-board {
  background: #fff;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.summary-card { padding: 18px 20px; }
.summary-card p { margin: 0 0 8px; color: #667085; }
.summary-card strong { font-size: 1.45rem; }

.summary-card--accent {
  background: linear-gradient(135deg, #0f9f5a, #0f172a);
  color: #fff;
}

.summary-card--accent p { color: #dcfce7; }

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

.aux-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  padding: 22px;
}

.panel-copy {
  margin: 0 0 16px;
  color: #64748b;
  max-width: 42ch;
}

.hero-strip,
.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 22px;
}

.hero-strip__copy h2,
.admin-hero h2,
.section-head h2,
.cart-card__header h2,
.admin-board__header h2 { margin: 0; }

.hero-strip__copy p:last-child,
.admin-hero p:last-child { margin: 8px 0 0; color: #64748b; max-width: 50ch; }
.hero-strip__actions,
.admin-hero__actions,
.admin-board__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.right-rail {
  grid-template-columns: 1fr;
  align-content: start;
}

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

.featured-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.featured-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
}

.featured-card__image {
  width: 116px;
  height: 116px;
  object-fit: cover;
  border-radius: 18px;
}

.featured-card__body { display: grid; gap: 6px; }
.featured-card__body p { margin: 0; color: #667085; }
.featured-card__body span { color: #475467; }
.featured-card__body b { font-size: 1.35rem; margin-top: 6px; }
.featured-card__actions { display: grid; gap: 8px; align-content: start; min-width: 108px; }

.catalog-block { display: grid; gap: 16px; }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.section-head--stack { align-items: start; }
.section-kicker { color: #0f9f5a; }

.catalog-search,
.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  padding: 0.9rem 1rem;
}

.catalog-search { width: min(300px, 100%); }
.field textarea { resize: vertical; min-height: 104px; }

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

.product-card {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 159, 90, 0.28);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
}

.product-card__image {
  width: 100%;
  height: 132px;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 12px;
}

.product-card__body { display: grid; gap: 8px; }
.product-card__badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: #e8fff0;
  color: #0f9f5a;
  font-size: 0.82rem;
}

.product-card h3 { margin: 0; font-size: 1rem; }
.product-card p {
  margin: 0;
  color: #475467;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.product-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.product-card__footer button { background: #0f9f5a; }

.empty-state {
  display: grid;
  gap: 10px;
  padding: 22px;
  background: #fff;
  border-radius: 22px;
  border: 1px dashed rgba(148, 163, 184, 0.34);
}

.empty-state p { margin: 0; color: #64748b; max-width: 42ch; }

.side-card,
.cart-card { padding: 18px; }

.shortcut-list { display: grid; gap: 10px; margin-top: 14px; }

.shortcut-item {
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 18px;
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.shortcut-item__image {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 4px;
}

.shortcut-item span { color: #64748b; font-size: 0.92rem; }
.shortcut-item--accent { background: #e8fff0; }

.cart-card__header,
.cart-total,
.cart-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.cart-card__header { margin-bottom: 16px; }
.cart-card--preview .cart-list { gap: 6px; }
.link-inline {
  background: transparent;
  color: #0f9f5a;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  font-weight: 700;
}
.cart-card__empty { padding: 18px 0; color: #667085; }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cart-item { padding: 12px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.18); }
.cart-item:last-child { border-bottom: 0; }
.cart-item p { margin: 4px 0 0; color: #667085; }
.cart-list--page { gap: 10px; }
.cart-item--page {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
}
.cart-item__image {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 16px;
}
.cart-item__main { min-width: 0; }
.cart-item__price,
.cart-item__subtotal { white-space: nowrap; }
.cart-item__actions { display: flex; gap: 8px; }
.cart-item__actions button { width: 36px; height: 36px; padding: 0; }
.cart-item__actions button:last-child { background: #0f9f5a; }
.cart-total { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(148, 163, 184, 0.18); }

.admin-board { padding: 22px; display: grid; gap: 18px; }
.admin-board__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

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

.admin-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.admin-item__image {
  width: 110px;
  height: 82px;
  object-fit: cover;
  border-radius: 16px;
}

.admin-item__body { display: grid; gap: 6px; }
.admin-item__headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.admin-item__headline p,
.admin-item__body span { margin: 0; color: #64748b; }
.admin-item__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.balance-list,
.insight-list,
.movement-list {
  display: grid;
  gap: 12px;
}

.balance-item,
.insight-card,
.movement-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.balance-item p,
.insight-card p,
.movement-item p {
  margin: 4px 0 0;
  color: #64748b;
}

.balance-item span {
  color: #0f9f5a;
  font-weight: 800;
}

.insight-card {
  display: grid;
  justify-items: start;
}

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

.movement-item__badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
  color: #fff;
  background: #0f172a;
}

.movement-item__badge--admin { background: #0f9f5a; }
.movement-item__badge--cart { background: #0f766e; }
.movement-item__body { min-width: 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.56);
}

.modal {
  position: relative;
  width: min(920px, 100%);
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.modal--product {
  max-height: min(92vh, 900px);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
}

.modal--compact { width: min(520px, 100%); }
.modal--editor { width: min(900px, 100%); max-height: min(92vh, 920px); overflow: auto; }

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.86);
}

.modal__media { background: linear-gradient(180deg, #e2e8f0, #f8fafc); }
.modal__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal__content { padding: 28px; }
.modal__content--editor { display: grid; gap: 18px; }

.modal__tag {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: #64748b;
}

.modal__content h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.modal__price { margin: 12px 0 18px; font-size: 1.4rem; font-weight: 700; }
.modal__text { margin: 0 0 18px; color: #475467; }
.modal__features { margin: 0; padding-left: 18px; }
.modal__features li + li { margin-top: 8px; }
.modal__actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }

.field { display: grid; gap: 8px; }
.field span { color: #667085; font-size: 0.9rem; }
.field--full { grid-column: 1 / -1; }
.login-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid rgba(248, 113, 113, 0.28);
}

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

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

@media (max-width: 1180px) {
  .store-grid,
  .topbar,
  .aux-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .right-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-rail {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .side-rail__brand {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    font-size: 1rem;
  }
  .side-rail__nav {
    display: flex;
    width: auto;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .side-rail__nav::-webkit-scrollbar { display: none; }
  .side-rail__link {
    white-space: nowrap;
    padding: 10px 12px;
    min-height: 42px;
  }
  .summary-strip,
  .featured-cards,
  .product-grid,
  .aux-grid,
  .editor-grid,
  .admin-item,
  .admin-item__actions,
  .modal--product { grid-template-columns: 1fr; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-card__image { width: 100%; height: 156px; }
  .admin-item__image { width: 100%; height: 180px; }
  .cart-item--page { grid-template-columns: 1fr; }
  .cart-item__image { width: 100%; height: 180px; }
  .topbar__copy h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); }
  .topbar__subcopy { max-width: none; }
  .shortcut-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shortcut-item__image { height: 72px; }
  .summary-card { padding: 16px 16px; }
  .summary-card strong { font-size: 1.25rem; }
}

@media (max-width: 720px) {
  .workspace { padding: 12px; gap: 14px; }
  .topbar { gap: 12px; }
  .summary-strip,
  .summary-strip--admin,
  .summary-strip--catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hero-strip,
  .admin-hero,
  .admin-board__header,
  .section-head,
  .editor-head,
  .modal__actions { grid-template-columns: 1fr; }
  .hero-strip__actions,
  .admin-hero__actions,
  .admin-board__actions,
  .topbar__tools,
  .editor-head,
  .section-head,
  .modal__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .status-pill {
    padding: 12px 14px;
    border-radius: 18px;
  }
  .topbar__tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .topbar__tool {
    min-height: 42px;
    padding: 0 12px;
  }
  .hero-strip,
  .admin-hero,
  .side-card,
  .cart-card,
  .aux-card,
  .admin-board {
    padding: 16px;
    border-radius: 20px;
  }
  .hero-strip__copy p:last-child {
    display: none;
  }
  .hero-strip__actions .button-secondary {
    display: none;
  }
  .featured-cards { gap: 10px; }
  .featured-card {
    padding: 14px;
    gap: 10px;
  }
  .featured-card__image {
    height: 128px;
    border-radius: 16px;
  }
  .featured-card__body b { font-size: 1.15rem; }
  .catalog-block { gap: 12px; }
  .catalog-search { width: 100%; }
  .section-head { gap: 10px; }
  .section-head h2 { font-size: 1.1rem; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card {
    padding: 12px;
    border-radius: 18px;
  }
  .product-card__image {
    height: 112px;
    border-radius: 14px;
    margin-bottom: 10px;
  }
  .product-card__body { gap: 6px; }
  .product-card__badge {
    font-size: 0.75rem;
    padding: 0.28rem 0.58rem;
  }
  .product-card h3 { font-size: 0.96rem; }
  .product-card p {
    min-height: 0;
    font-size: 0.92rem;
  }
  .product-card__footer {
    margin-top: 10px;
    align-items: center;
  }
  .shortcut-list {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  .shortcut-item {
    padding: 12px;
    border-radius: 16px;
  }
  .shortcut-item__image { display: none; }
  .cart-card--preview .cart-item:nth-child(n + 3) { display: none; }
  .cart-card__header h2 { font-size: 1.05rem; }
  .cart-item { padding: 10px 0; }
  .cart-item__actions button {
    width: 32px;
    height: 32px;
  }
  .aux-card { padding: 16px; }
  .balance-item,
  .insight-card,
  .movement-item {
    padding: 12px 14px;
    border-radius: 16px;
  }
  .movement-item { grid-template-columns: 1fr; align-items: start; }
  .movement-item__badge {
    width: 34px;
    height: 34px;
  }
  .admin-item {
    padding: 12px;
    border-radius: 18px;
  }
  .admin-item__image { width: 100%; height: 144px; }
  .admin-item__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-item__actions button { width: 100%; }
  .editor-grid { grid-template-columns: 1fr; }
  .modal__content { padding: 22px; }
  .modal__actions button,
  .hero-strip__actions button,
  .admin-hero__actions button,
  .admin-board__actions button,
  .topbar__tools button { width: 100%; }
}

@media (max-width: 560px) {
  .side-rail__brand { display: none; }
  .side-rail { padding: 8px 10px; }
  .side-rail__link {
    padding: 9px 11px;
    font-size: 0.82rem;
  }
  .summary-strip,
  .summary-strip--admin,
  .summary-strip--catalog { grid-template-columns: 1fr; }
  .topbar__copy h1 { font-size: 1.55rem; }
  .topbar__subcopy { font-size: 0.92rem; }
  .status-pill span { font-size: 0.86rem; }
  .topbar__tools { grid-template-columns: 1fr; }
  .product-card__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .product-card__footer button { width: 100%; }
  .admin-item__actions { grid-template-columns: 1fr; }
}
