@font-face {
  font-family: "Material Symbols Outlined";
  src: url("material-symbols-outlined.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("plus-jakarta-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("plus-jakarta-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("plus-jakarta-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("plus-jakarta-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --stitch-primary: #2563eb;
  --stitch-primary-dark: #1746b7;
  --stitch-primary-soft: #eaf0ff;
  --stitch-ink: #111b31;
  --stitch-muted: #64748b;
  --stitch-line: #dfe6f3;
  --stitch-bg: #f7f7ff;
  --stitch-surface: rgba(255, 255, 255, .94);
  --stitch-surface-soft: #f2f4ff;
  --stitch-danger: #dc2626;
  --stitch-warning: #d97706;
  --stitch-success: #059669;
  --stitch-shadow: 0 12px 34px rgba(62, 77, 127, .08);
  --stitch-radius: 14px;
}

* { box-sizing: border-box; }

html { background: var(--stitch-bg); }

body {
  margin: 0;
  color: var(--stitch-ink);
  font-family: "Plus Jakarta Sans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 5%, rgba(91, 115, 255, .09), transparent 27rem),
    radial-gradient(circle at 84% 20%, rgba(137, 104, 255, .08), transparent 31rem),
    var(--stitch-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--stitch-primary); text-decoration: none; }
a:hover { color: var(--stitch-primary-dark); }

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}

.app-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(211, 220, 239, .9);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 30px rgba(40, 55, 100, .05);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  width: 218px;
  min-width: 218px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--stitch-ink);
}

.brand-lockup:hover { color: var(--stitch-ink); }
.brand-lockup > span:last-child { display: grid; gap: 1px; }
.brand-lockup b { font-size: 15px; letter-spacing: .03em; }
.brand-lockup small { color: #8190aa; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }

.brand-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #2f6bff, #1f4ec8);
  box-shadow: 0 7px 16px rgba(37, 99, 235, .26);
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #61708a;
  font-size: 11px;
  white-space: nowrap;
}

.topbar-status span {
  padding: 6px 9px;
  border: 1px solid #e2e8f5;
  border-radius: 999px;
  background: #f8faff;
}

.topbar-status .health-dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}

.global-search {
  flex: 1;
  max-width: 560px;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid #dce4f3;
  border-radius: 11px;
  background: #f7f9fe;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.global-search:focus-within {
  border-color: #8bb0ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.global-search .material-symbols-outlined { color: #8290a7; font-size: 19px; }
.global-search input {
  min-width: 0;
  height: 38px;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}
.global-search kbd {
  padding: 3px 6px;
  color: #8a97aa;
  border: 1px solid #dce3ef;
  border-radius: 6px;
  background: #fff;
  font: 10px/1 "Plus Jakarta Sans", sans-serif;
}

.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-actions a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 10px;
  color: #43516a;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
}
.topbar-actions a:hover { color: var(--stitch-primary); background: var(--stitch-primary-soft); }
.topbar-actions .material-symbols-outlined { font-size: 18px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 122px;
  color: var(--stitch-ink);
}
.user-chip:hover { color: var(--stitch-ink); }
.user-chip > span:last-child { display: grid; gap: 1px; }
.user-chip b { max-width: 100px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.user-chip small { color: #8a97aa; font-size: 9px; }
.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--stitch-primary);
  border: 1px solid #cad9fb;
  border-radius: 50%;
  background: #edf3ff;
}

.layout.authenticated {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  padding-top: 64px;
}

.side {
  position: fixed;
  inset: 64px auto 0 0;
  z-index: 900;
  width: 240px;
  min-height: 0;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px 14px 14px;
  overflow-y: auto;
  color: #4b5b75;
  border-right: 1px solid rgba(215, 223, 239, .9);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px);
}

