:root {
  --blue: #0058b8;
  --blue-deep: #06264f;
  --blue-dark: #071a38;
  --orange: #ff9700;
  --orange-deep: #df7600;
  --ink: #172033;
  --muted: #65738a;
  --line: #dce5f2;
  --surface: #ffffff;
  --background: #f3f6fb;
  --good: #0f9f6e;
  --warn: #d87800;
  --shadow: 0 18px 48px rgba(9, 31, 68, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.market-shell {
  min-height: 100vh;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1fr);
  gap: clamp(24px, 5vw, 76px);
  align-items: center;
  padding: clamp(22px, 4vw, 58px);
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 151, 0, 0.26), transparent 28%),
    radial-gradient(circle at 72% 70%, rgba(0, 88, 184, 0.3), transparent 32%),
    linear-gradient(135deg, #05162d 0%, #06264f 54%, #003b7f 100%);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(26px, 5vw, 54px);
  min-height: min(760px, calc(100vh - 80px));
  padding: 0;
  color: #fff;
}

.auth-brand-top,
.preview-head,
.preview-row {
  display: flex;
  align-items: center;
}

.auth-brand-top {
  justify-content: space-between;
  gap: 20px;
}

.auth-brand-top span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-brand-top img,
.dashboard-logo img {
  width: min(270px, 70vw);
  height: auto;
}

.auth-copy {
  max-width: 620px;
}

.auth-copy h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5.5vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.auth-copy > p:not(.eyebrow) {
  max-width: 560px;
  margin: 18px 0 0;
  color: #c6d8f2;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.7;
}

.auth-preview {
  width: min(520px, 100%);
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
}

.preview-head {
  justify-content: space-between;
  gap: 18px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.preview-head span,
.preview-row small {
  color: #c6d8f2;
  font-weight: 800;
}

.preview-head strong {
  color: var(--orange);
  font-size: 2rem;
  line-height: 1;
}

.preview-row {
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(3, 19, 43, 0.28);
}

.preview-row > span {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 151, 0, 0.95), rgba(255, 197, 92, 0.88)),
    #fff;
}

.preview-row strong,
.preview-row small {
  display: block;
}

.preview-row strong {
  color: #fff;
}

.auth-brand p {
  margin: 0;
}

.auth-card {
  align-self: center;
  width: min(480px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 80px rgba(0, 20, 52, 0.28);
}

.auth-card-head {
  margin-bottom: 16px;
}

.auth-card-head h2 {
  margin: 0;
  color: var(--blue-deep);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.05;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 8px;
  background: #eef4fb;
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--blue-deep);
  box-shadow: 0 8px 18px rgba(9, 31, 68, 0.1);
}

.auth-form {
  display: none;
  gap: 14px;
  padding: 18px 0 0;
}

.auth-form.active {
  display: grid;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange-deep);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--blue-deep);
  font-size: 0.88rem;
  font-weight: 900;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 151, 0, 0.18);
}

.primary-action,
.secondary-action,
.corner-add,
.logout-button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-action {
  border: 0;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 14px 28px rgba(255, 151, 0, 0.28);
}

.secondary-action {
  border: 1px solid rgba(255, 151, 0, 0.5);
  background: #fff7ea;
  color: var(--blue-deep);
  padding: 0 16px;
}

