/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --bg: #eff8f6;
  --surface: #ffffff;
  --surface-muted: #f3faf8;
  --surface-soft: #f7fcfb;
  --sidebar: #ffffff;
  --sidebar-soft: #eef8f6;
  --text: #17323a;
  --muted: #60757d;
  --line: #d8e7e4;
  --line-strong: #b9d6d0;
  --accent: #1ba784;
  --accent-strong: #0f766e;
  --accent-soft: #dff5f0;
  --warning: #b45309;
  --danger: #b42318;
  --success: #157f3f;
  --shadow-soft: 0 12px 32px rgba(23, 50, 58, 0.07);
  --focus-ring: 0 0 0 4px rgba(27, 167, 132, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.admin-shell {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

button {
  font: inherit;
}

.oms-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.oms-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar);
  color: #f8fafc;
  padding: 20px 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 4px;
  color: #a8b4c0;
  font-size: 12px;
}

.side-nav {
  padding-top: 18px;
}

.nav-group {
  margin-bottom: 22px;
}

.nav-group h2 {
  margin: 0 0 8px;
  padding: 0 8px;
  color: #9caebd;
  font-size: 12px;
  font-weight: 700;
}

.nav-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
}

.nav-item + .nav-item {
  margin-top: 4px;
}

.nav-item strong {
  display: block;
  color: #f8fafc;
  font-size: 14px;
}

.nav-item small {
  display: block;
  margin-top: 3px;
  color: #9caebd;
  font-size: 12px;
  line-height: 1.35;
}

.nav-item.is-active,
.nav-item:hover {
  background: var(--sidebar-soft);
}

.nav-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: #6b7b88;
}

.nav-item.is-active .nav-dot {
  background: #41c7b7;
}

.oms-main {
  min-width: 0;
}

.topbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.topbar h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}

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

