:root {
  color-scheme: light;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --blue-700: #1557d5;
  --blue-600: #2563eb;
  --blue-500: #377cf6;
  --blue-100: #eaf2ff;
  --blue-50: #f5f8ff;
  --ink-950: #121826;
  --ink-800: #273246;
  --ink-650: #4d5b70;
  --ink-500: #718096;
  --line-300: #d9e1ec;
  --line-200: #e7ecf3;
  --line-100: #f0f3f7;
  --surface: #ffffff;
  --canvas: #f6f8fb;
  --green-700: #13795b;
  --green-100: #e7f7f1;
  --orange-700: #b45309;
  --orange-100: #fff4df;
  --red-700: #c2414a;
  --red-100: #fdecef;
  --purple-700: #6d4cc8;
  --purple-100: #f1edff;
  --shadow-sm: 0 1px 2px rgb(18 24 38 / 5%);
  --shadow-md: 0 14px 38px rgb(35 52 79 / 14%);
  --sidebar-width: 236px;
  --header-height: 68px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--ink-950);
}

body {
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: #fff;
  color: var(--ink-650);
}

.boot-mark {
  color: var(--blue-600);
  font-size: 23px;
  font-weight: 800;
}

.boot-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 44%) 1fr;
  background: var(--surface);
}

.auth-panel {
  display: grid;
  align-content: center;
  padding: 64px clamp(32px, 6vw, 96px);
  border-right: 1px solid var(--line-200);
}

.auth-brand {
  margin-bottom: 48px;
}

.auth-brand-name {
  color: var(--blue-600);
  font-size: 24px;
  font-weight: 800;
}

.auth-brand-subtitle {
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 13px;
}

.auth-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.auth-caption {
  margin: 10px 0 28px;
  color: var(--ink-500);
}

.auth-form {
  width: min(100%, 420px);
}

.auth-visual {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  padding: 8vw;
  background: var(--blue-50);
}

.auth-visual::before,
.auth-visual::after {
  position: absolute;
  content: "";
  border: 1px solid #dce8ff;
}

.auth-visual::before {
  inset: 12% 9%;
}

.auth-visual::after {
  inset: 19% 16%;
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.auth-visual-kicker {
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 700;
}

.auth-visual h2 {
  max-width: 520px;
  margin: 16px 0;
  font-size: 40px;
  line-height: 1.25;
}

.auth-visual p {
  max-width: 480px;
  margin: 0;
  color: var(--ink-650);
  font-size: 16px;
}

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

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  border-right: 1px solid var(--line-200);
  background: var(--surface);
}

.sidebar-brand {
  min-height: var(--header-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 26px;
  border-bottom: 1px solid var(--line-200);
}

.sidebar-brand strong {
  color: var(--blue-600);
  font-size: 17px;
  line-height: 1.2;
}

.sidebar-brand span {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 11px;
}

.sidebar-nav {
  padding: 18px 12px 92px;
}

.nav-group-label {
  padding: 12px 14px 8px;
  color: #9aa6b7;
  font-size: 11px;
  font-weight: 700;
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-650);
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: #f7f9fc;
  color: var(--ink-950);
}

.nav-item.active {
  background: var(--blue-100);
  color: var(--blue-600);
  font-weight: 700;
}

.nav-item.active::before {
  position: absolute;
  inset: 8px auto 8px -12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue-600);
  content: "";
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.sidebar-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  padding: 12px;
  border-top: 1px solid var(--line-200);
  background: rgb(255 255 255 / 96%);
}

.sidebar-user {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 800;
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  font-size: 13px;
}

.sidebar-user span {
  color: var(--ink-500);
  font-size: 11px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 460px) auto;
  align-items: center;
  gap: 18px;
  margin-left: var(--sidebar-width);
  padding: 0 26px;
  border-bottom: 1px solid var(--line-200);
  background: rgb(255 255 255 / 97%);
  backdrop-filter: blur(10px);
}

.page-eyebrow {
  color: var(--ink-500);
  font-size: 11px;
}