.nav-section-label {
  padding: 7px 10px 5px;
  color: #97a3b7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.nav-section-label.governance { margin-top: 10px; }

.side > a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 7px 10px;
  color: #4a5870;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  transition: all .16s ease;
}
.side > a > span:last-child { display: grid; gap: 1px; }
.side > a small { color: #9aa6b9; font-size: 8px; font-weight: 600; letter-spacing: .04em; }
.side > a .material-symbols-outlined { color: #7a89a2; font-size: 20px; }
.side > a:hover { color: var(--stitch-primary); background: #f0f4ff; border-color: #e0e8fb; }
.side > a.current {
  color: #fff;
  background: linear-gradient(135deg, #2f6cff, #2457d6);
  box-shadow: 0 9px 20px rgba(37, 99, 235, .22);
}
.side > a.current small,
.side > a.current .material-symbols-outlined { color: rgba(255, 255, 255, .82); }

.side-footer {
  margin-top: auto;
  padding: 12px;
  border: 1px solid #dfe6f4;
  border-radius: 12px;
  background: rgba(247, 249, 255, .95);
}
.side-footer > div { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; }
.side-footer > div span { color: #71809a; }
.side-footer > i {
  display: block;
  height: 5px;
  margin: 9px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7f7;
}
.side-footer > i em { display: block; width: 18%; height: 100%; border-radius: inherit; background: #4f7dff; }
.side-footer > small { color: #8996aa; font-size: 9px; }
.side-footer form { margin-top: 10px; }
.side-footer button { width: 100%; min-height: 32px; padding: 6px 8px; font-size: 10px; }

.main {
  grid-column: 2;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 26px 28px 46px;
}
.guest-layout .main { max-width: 560px; margin: 0 auto; padding-top: 8vh; }

h1, h2, h3, h4 { color: var(--stitch-ink); letter-spacing: -.025em; }
h1 { margin: 0 0 7px; font-size: clamp(25px, 2vw, 34px); line-height: 1.16; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
.sub, .hint, .small { color: var(--stitch-muted); }
.sub { margin-top: 0; font-size: 12px; line-height: 1.65; }
.small, .hint { font-size: 11px; }

.card,
.workspace-filter-card,
.workspace-bulkbar,
.workspace-rail,
.pricing-shell,
.import-shell,
.catalog-delivery {
  border: 1px solid rgba(214, 223, 241, .92);
  border-radius: var(--stitch-radius);
  background: var(--stitch-surface);
  box-shadow: var(--stitch-shadow);
}

.card { padding: 18px; }
.card + .card { margin-top: 16px; }
.grid { gap: 16px; }
hr { border: 0; border-top: 1px solid var(--stitch-line); }

button, .btn, input[type="submit"] {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--stitch-primary);
  border-radius: 9px;
  color: #fff;
  background: var(--stitch-primary);
  box-shadow: 0 5px 12px rgba(37, 99, 235, .15);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
button:hover, .btn:hover, input[type="submit"]:hover { color: #fff; background: var(--stitch-primary-dark); }
button.secondary, .btn.secondary {
  color: #31415d;
  border-color: #dbe4f4;
  background: #f2f5fb;
  box-shadow: none;
}
button.secondary:hover, .btn.secondary:hover { color: var(--stitch-primary); background: #e8efff; }
button.danger, .btn.danger { color: #fff; border-color: #dc2626; background: #dc2626; }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  min-height: 38px;
  padding: 8px 11px;
  color: #24324a;
  border: 1px solid #cfd9eb;
  border-radius: 9px;
  background: #fff;
  font: 12px/1.45 inherit;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 78px; }
input:focus, select:focus, textarea:focus {
  border-color: #7da5ff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1) !important;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--stitch-primary); }
label { color: #53627a; font-size: 11px; font-weight: 700; }

table {
  width: 100%;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  color: #293650;
  border: 1px solid #e1e7f2;
  border-radius: 11px;
  background: #fff;
  font-size: 11px;
}
th {
  padding: 11px 12px;
  color: #718099;
  background: #f4f6fb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: none;
}
td { padding: 11px 12px; border-top: 1px solid #edf0f6; }
tr:hover td { background: #fafbff; }

.tag, .status-chip, .badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #526078;
  background: #eef2f8;
  font-size: 9px;
  font-weight: 800;
}
.tag.published, .tag.complete, .status-chip.complete { color: #047857; background: #dcfce7; }
.tag.pending, .status-chip.pending { color: #b45309; background: #fef3c7; }
.tag.danger, .tag.blocked, .status-chip.blocked { color: #b91c1c; background: #fee2e2; }

.flash {
  margin-bottom: 14px;
  padding: 11px 14px;
  color: #1544aa;
  border: 1px solid #bfd2ff;
  border-radius: 10px;
  background: #edf3ff;
  font-size: 12px;
}
.empty {
  padding: 32px 18px;
  color: #8793a8;
  border: 1px dashed #ced8e9;
  border-radius: 12px;
  background: #fafbff;
  text-align: center;
}

/* Workspace: dense operational gallery, faithful to the Stitch workbench screen. */
.workspace-shell { max-width: none; }
.workspace-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #7f8da3;
  font-size: 10px;
  font-weight: 700;
}
.workspace-breadcrumb strong { color: #33445f; }
.workspace-breadcrumb em {
  padding: 4px 8px;
  color: #445774;
  border-radius: 999px;
  background: #e8edfa;
  font-style: normal;
  letter-spacing: .03em;
}
.workspace-header { margin-bottom: 18px; }
.workspace-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.workspace-kpis article {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  border: 1px solid #dfe6f4;
  border-radius: 13px;
  background: rgba(255,255,255,.93);
  box-shadow: 0 8px 22px rgba(44,59,100,.05);
}
.workspace-kpis article > .material-symbols-outlined {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  color: #245edb;
  border-radius: 11px;
  background: #eaf0ff;
}
.workspace-kpis article > .warning { color: #c2410c; background: #ffede5; }
.workspace-kpis article > .success { color: #047857; background: #ddf8ec; }
.workspace-kpis article > .review { color: #7c3aed; background: #eee7ff; }
.workspace-kpis div { min-width: 0; }
.workspace-kpis small { display: block; color: #6d7b92; font-size: 9px; font-weight: 800; }
.workspace-kpis strong { display: block; margin: 2px 0; font-size: 23px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.workspace-kpis p { margin: 0; overflow: hidden; color: #8b97aa; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 13px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid #e0e6f2;
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 5px 16px rgba(42,55,94,.04);
}
.workspace-view-tabs a {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #64738c;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}
.workspace-view-tabs a:hover { color: #2158cf; background: #eef3ff; }
.workspace-view-tabs a.current { color: #fff; background: #2563eb; }
.workspace-view-tabs em {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #e9eef8;
  color: #526179;
  font-style: normal;
  text-align: center;
}
.workspace-view-tabs a.current em { color: #1747b4; background: #fff; }
.workspace-console-grid { gap: 18px; }
.workspace-rail { padding: 14px; box-shadow: var(--stitch-shadow); }
.workspace-filter-card { padding: 14px; margin-bottom: 12px; }
.workspace-bulkbar {
  padding: 10px 12px;
  margin-bottom: 14px;
  color: #fff;
  border-color: #18386e;
  background: #15294d;
  box-shadow: 0 8px 18px rgba(15, 35, 72, .15);
}
.workspace-bulkbar label { color: #fff; }
.workspace-bulkbar select { color: #24324a; background: #fff; }
.workspace-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.workspace-gallery .card + .card { margin-top: 0 !important; }
.product-gallery-card {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid #dbe3f1;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(49, 63, 102, .06);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.product-gallery-card h2 {
  min-height: 38px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-gallery-meta,
.product-gallery-supplier {
  min-height: 32px;
  line-height: 1.45;
}
.product-gallery-prices {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px !important;
  padding: 0 !important;
  background: transparent !important;
}
.gallery-price-button {
  min-width: 0;
  min-height: 50px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  padding: 7px 8px;
  color: #40526d;
  border: 1px solid #e5ebf4;
  border-radius: 8px;
  background: #f7f9fd;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.gallery-price-button:hover,
.gallery-price-button:focus-visible {
  color: #164bbd;
  border-color: #9ebaff;
  background: #eef4ff;
}
.gallery-price-button span { font-size: 10px; font-weight: 700; }
.gallery-price-button b {
  max-width: 100%;
  overflow: hidden;
  color: #172b4d;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-price-button:hover b,
.gallery-price-button:focus-visible b { color: #164bbd; }
.gallery-completeness { min-height: 28px; }
.product-gallery-card:hover {
  transform: translateY(-2px);
  border-color: #9ebaff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .11);
}
.product-gallery-card img { width: 100%; height: 160px; object-fit: contain; background: #f8f9fd; }
.workspace-inspector { border-color: #d7e0f1; background: #f7f9ff; }

/* Image center: file controls must shrink with their grid columns. */
.image-center .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.image-center .field { min-width: 0; }
.image-center input[type="file"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.image-center td .toolbar { flex-wrap: nowrap; }
.image-center td .toolbar input[type="file"] { min-width: 180px; }

/* Feature screens */
.pricing-shell, .import-shell, .catalog-delivery { padding: 20px; }
.metric, .stat, .kpi { border-color: #dfe6f3 !important; background: #fff !important; box-shadow: 0 8px 20px rgba(44, 59, 100, .05); }
.progress, progress { accent-color: var(--stitch-primary); }
details { border-color: #dfe6f2 !important; border-radius: 11px !important; background: #fff; }
summary { color: #2f3f5d; font-weight: 800; }

@media (max-width: 1320px) {
  .topbar-status { display: none; }
  .workspace-gallery { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
}

@media (max-width: 1080px) {
  .topbar-actions { display: none; }
  .app-topbar { gap: 10px; }
  .workspace-console-grid { grid-template-columns: 1fr !important; }
  .workspace-rail { position: static !important; }
  .workspace-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-topbar { position: sticky; padding: 0 12px; }
  .brand-lockup { width: auto; min-width: 42px; }
  .brand-lockup > span:last-child, .user-chip > span:last-child, .global-search kbd { display: none; }
  .global-search { max-width: none; }
  .user-chip { min-width: auto; }
  .layout.authenticated { display: block; padding-top: 0; }
  .side {
    position: sticky;
    inset: 64px auto auto 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 8px 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #dde5f2;
  }
  .nav-section-label, .side-footer, .side > a small { display: none; }
  .side > a { min-width: max-content; min-height: 38px; padding: 7px 10px; }
  .side > a > span:last-child { display: block; }
  .main { padding: 18px 14px 36px; }
  .workspace-gallery { grid-template-columns: 1fr; }
  .workspace-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-center .grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .app-topbar { height: 58px; }
  .global-search { min-width: 0; }
  .user-chip { display: none; }
  .side { inset-block-start: 58px; }
  .main { padding-inline: 10px; }
  .card, .pricing-shell, .import-shell, .catalog-delivery { padding: 14px; }
  h1 { font-size: 25px; }
  .workspace-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .workspace-kpis article { padding: 11px; }
  .workspace-kpis p { display: none; }
}