.corner-add {
  width: 46px;
  border: 0;
  background: var(--orange);
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 12px 28px rgba(255, 151, 0, 0.28);
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.helper-text.strong {
  color: var(--blue-deep);
  font-weight: 900;
}

.dashboard-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px;
  background: linear-gradient(180deg, #061a33 0%, #08284f 100%);
  color: #fff;
}

.dashboard-logo {
  display: inline-flex;
  padding: 6px 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.dashboard-logo img {
  width: 210px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar nav button,
.logout-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  background: transparent;
  color: #dbeafe;
  text-align: left;
  font-weight: 900;
}

.sidebar nav button.active,
.sidebar nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.logout-button {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.workspace {
  min-width: 0;
  padding: 22px clamp(18px, 3vw, 44px) 44px;
}

.workspace-header,
.panel-toolbar,
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.workspace-header {
  margin-bottom: 22px;
}

.workspace-header h1 {
  margin-bottom: 0;
  color: var(--blue-deep);
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
}

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

.header-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e8f2ff;
  color: var(--blue-deep);
  font-size: 0.84rem;
  font-weight: 900;
}

.panel {
  display: none;
}

.panel.active {
  display: grid;
  gap: 18px;
}

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

.metrics-grid article,
.work-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(9, 31, 68, 0.07);
}

.metrics-grid article {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metrics-grid span {
  color: var(--muted);
  font-weight: 800;
}

.metrics-grid strong {
  color: var(--blue-deep);
  font-size: 2.35rem;
  line-height: 1;
}

.content-grid,
.store-admin-grid,
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.work-card {
  padding: 18px;
}

.work-card h2,
.work-card h3,
.panel-toolbar h2 {
  margin-bottom: 0;
  color: var(--blue-deep);
}

.panel-toolbar p,
.settings-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.card-head {
  margin-bottom: 14px;
}

.card-head button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 900;
}

.filters {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(150px, 190px) minmax(220px, 300px) 46px;
  gap: 10px;
  align-items: center;
}

.table-list,
.activity-list,
.product-table,
.store-list {
  display: grid;
  gap: 10px;
}

.list-row,
.product-row,
.store-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.product-row {
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  align-items: center;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.product-row:hover,
.product-row:focus-visible,
.store-card:hover,
.store-card:focus-visible {
  border-color: rgba(255, 151, 0, 0.55);
  box-shadow: 0 14px 34px rgba(9, 31, 68, 0.1);
  transform: translateY(-1px);
  outline: 0;
}

.product-row img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.product-row strong,
.store-row strong,
.list-row strong {
  color: var(--blue-deep);
}

.product-row span,
.store-row span,
.store-card span,
.list-row span,
.activity-list span {
  color: var(--muted);
  font-size: 0.88rem;
}

.status {
  width: max-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue-deep);
  font-size: 0.74rem;
  font-weight: 900;
}

.status.published {
  background: #e8fff6;
  color: var(--good);
}

.status.pending {
  background: #fff4df;
  color: var(--warn);
}

.status.draft {
  background: #eef2f7;
  color: #475569;
}

.status.archived,
.status.rejected {
  background: #ffe8e8;
  color: #b42318;
}

.row-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.stock-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stock-stepper button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-deep);
  font-weight: 900;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.status-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-deep);
  font-size: 0.76rem;
  font-weight: 900;
  padding: 7px 9px;
}

.status-actions button[data-status="published"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.status-actions button[data-status="archived"] {
  color: #b42318;
}

.compact-form,
.backend-checklist {
  display: grid;
  gap: 12px;
}

.backend-checklist span {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--blue-deep);
  font-weight: 800;
}

.store-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.store-card {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(9, 31, 68, 0.07);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.store-card strong,
.store-card span,
.store-card small {
  display: block;
}

.store-card strong {
  color: var(--blue-deep);
  font-size: 1.08rem;
}

.store-card small {
  color: var(--orange-deep);
  font-weight: 900;
}

.product-dialog {
  width: min(720px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(4, 17, 35, 0.55);
}

.product-dialog form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.dialog-head h2 {
  margin: 0;
  color: var(--blue-deep);
}

.dialog-head button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-deep);
  font-size: 1.5rem;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.combo-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(116px, 0.34fr);
  gap: 8px;
}

.upload-zone {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #a9bdd8;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--blue-deep);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.upload-zone.dragging,
.upload-zone:focus-visible {
  border-color: var(--orange);
  background: #fff7ea;
  box-shadow: 0 0 0 3px rgba(255, 151, 0, 0.18);
  outline: 0;
}

.upload-zone input {
  display: none;
}

.upload-zone strong,
.upload-zone span,
.upload-zone small {
  display: block;
}

.upload-zone small {
  color: var(--muted);
  font-weight: 700;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.image-preview-grid img,
.image-preview-item,
.image-preview-grid span {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.image-preview-grid img,
.image-preview-item img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  object-fit: cover;
}

.image-preview-item {
  position: relative;
  margin: 0;
  overflow: hidden;
}

.image-preview-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(7, 26, 56, 0.82);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}

.image-preview-grid span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1020px) {
  .dashboard-view,
  .auth-view {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: auto;
  }

  .auth-copy h1 {
    max-width: 760px;
  }

  .auth-preview {
    width: 100%;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .logout-button {
    margin-top: 0;
  }

  .metrics-grid,
  .content-grid,
  .store-admin-grid,
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .auth-view {
    gap: 22px;
    padding: 18px;
  }

  .auth-brand {
    gap: 20px;
  }

  .auth-brand-top {
    align-items: start;
    flex-direction: column;
  }

  .auth-brand-top img {
    width: 210px;
  }

  .auth-copy h1 {
    font-size: 2.35rem;
  }

  .auth-copy > p:not(.eyebrow) {
    font-size: 0.98rem;
  }

  .auth-card {
    padding: 16px;
  }

  .auth-tabs {
    grid-template-columns: 1fr;
  }

  .auth-preview {
    display: none;
  }

  .sidebar nav,
  .metrics-grid,
  .content-grid,
  .store-admin-grid,
  .account-grid,
  .form-grid,
  .combo-field,
  .filters {
    grid-template-columns: 1fr;
  }

  .workspace-header,
  .panel-toolbar,
  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .product-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .product-row .status,
  .product-row .row-actions {
    grid-column: 2;
    justify-items: start;
  }
}