.topbar-title {
  margin-top: 1px;
  font-size: 19px;
  font-weight: 750;
}

.global-search {
  position: relative;
}

.global-search svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--ink-500);
  transform: translateY(-50%);
  pointer-events: none;
}

.global-search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line-300);
  border-radius: 6px;
  outline: none;
  background: #fafbfd;
}

.global-search input:focus {
  border-color: var(--blue-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu-button {
  display: none;
}

.main-content {
  min-height: calc(100vh - var(--header-height));
  margin-left: var(--sidebar-width);
  padding: 24px 26px 40px;
}

.page-container {
  width: min(100%, 1680px);
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-heading h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.page-heading p {
  margin: 5px 0 0;
  color: var(--ink-500);
}

.heading-actions,
.toolbar,
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.button,
.icon-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-300);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-800);
  font-weight: 650;
  transition: border 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.icon-button.mobile-menu-button {
  display: none;
}

.button {
  padding: 0 14px;
}

.button svg,
.icon-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  border-color: #afbdd0;
  background: #f9fafc;
}

.button.primary {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
}

.button.primary:hover:not(:disabled) {
  border-color: var(--blue-700);
  background: var(--blue-700);
}

.button.soft {
  border-color: transparent;
  background: var(--blue-100);
  color: var(--blue-700);
}

.button.danger {
  border-color: #f4c6cb;
  background: #fff;
  color: var(--red-700);
}

.button.text {
  min-height: 30px;
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  color: var(--blue-600);
}

.button.block {
  width: 100%;
}

.button.large {
  min-height: 42px;
  padding: 0 20px;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.panel {
  border: 1px solid var(--line-200);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-200);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.panel-body {
  padding: 18px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line-200);
  border-radius: 7px;
  background: #fff;
}

.metric-card.highlight {
  border-color: #bcd1ff;
  background: var(--blue-50);
}

.metric-label {
  color: var(--ink-500);
  font-size: 12px;
}

.metric-value {
  margin-top: 7px;
  font-size: 28px;
  font-weight: 780;
  line-height: 1.1;
}

.metric-foot {
  margin-top: 9px;
  color: var(--ink-500);
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.todo-list,
.rank-list,
.timeline,
.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.todo-item,
.rank-item {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-100);
}

.todo-item:last-child,
.rank-item:last-child {
  border-bottom: 0;
}

.todo-main {
  display: flex;
  align-items: center;
  gap: 11px;
}

.todo-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--blue-50);
  color: var(--blue-600);
}

.todo-icon svg {
  width: 17px;
}

.todo-item strong,
.rank-item strong {
  display: block;
}

.todo-item small,
.rank-item small {
  color: var(--ink-500);
}

.rank-value {
  color: var(--blue-600);
  font-weight: 750;
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line-200);
  border-radius: 7px;
  background: #fff;
}

.filter-bar .field-control {
  width: auto;
  min-width: 160px;
  height: 36px;
}

.filter-search {
  min-width: 260px !important;
  flex: 1 1 300px;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-200);
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #f8fafc;
  color: var(--ink-650);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.data-table tbody tr {
  background: #fff;
}

.data-table tbody tr:hover {
  background: #fafcff;
}

.data-table tbody tr.clickable {
  cursor: pointer;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.cell-primary {
  color: var(--ink-950);
  font-weight: 680;
}

.cell-secondary {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 12px;
}

.code {
  color: var(--blue-700);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.badge {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--ink-650);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.blue {
  background: var(--blue-100);
  color: var(--blue-700);
}

.badge.green {
  background: var(--green-100);
  color: var(--green-700);
}

.badge.orange {
  background: var(--orange-100);
  color: var(--orange-700);
}

.badge.red {
  background: var(--red-100);
  color: var(--red-700);
}

.badge.purple {
  background: var(--purple-100);
  color: var(--purple-700);
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  color: var(--ink-500);
  text-align: center;
}

.empty-state svg {
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  color: #aab6c7;
  stroke-width: 1.5;
}

.empty-state h3 {
  margin: 0 0 4px;
  color: var(--ink-800);
  font-size: 15px;
}

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

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

.field {
  min-width: 0;
}

.field.span-2 {
  grid-column: span 2;
}

.field.span-3 {
  grid-column: span 3;
}

.field.span-4,
.field.full {
  grid-column: 1 / -1;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 700;
}

.required {
  color: var(--red-700);
}

.field-control {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line-300);
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--ink-950);
}