.topbar-actions form {
  margin: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.tenant-switcher,
.user-chip {
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.tenant-switcher span,
.user-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.tenant-switcher strong,
.user-chip strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.logout-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.content-area {
  padding: 24px 28px 36px;
}

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

.metric-card,
.workbench-section,
.module-map {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card {
  min-height: 142px;
  padding: 16px;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.trend-up {
  color: var(--success);
}

.trend-down {
  color: var(--danger);
}

.metric-value {
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.metric-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.workbench-section {
  min-height: 256px;
  overflow: hidden;
}

.section-heading {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
}

.section-heading a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.workbench-list {
  display: grid;
}

.workbench-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.workbench-row:last-child {
  border-bottom: 0;
}

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

.workbench-row strong {
  font-size: 14px;
}

.workbench-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.row-action em {
  color: var(--warning);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.row-action button {
  min-width: 58px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
}

.module-map {
  margin-top: 16px;
  overflow: hidden;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.module-grid div {
  min-height: 92px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.module-grid div:nth-child(3n) {
  border-right: 0;
}

.module-grid div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.module-grid strong,
.module-grid span {
  display: block;
}

.module-grid strong {
  font-size: 14px;
}

.module-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.page-header-panel {
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.page-header-panel h2 {
  margin: 0;
  font-size: 22px;
}

.page-header-panel span {
  display: block;
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.page-header-panel button,
.filter-bar button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.page-header-panel button {
  min-width: 108px;
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 800;
}

.page-header-action-form {
  margin: 0;
}

.page-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.module-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.module-summary-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.module-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.module-summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1;
}

.module-summary-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.order-workflow-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.workflow-card {
  min-height: 104px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.workflow-card:hover {
  border-color: rgba(27, 167, 132, 0.32);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.1);
  transform: translateY(-1px);
}

.workflow-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workflow-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.workflow-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sku-mapping-workbench {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mapping-workflow-card {
  min-height: 104px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.mapping-workflow-card:hover {
  border-color: rgba(27, 167, 132, 0.32);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.1);
  transform: translateY(-1px);
}

.mapping-workflow-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mapping-workflow-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.mapping-workflow-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.list-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.companion-panel .section-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.filter-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-bar button {
  padding: 0 12px;
}

.filter-bar select,
.filter-bar input {
  min-height: 36px;
  min-width: 128px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.filter-bar .filter-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.filter-reset {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.button-link {
  align-items: center;
  background: var(--accent);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  min-height: 40px;
  padding: 0 18px;
  text-decoration: none;
}

.button-link-secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-spacer {
  flex: 1;
}

/* Desktop admin refresh: shared shell, tables and dense work surfaces. */
.oms-layout {
  grid-template-columns: 292px minmax(0, 1fr);
}

.oms-sidebar {
  background:
    linear-gradient(180deg, rgba(223, 245, 240, 0.92), rgba(255, 255, 255, 0.96) 28%),
    var(--sidebar);
  color: var(--text);
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 28px rgba(23, 50, 58, 0.05);
}

.brand-block {
  min-height: 64px;
  padding: 10px 10px 18px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
}

.brand-mark {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.brand-name {
  color: var(--text);
  font-size: 17px;
  letter-spacing: 0;
}

.brand-subtitle {
  color: var(--muted);
}

.nav-group {
  margin-bottom: 18px;
}

.nav-group h2 {
  color: #6d858c;
  font-size: 11px;
  letter-spacing: 0;
}

.nav-item {
  position: relative;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid transparent;
  color: var(--text);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.nav-item strong {
  color: inherit;
  font-size: 13px;
}

.nav-item small {
  color: var(--muted);
  font-size: 11px;
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: #49737a;
}

.nav-icon svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active,
.nav-item:hover {
  background: #ffffff;
  border-color: rgba(27, 167, 132, 0.22);
  color: var(--accent-strong);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.08);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 99px;
  background: var(--accent);
}

.nav-item.is-active .nav-icon,
.nav-item:hover .nav-icon {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: rgba(27, 167, 132, 0.28);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(15, 118, 110, 0.14);
  backdrop-filter: blur(14px);
}

.topbar-title-block {
  min-width: 0;
}

.topbar h1 {
  font-size: 22px;
  letter-spacing: 0;
}

.eyebrow,
.page-kicker {
  color: var(--accent-strong);
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  place-items: center;
  color: #49737a;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.icon-button:hover {
  background: var(--accent-soft);
  border-color: rgba(27, 167, 132, 0.28);
  color: var(--accent-strong);
}

.tenant-switcher,
.user-chip {
  background: var(--surface-soft);
  border-color: rgba(15, 118, 110, 0.14);
}

.logout-button,
.filter-reset,
.button-link-secondary,
.table-action-danger {
  background: #ffffff;
}

.logout-button:hover,
.filter-reset:hover,
.button-link-secondary:hover,
.table-action-danger:hover {
  border-color: rgba(27, 167, 132, 0.3);
  color: var(--accent-strong);
}

.page-header-panel,
.module-summary-card,
.metric-card,
.workbench-section,
.module-map,
.list-panel,
.resource-form-panel,
.info-panel,
.timeline,
.json-panel {
  border-color: rgba(15, 118, 110, 0.14);
  box-shadow: var(--shadow-soft);
}

.page-header-panel {
  min-height: 118px;
  background:
    linear-gradient(90deg, rgba(223, 245, 240, 0.82), rgba(255, 255, 255, 0.96) 34%),
    #ffffff;
}

.page-header-panel h2 {
  color: var(--text);
  font-size: 21px;
}

.page-header-panel button,
.button-link,
.filter-bar .filter-primary,
.form-actions button,
.table-action-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(27, 167, 132, 0.18);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.page-header-panel button:hover,
.button-link:hover,
.filter-bar .filter-primary:hover,
.form-actions button:hover,
.table-action-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.page-header-panel button:active,
.button-link:active,
.filter-bar .filter-primary:active,
.form-actions button:active,
.table-action-button:active {
  transform: translateY(1px);
}

.module-summary-card,
.metric-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 251, 0.96)),
    #ffffff;
}

.module-summary-card strong,
.metric-value {
  color: #12343b;
  font-weight: 900;
}

.filter-bar {
  align-items: end;
  background: var(--surface-soft);
  border-bottom-color: rgba(15, 118, 110, 0.12);
}

.filter-bar label {
  min-width: 156px;
}

.filter-bar select,
.filter-bar input,
.resource-form-grid input,
.resource-form-grid select,
.sync-interval-control input {
  border-color: var(--line);
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.filter-bar select:focus,
.filter-bar input:focus,
.resource-form-grid input:focus,
.resource-form-grid select:focus,
.sync-interval-control input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: var(--focus-ring);
}

.resource-table th {
  background: #f2faf8;
  color: #506b72;
  font-size: 11px;
  letter-spacing: 0;
}

.resource-table td {
  color: #1f3d45;
  font-size: 13px;
}

.resource-table tbody tr:hover {
  background: #f7fcfb;
}

.table-link {
  color: var(--accent-strong);
}

.table-action-danger {
  border-color: rgba(180, 35, 24, 0.42);
  color: var(--danger);
  box-shadow: none;
}

.status-badge {
  border: 1px solid rgba(96, 117, 125, 0.16);
  background: #eef5f4;
  color: #49666f;
}

.status-success {
  border-color: rgba(21, 127, 63, 0.2);
  background: #e6f8ec;
  color: var(--success);
}

.status-warning {
  border-color: rgba(180, 83, 9, 0.22);
  background: #fff6df;
  color: var(--warning);
}

.status-danger {
  border-color: rgba(180, 35, 24, 0.2);
  background: #fff1f1;
  color: var(--danger);
}

.section-heading {
  background: var(--surface-soft);
  border-bottom-color: rgba(15, 118, 110, 0.12);
}

.info-list div,
.action-log-list div {
  border-color: rgba(15, 118, 110, 0.12);
}

.empty-state {
  background: #f7fcfb;
  border-color: rgba(15, 118, 110, 0.14);
  color: var(--muted);
}

.integration-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  overflow-x: auto;
}

.integration-tabs a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.integration-tabs a.is-active {
  background: var(--accent);
  color: #ffffff;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
}

.resource-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.resource-table th,
.resource-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.resource-table th {
  background: #f8fafb;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.resource-table td {
  color: var(--text);
  font-size: 13px;
}

.resource-table tbody tr:hover {
  background: #fbfcfd;
}

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

.table-link {
  color: var(--accent);
  font-weight: 800;
}

.sync-setting-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.sync-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.sync-interval-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sync-interval-control input {
  width: 64px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

.sync-interval-control em {
  color: var(--muted);
  font-style: normal;
}

.table-action-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.table-action-danger {
  background: #ffffff;
  border-color: var(--danger);
  color: var(--danger);
}

.table-action-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-action-form {
  margin: 0;
}

.resource-form-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.resource-form {
  display: grid;
}

.form-section-heading {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.form-section-heading h2 {
  margin: 0;
  font-size: 16px;
}

.resource-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
}

.resource-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.resource-form-grid input,
.resource-form-grid select {
  min-height: 38px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.form-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 0 16px 16px;
}

.form-toggle-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.form-toggle-grid input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.permission-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  padding: 16px;
}

.permission-check-group {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}

.permission-check-group legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.permission-check-group label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.permission-check-group input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.permission-check-group small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.form-actions button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef3f6;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.status-success {
  background: #dcfce7;
  color: var(--success);
}

.status-warning {
  background: #fef3c7;
  color: var(--warning);
}

.status-danger {
  background: #fee4e2;
  color: var(--danger);
}

.api-alert,
.empty-state {
  border: 1px solid #fee2e2;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.api-alert {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
  display: grid;
  gap: 4px;
}

.list-panel > .api-alert {
  margin: 14px 16px;
}

.api-alert strong {
  color: #7c2d12;
  font-size: 14px;
}

.api-alert span,
.empty-state {
  font-size: 13px;
}

.empty-state {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ecfdf3;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
  padding: 12px 14px;
}

.flash-alert {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.detail-grid article {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

.detail-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.45;
}

.order-command-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  margin-top: 16px;
}

.order-status-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.order-status-summary article {
  min-height: 94px;
  padding: 16px;
  border-right: 1px solid rgba(15, 118, 110, 0.12);
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
}

.order-status-summary article:nth-child(3n) {
  border-right: 0;
}

.order-status-summary article:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.order-status-summary span,
.order-action-rail span,
.flow-step span,
.exception-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-status-summary strong,
.order-action-rail strong,
.flow-step strong,
.exception-list strong {
  display: block;
  margin-top: 9px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.order-action-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.order-action-rail form {
  margin: 0;
}

.order-action-rail button {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.order-action-rail button:disabled {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.order-status-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.flow-step {
  position: relative;
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.flow-step::before {
  content: "";
  display: block;
  width: 28px;
  height: 4px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--line-strong);
}

.flow-step-done::before {
  background: var(--success);
}

.flow-step-current::before {
  background: var(--accent);
}

.flow-step-warning::before {
  background: var(--warning);
}

.flow-step-warning {
  border-color: rgba(180, 83, 9, 0.26);
  background: #fffdf5;
}

.flow-step p,
.exception-list p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.order-exception-panel {
  margin-top: 16px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.exception-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.exception-list article {
  min-height: 102px;
  padding: 14px 16px;
  border-right: 1px solid rgba(15, 118, 110, 0.12);
}

.exception-list article:last-child {
  border-right: 0;
}

.sku-map-command-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  margin-top: 16px;
}

.mapping-resolution-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.resolution-step,
.candidate-panel {
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.resolution-step {
  min-height: 132px;
  padding: 14px 16px;
}

.resolution-step::before {
  content: "";
  display: block;
  width: 28px;
  height: 4px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--accent);
}

.resolution-step span,
.candidate-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.resolution-step strong,
.candidate-list strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.resolution-step p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.candidate-list {
  display: grid;
}

.candidate-list div {
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
}

.candidate-list div:last-child {
  border-bottom: 0;
}

.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 14px;
  margin-top: 16px;
}

.timeline,
.json-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.timeline-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.timeline-row:last-child {
  border-bottom: 0;
}

.timeline-row time {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

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

.timeline-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.json-panel pre {
  margin: 0;
  min-height: 180px;
  padding: 16px;
  overflow: auto;
  background: #111827;
  color: #d1fae5;
  font-size: 13px;
  line-height: 1.6;
}

.raw-payload-panel summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.info-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.info-list div,
.action-log-list div {
  min-height: 72px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-list div:nth-child(2n) {
  border-right: 0;
}

.info-list div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.info-list span,
.action-log-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.info-list strong,
.action-log-list strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.45;
}

.action-log-list p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.action-log-list div {
  border-right: 0;
}

.action-log-list div:last-child {
  border-bottom: 0;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #edf8f6;
}

.login-panel {
  --login-primary: var(--accent);
  --login-primary-strong: var(--accent-strong, #0f766e);
  --login-primary-soft: var(--accent-soft);
  --login-border: #cfdedc;
  --login-placeholder: #9aa4b2;
  width: min(540px, 100%);
  padding: 36px 40px 32px;
  border: 2px solid var(--login-primary);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 118, 110, 0.12);
}

.login-product {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.login-product-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--login-primary);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.login-product-name,
.login-product-subtitle {
  display: block;
}

.login-product-name {
  color: #17323a;
  font-size: 19px;
  line-height: 1.25;
}

.login-product-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel h1 {
  margin: 0 0 28px;
  color: #202733;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label {
  display: grid;
  gap: 9px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.login-form input[type="text"],
.login-form input[type="tel"],
.login-form input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--login-border);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.login-form input[type="text"]::placeholder,
.login-form input[type="tel"]::placeholder,
.login-form input[type="password"]::placeholder {
  color: var(--login-placeholder);
}

.login-form input[type="text"]:focus,
.login-form input[type="tel"]:focus,
.login-form input[type="password"]:focus {
  border-color: var(--login-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.login-form input::-ms-clear,
.login-form input::-ms-reveal {
  display: none;
}

.login-form input::-webkit-contacts-auto-fill-button,
.login-form input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
}

.login-password-field {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--login-border);
  border-radius: 7px;
  background: #ffffff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.login-password-field:focus-within {
  border-color: var(--login-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.login-form .login-password-field input[type="password"],
.login-form .login-password-field input[type="text"] {
  min-width: 0;
  min-height: 46px;
  border: 0;
  box-shadow: none;
}

.login-password-input.is-masked {
  -webkit-text-security: disc;
}

.login-form .login-password-field input[type="password"]:focus,
.login-form .login-password-field input[type="text"]:focus {
  border-color: transparent;
  box-shadow: none;
}

.login-password-toggle {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  border: 0;
  border-left: 1px solid var(--login-border);
  background: transparent;
  color: #60757d;
  cursor: pointer;
}

.login-password-toggle:hover {
  color: var(--login-primary);
}

.login-eye-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-eye-icon[hidden] {
  display: none;
}

.login-form input[type="submit"],
.login-code-button {
  min-height: 50px;
  border: 1px solid var(--login-primary);
  border-radius: 7px;
  background: var(--login-primary);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(15, 118, 110, 0.24);
  transition: background 0.16s ease, transform 0.16s ease;
}

.login-form input[type="submit"]:hover,
.login-code-button:hover {
  background: var(--login-primary-strong);
}

.login-form input[type="submit"]:active,
.login-code-button:active {
  transform: translateY(1px);
}

.login-label-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.login-inline-link {
  color: var(--login-primary);
  font-size: 14px;
  font-weight: 700;
}

.login-forgot-row {
  margin-top: -8px;
  text-align: right;
  font-size: 14px;
  line-height: 1;
}

.login-forgot-row a,
.login-agreement a,
.login-account-footer a,
.login-switch-link {
  color: var(--login-primary);
}

.login-flash-stack {
  display: grid;
  gap: 10px;
  margin: -10px 0 20px;
}

.login-agreement {
  display: flex !important;
  align-items: flex-start;
  gap: 10px !important;
  color: #263242;
  font-size: 14px !important;
  line-height: 1.4;
}

.login-agreement input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--login-primary);
}

.login-code-control {
  display: grid;
  gap: 6px;
}

.login-code-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.login-code-row input[type="text"] {
  min-width: 0;
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.login-code-button {
  width: 116px;
  min-height: 48px;
  flex: 0 0 116px;
  border-color: var(--login-border);
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: #ffffff;
  color: var(--login-primary);
  box-shadow: none;
}

.login-code-button:hover {
  background: #f4fbfa;
  color: var(--login-primary);
}

.login-code-button:disabled {
  background: #eef8f6;
  color: #6e898f;
  cursor: not-allowed;
}

.login-code-row:focus-within .login-code-button {
  border-color: var(--login-primary);
}

.login-code-hint {
  margin-top: -3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.login-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  color: #536071;
  font-size: 14px;
}

.login-switch-link {
  font-weight: 500;
}

.login-account-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  color: #536071;
  font-size: 14px;
}

.login-footer-divider {
  color: #536071;
}

@media (max-width: 1100px) {
  .oms-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .metric-grid,
  .operations-grid,
  .module-grid,
  .module-summary-grid,
  .order-workflow-board,
  .sku-mapping-workbench,
  .detail-grid,
  .detail-columns,
  .order-command-center,
  .order-status-summary,
  .order-status-flow,
  .exception-list,
  .sku-map-command-center,
  .mapping-resolution-steps {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .order-action-rail,
  .candidate-panel {
    grid-column: 1 / -1;
  }

  .order-status-summary article:nth-child(3n) {
    border-right: 1px solid rgba(15, 118, 110, 0.12);
  }

  .order-status-summary article:nth-child(2n) {
    border-right: 0;
  }

  .order-status-summary article:nth-last-child(-n + 3) {
    border-bottom: 1px solid rgba(15, 118, 110, 0.12);
  }

  .order-status-summary article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .module-grid div:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .module-grid div:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 760px) {
  .login-page {
    padding: 16px;
  }

  .login-panel {
    padding: 28px 24px 26px;
  }

  .login-product {
    margin-bottom: 24px;
  }

  .login-panel h1 {
    margin-bottom: 24px;
    font-size: 24px;
    white-space: nowrap;
  }

  .login-form {
    gap: 16px;
  }

  .login-form label {
    gap: 8px;
    font-size: 15px;
  }

  .login-form input[type="text"],
  .login-form input[type="tel"],
  .login-form input[type="password"] {
    min-height: 46px;
    padding: 0 13px;
    font-size: 15px;
  }

  .login-form input[type="submit"],
  .login-code-button {
    min-height: 48px;
    font-size: 15px;
  }

  .login-forgot-row {
    font-size: 14px;
  }

  .login-agreement {
    font-size: 14px !important;
  }

  .login-agreement input {
    width: 16px;
    height: 16px;
  }

  .login-inline-link,
  .login-action-row,
  .login-account-footer {
    font-size: 14px;
  }

  .login-code-button {
    width: 104px;
    flex-basis: 104px;
    padding: 0 10px;
    font-size: 14px;
  }

  .login-account-footer {
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 38px;
  }

  .oms-layout {
    display: block;
  }

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

  .topbar,
  .topbar-actions {
    align-items: stretch;
  }

  .topbar {
    display: grid;
  }

  .content-area {
    padding: 16px;
  }

  .metric-grid,
  .operations-grid,
  .module-grid,
  .module-summary-grid,
  .order-workflow-board,
  .sku-mapping-workbench,
  .detail-grid,
  .detail-columns,
  .order-command-center,
  .order-status-summary,
  .order-status-flow,
  .exception-list,
  .sku-map-command-center,
  .mapping-resolution-steps {
    grid-template-columns: 1fr;
  }

  .page-header-panel,
  .filter-bar {
    display: grid;
  }

  .filter-spacer {
    display: none;
  }

  .module-grid div,
  .module-grid div:nth-child(2n),
  .module-grid div:nth-child(3n) {
    border-right: 0;
  }

  .module-grid div:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .module-grid div:last-child {
    border-bottom: 0;
  }

  .order-status-summary article,
  .order-status-summary article:nth-child(2n),
  .order-status-summary article:nth-child(3n) {
    border-right: 0;
  }

  .order-status-summary article:nth-last-child(-n + 2) {
    border-bottom: 1px solid rgba(15, 118, 110, 0.12);
  }

  .order-status-summary article:last-child,
  .exception-list article:last-child {
    border-bottom: 0;
  }

  .exception-list article {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 118, 110, 0.12);
  }
}