.field-control:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
}

textarea.field-control {
  min-height: 92px;
  resize: vertical;
}

.field-hint {
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 11px;
}

.form-error {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #f4c6cb;
  border-radius: 6px;
  background: var(--red-100);
  color: var(--red-700);
}

.checkbox-line,
.radio-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input,
.radio-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-600);
}

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

.check-option {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-200);
  border-radius: 6px;
  background: #fff;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-200);
  border-radius: 6px;
  background: #f3f6fa;
}

.segmented button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-650);
}

.segmented button.active {
  background: #fff;
  color: var(--blue-600);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgb(16 24 40 / 48%);
  animation: fade-in 0.15s ease;
}

.modal-backdrop {
  display: grid;
  place-items: center;
  padding: 24px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.modal.wide {
  width: min(1120px, 100%);
}

.modal.xwide {
  width: min(1460px, 100%);
}

.modal-header {
  min-height: 68px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-200);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 12px;
}

.modal-body {
  overflow: auto;
  padding: 20px 22px 26px;
}

.modal-footer {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 12px 22px;
  border-top: 1px solid var(--line-200);
  background: #fff;
}

.form-section {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line-200);
  border-radius: 7px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title-row h3 {
  margin: 0;
  font-size: 15px;
}

.template-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 13px 15px;
  border-left: 3px solid var(--blue-600);
  background: var(--blue-50);
}

.template-banner strong {
  display: block;
}

.template-banner span {
  color: var(--ink-500);
  font-size: 12px;
}

.sku-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.sku-toolbar .field {
  min-width: 180px;
}

.sku-editor {
  overflow: auto;
  border: 1px solid var(--line-200);
  border-radius: 6px;
}

.sku-editor table {
  min-width: 900px;
}

.sku-editor td,
.sku-editor th {
  padding: 8px;
}

.sku-editor .field-control {
  min-width: 120px;
  min-height: 36px;
}

.sku-editor .sku-name-input {
  min-width: 220px;
}

.sku-editor .barcode-input {
  min-width: 170px;
}

.drawer-backdrop {
  display: flex;
  justify-content: flex-end;
}

.drawer {
  width: min(760px, 94vw);
  height: 100%;
  overflow: auto;
  background: #fff;
  box-shadow: -12px 0 34px rgb(26 39 60 / 16%);
  animation: slide-in 0.18s ease;
}

@keyframes slide-in {
  from {
    transform: translateX(40px);
  }
}

.drawer-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line-200);
  background: rgb(255 255 255 / 98%);
}

.drawer-header h2 {
  margin: 3px 0 0;
  font-size: 23px;
}

.drawer-kicker {
  color: var(--ink-500);
  font-size: 12px;
}

.drawer-body {
  padding: 18px 24px 40px;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

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

.detail-item {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line-200);
  border-radius: 6px;
  background: #fbfcfe;
}

.detail-item dt {
  color: var(--ink-500);
  font-size: 11px;
}

.detail-item dd {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.detail-section {
  margin-top: 22px;
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.detail-section h3 {
  margin: 0;
  font-size: 16px;
}

.attachment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-200);
  border-radius: 6px;
  background: #f8fafc;
}

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

.attachment-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-200);
  border-radius: 6px;
  background: #fff;
}

.attachment-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f1f4f8;
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.attachment-preview svg {
  width: 34px;
  height: 34px;
  color: var(--ink-500);
}

.attachment-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
}

.attachment-meta strong,
.attachment-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta small {
  color: var(--ink-500);
}

.timeline-item {
  position: relative;
  padding: 0 0 17px 22px;
}

.timeline-item::before {
  position: absolute;
  top: 6px;
  left: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-500);
  content: "";
}

.timeline-item::after {
  position: absolute;
  top: 15px;
  bottom: -2px;
  left: 6px;
  width: 1px;
  background: var(--line-300);
  content: "";
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-item strong {
  font-size: 13px;
}

.timeline-item p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 11px;
}

.tab-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-200);
}

.tab-button {
  position: relative;
  min-height: 42px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--ink-500);
  font-weight: 650;
}

.tab-button.active {
  color: var(--blue-600);
}

.tab-button.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--blue-600);
  content: "";
}

.toast-root {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 9px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-200);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.18s ease;
}

.toast.success svg {
  color: var(--green-700);
}

.toast.error svg {
  color: var(--red-700);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.loading-box {
  min-height: 240px;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--ink-500);
}

.loading-box .boot-spinner {
  margin-bottom: 10px;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf1f6;
}

.progress-value {
  height: 100%;
  border-radius: inherit;
  background: var(--blue-500);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 16px;
}

.store-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.platform-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-500);
}

.quality-level {
  width: 7px;
  height: 30px;
  border-radius: 4px;
  background: var(--line-300);
}

.quality-level.high {
  background: var(--red-700);
}

.quality-level.medium {
  background: var(--orange-700);
}

.quality-level.low {
  background: var(--blue-500);
}

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

.muted {
  color: var(--ink-500);
}

.text-blue {
  color: var(--blue-600);
}

.text-green {
  color: var(--green-700);
}

.text-red {
  color: var(--red-700);
}

.nowrap {
  white-space: nowrap;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-overlay {
  display: none;
}

.bundle-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 120px 120px 44px;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

@media (max-width: 1280px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

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

  .field.span-4 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  :root {
    --header-height: 62px;
  }

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

  .auth-panel {
    min-height: 100vh;
    border-right: 0;
  }

  .auth-visual {
    display: none;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-footer {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open + .sidebar-footer,
  .sidebar.open .sidebar-footer {
    transform: translateX(0);
  }

  .mobile-overlay.open {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    background: rgb(16 24 40 / 36%);
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin-left: 0;
    padding: 0 14px;
  }

  .topbar-page {
    display: none;
  }

  .icon-button.mobile-menu-button {
    display: inline-flex;
  }

  .main-content {
    margin-left: 0;
    padding: 18px 14px 30px;
  }

  .dashboard-grid,
  .split-layout {
    grid-template-columns: 1fr;
  }

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

  .bundle-editor-row {
    grid-template-columns: minmax(0, 1fr) 100px 100px 44px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 13px;
  }

  .auth-panel {
    padding: 36px 22px;
  }

  .auth-brand {
    margin-bottom: 32px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .global-search input {
    min-width: 0;
  }

  .topbar-actions .button span {
    display: none;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .heading-actions .button {
    flex: 1;
  }

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

  .metric-card {
    min-height: 96px;
    padding: 14px;
  }

  .metric-value {
    font-size: 23px;
  }

  .form-grid,
  .form-grid.two,
  .detail-grid,
  .attachment-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .bundle-editor-row {
    grid-template-columns: minmax(0, 1fr) 84px 84px 40px;
    gap: 8px;
  }

  .bundle-editor-row .field:first-child {
    grid-column: 1 / -1;
  }

  .field.span-2,
  .field.span-3,
  .field.span-4 {
    grid-column: auto;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal.wide,
  .modal.xwide {
    width: 100%;
    max-height: 94vh;
    border-radius: 8px 8px 0 0;
  }

  .modal-header,
  .modal-body,
  .drawer-body {
    padding-right: 16px;
    padding-left: 16px;
  }

  .modal-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .drawer {
    width: 100%;
  }

  .filter-bar .field-control {
    width: 100%;
  }

  .filter-bar > * {
    flex: 1 1 100%;
  }
}
