:root {
  color-scheme: light;
  --ink: #0d1628;
  --ink-soft: #32455f;
  --muted: #607188;
  --line: rgba(80, 112, 168, 0.18);
  --line-strong: rgba(80, 112, 168, 0.28);
  --surface: rgba(247, 251, 255, 0.94);
  --surface-2: #f2f6fb;
  --surface-3: #eaf0f7;
  --canvas: #e5edf6;
  --canvas-deep: #dbe6f2;
  --blue: #225cff;
  --blue-soft: #d6e5ff;
  --cyan: #18c8ff;
  --cyan-soft: rgba(24, 200, 255, 0.14);
  --green: #0d8a68;
  --green-soft: #dcf6ee;
  --amber: #b7791f;
  --amber-soft: #fff2d6;
  --red: #b42318;
  --red-soft: #fde8e7;
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 16px 36px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.04);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 260px),
    linear-gradient(90deg, rgba(34, 92, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(34, 92, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, var(--canvas) 0%, var(--canvas-deep) 100%);
  background-size: auto, 40px 40px, 40px 40px, auto;
  background-position: 0 0, 0 0, 0 0, 0 0;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: transparent;
}

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

button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f6cff 0%, #1947ca 58%, #0e36ab 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(26, 76, 210, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
  white-space: nowrap;
}

button:hover {
  box-shadow: 0 18px 30px rgba(36, 88, 211, 0.26);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

button.ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

button.ghost:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

button.compact {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.danger {
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.18);
  background: linear-gradient(180deg, #fff, #fff5f4);
}

button.danger:hover {
  background: #fff1ef;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 22px 0;
  background: linear-gradient(180deg, rgba(238, 242, 247, 0.92) 0%, rgba(238, 242, 247, 0.72) 72%, rgba(238, 242, 247, 0) 100%);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: 1880px;
  margin: 0 auto;
  padding: 22px 26px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(249, 252, 255, 0.94), rgba(244, 249, 255, 0.84)),
    linear-gradient(135deg, rgba(34, 92, 255, 0.06), rgba(24, 200, 255, 0.05));
  box-shadow: var(--shadow-lg);
}

.brand-block {
  max-width: 760px;
}

.topbar h1 {
  margin: 8px 0 0;
  font-size: 36px;
  line-height: 1.08;
  font-weight: 650;
}

.topbar-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.eyebrow,
.section-kicker,
.module-kicker {
  margin: 0;
  color: #72809a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.identity-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(76, 110, 172, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(242, 247, 252, 0.92));
  min-width: 320px;
}

.identity-panel label {
  min-width: 190px;
  gap: 6px;
}

.identity-panel select {
  min-height: 40px;
}

.identity-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.identity-meta strong,
.identity-meta span {
  display: block;
}

.identity-meta strong {
  font-size: 13px;
  color: var(--ink);
}

.identity-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

main {
  display: grid;
  gap: 24px;
  max-width: 1880px;
  margin: 0 auto;
  padding: 22px 24px 36px;
}

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

.metric-button {
  text-align: left;
  cursor: pointer;
  min-height: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.94));
  color: var(--ink);
  white-space: normal;
}

.metric-button:hover {
  transform: translateY(-1px);
}

.metric-button.active {
  border-color: rgba(34, 92, 255, 0.28);
  box-shadow: 0 18px 32px rgba(34, 92, 255, 0.12);
}

.summary-detail {
  padding: 18px 20px 20px;
}

.summary-detail-head {
  margin-bottom: 14px;
}

.summary-documents-panel,
.stock-insight-panel {
  display: grid;
  gap: 16px;
}

.management-command-panel {
  display: grid;
  gap: 18px;
}

.management-top-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.management-priority-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.management-priority-panel > p,
.management-task-panel > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.management-priority-list {
  display: grid;
  gap: 14px;
}

.management-priority-item {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(76, 110, 172, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 253, 0.92));
}

.management-priority-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.management-priority-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.management-priority-head strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
}

.management-priority-count {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(34, 92, 255, 0.08);
  color: var(--blue);
  font-size: 20px;
  font-weight: 700;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.priority-p1 .priority-badge {
  background: var(--red-soft);
  color: var(--red);
}

.priority-p2 .priority-badge {
  background: var(--amber-soft);
  color: var(--amber);
}

.priority-p3 .priority-badge {
  background: var(--cyan-soft);
  color: #0f7ea5;
}

.management-mini-groups {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.management-mini-card {
  min-height: 0;
  padding: 14px;
  border-radius: 16px;
  display: grid;
  gap: 4px;
  justify-items: start;
}

.management-mini-card strong {
  font-size: 18px;
  line-height: 1;
}

.management-mini-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.summary-filters {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(170px, 210px) minmax(170px, 210px) minmax(220px, 260px);
  align-items: end;
}

.summary-filters label {
  display: grid;
  gap: 8px;
}

.summary-filters span {
  color: var(--muted);
  font-size: 12px;
}

.summary-search input,
.summary-filters select {
  width: 100%;
}

.summary-toggle button {
  min-height: 42px;
}

.summary-group-list {
  display: grid;
  gap: 14px;
}

.summary-group-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(76, 110, 172, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,248,253,0.92));
}

.summary-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.summary-group-head strong {
  font-size: 14px;
}

.summary-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.stock-value-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stock-insight-subpanel > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.metric,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: var(--shadow-md);
}

.metric {
  padding: 18px 18px 16px;
  border-radius: 20px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  line-height: 1;
  font-weight: 650;
  color: var(--ink);
}

.workspace {
  display: grid;
  gap: 24px;
  grid-template-columns: 284px minmax(0, 1fr);
  align-items: start;
}

.panel {
  padding: 20px;
  border-radius: var(--radius-xl);
}

.panel h2 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 650;
}

.panel p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.service-panel nav {
  display: grid;
  gap: 12px;
}

.service-card {
  position: relative;
  min-height: 0;
  padding: 14px 14px 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 249, 252, 0.95));
  color: var(--ink);
  text-align: left;
  white-space: normal;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 1px rgba(36, 88, 211, 0.12);
  transition: opacity 140ms ease;
}

.service-card:hover,
.service-card.active {
  transform: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 245, 255, 0.92));
  border-color: rgba(36, 88, 211, 0.18);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.06);
}

.service-card:hover::after,
.service-card.active::after {
  opacity: 1;
}

.service-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
}

.service-card small {
  display: block;
  color: var(--muted);
  line-height: 1.55;
  font-size: 12px;
}

.module-panel {
  min-height: 680px;
}

.module-panel.inventory-page {
  min-height: 760px;
}

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

.module-head h2 {
  font-size: 28px;
  margin: 6px 0 0;
}

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

.module-grid {
  display: grid;
  gap: 22px;
}

.module-grid.two {
  grid-template-columns: minmax(0, 1.42fr) minmax(360px, 0.86fr);
}

.subservice-nav {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.subservice-card {
  min-height: 92px;
  padding: 16px 16px 14px;
  border-radius: 20px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,248,253,0.94)),
    linear-gradient(135deg, rgba(34,92,255,0.028), rgba(24,200,255,0.022));
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.88);
}

.subservice-card.active {
  border-color: rgba(36, 88, 211, 0.22);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(233,241,255,0.96)),
    linear-gradient(135deg, rgba(34,92,255,0.06), rgba(24,200,255,0.03));
  box-shadow: 0 16px 30px rgba(20, 41, 83, 0.09);
}

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

.subservice-card strong {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 650;
}

.subservice-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.subservice-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(17, 30, 58, 0.045);
  color: var(--muted);
  font-size: 12px;
  font-weight: 580;
}

.subservice-count strong {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.sub-panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 253, 0.96)),
    linear-gradient(135deg, rgba(34, 92, 255, 0.03), rgba(24, 200, 255, 0.03));
}

.contract-priority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

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

.sales-support-grid,
.purchase-support-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.purchase-priority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.contract-priority-grid label,
.sales-priority-grid label,
.purchase-priority-grid label,
.sales-support-grid label,
.purchase-support-grid label,
.contract-scope-row label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contract-priority-grid span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.sales-priority-grid span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.purchase-priority-grid span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.sales-support-grid span,
.purchase-support-grid span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.contract-doc-head {
  margin-bottom: 16px;
}

.sales-doc-head {
  margin-bottom: 16px;
}

.purchase-doc-head {
  margin-bottom: 16px;
}

.contract-scope-row {
  margin-bottom: 4px;
}

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

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

.sub-panel h3,
.dispatch-board h3,
.module-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 650;
}

.nested-panel {
  margin-top: 14px;
}

.inventory-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.workflow-rail {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.workflow-step {
  min-height: 86px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, var(--surface-3));
}

.workflow-step.active {
  border-color: rgba(36, 88, 211, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(230, 239, 255, 0.92));
  box-shadow: inset 0 0 0 1px rgba(36, 88, 211, 0.08);
}

.workflow-step strong,
.workflow-step span {
  display: block;
}

.workflow-step strong {
  font-size: 14px;
}

.workflow-step span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.insight-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0 8px;
}

.insight-strip div,
.insight-strip button {
  min-height: 62px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--surface-2));
  color: var(--ink);
  text-align: left;
  white-space: normal;
  box-shadow: none;
}

.insight-strip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.insight-strip span {
  color: var(--muted);
  font-size: 12px;
}

.kpi-stack,
.check-list,
.dispatch-list {
  display: grid;
  gap: 10px;
}

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

.priority-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(76, 110, 172, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 252, 0.94)),
    linear-gradient(135deg, rgba(34, 92, 255, 0.03), rgba(24, 200, 255, 0.02));
}

.priority-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.priority-card-head span,
.priority-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.priority-card-head strong {
  font-size: 24px;
  line-height: 1;
  font-weight: 650;
  color: var(--ink);
}

.priority-card .compact {
  justify-self: flex-start;
}

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

.kpi-stack div,
.check-list div,
.dispatch-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--surface-2));
}

.dispatch-board.primary,
.outbound-primary-panel {
  border: 1px solid rgba(34, 92, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,248,255,0.96)),
    linear-gradient(135deg, rgba(34,92,255,0.025), rgba(24,200,255,0.02));
}

.outbound-secondary-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(247,249,252,0.92));
}

.outbound-primary-panel > p,
.outbound-secondary-panel > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.kpi-stack strong,
.kpi-stack span,
.check-list strong,
.check-list span,
.dispatch-card strong,
.dispatch-card span {
  display: block;
}

.kpi-stack strong {
  font-size: 22px;
  font-weight: 650;
}

.kpi-stack span,
.check-list span,
.dispatch-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.permission-form button {
  grid-column: span 2;
}

.upload-box {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(320px, 1fr) minmax(220px, 260px);
  gap: 18px;
  align-items: end;
}

.upload-box > button {
  min-height: 58px;
  padding: 0 26px;
  font-size: 17px;
  font-weight: 650;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(36, 88, 211, 0.38);
  box-shadow: 0 0 0 4px rgba(36, 88, 211, 0.12);
  background: #fff;
}

.file-drop {
  padding: 14px 16px;
  border: 1px dashed rgba(36, 88, 211, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.9), rgba(255, 255, 255, 0.96));
  min-height: 96px;
}

.file-drop input {
  display: none;
}

.file-drop span {
  color: var(--blue);
  font-weight: 600;
}

.file-drop strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.recognition {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(76, 110, 172, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 253, 0.98)),
    linear-gradient(135deg, rgba(34, 92, 255, 0.03), rgba(24, 200, 255, 0.035));
  box-shadow: 0 24px 48px rgba(13, 22, 40, 0.06);
}

.recognition.empty {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 247, 251, 0.94));
}

.recognition-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  align-items: start;
}

.recognition-side,
.recognition-main {
  min-width: 0;
}

.recognition-main {
  display: grid;
  gap: 16px;
}

.preview {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid rgba(84, 118, 181, 0.2);
  border-radius: 20px;
  background: #fff;
}

.preview.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: linear-gradient(180deg, #eef4ff, #f5f8fc);
  color: var(--blue);
  font-weight: 700;
}

.ocr-raw {
  margin-top: 12px;
}

.recognition-status {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(76, 110, 172, 0.14);
  background: rgba(12, 23, 41, 0.03);
  color: var(--ink-soft);
  line-height: 1.6;
}

.ocr-raw summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.ocr-raw pre {
  margin: 10px 0 0;
  max-height: 240px;
  overflow: auto;
  padding: 12px;
  border-radius: 14px;
  background: #142033;
  color: #edf4fb;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

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

.outbound-fields {
  margin-top: 12px;
}

.notice-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.notice {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(183, 121, 31, 0.18);
  border-left: 4px solid var(--amber);
  background: linear-gradient(180deg, #fffaf0, #fff4dc);
  color: #6d4713;
  line-height: 1.6;
}

.table-wrap {
  overflow-x: auto;
}

.recognition-table-wrap {
  overflow-x: auto;
}

.table-searchable {
  display: grid;
  gap: 12px;
}

.table-search {
  display: grid;
  align-items: center;
  gap: 8px;
  grid-template-columns: 96px minmax(0, 1fr);
}

.table-search span,
.table-search-meta {
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.docs-table {
  table-layout: fixed;
}

.docs-table th,
.docs-table td {
  white-space: normal;
  word-break: break-word;
}

.docs-table th:nth-child(1),
.docs-table td:nth-child(1) {
  width: 22%;
}

.docs-table th:nth-child(2),
.docs-table td:nth-child(2) {
  width: 8%;
  text-align: center;
}

.docs-table th:nth-child(3),
.docs-table td:nth-child(3) {
  width: 23%;
}

.docs-table th:nth-child(4),
.docs-table td:nth-child(4) {
  width: 11%;
}

.docs-table th:nth-child(5),
.docs-table td:nth-child(5) {
  width: 12%;
}

.docs-table th:nth-child(6),
.docs-table td:nth-child(6) {
  width: 14%;
}

.docs-table-actions th:nth-child(7),
.docs-table-actions td:nth-child(7) {
  width: 14%;
  min-width: 136px;
  text-align: center;
}

.docs-table-actions td:nth-child(7) {
  white-space: nowrap;
}

.docs-table-actions .danger.compact {
  min-width: 118px;
}

.finance-ledger-table {
  table-layout: auto;
  min-width: 1180px;
}

.finance-ledger-table th,
.finance-ledger-table td {
  white-space: nowrap;
  word-break: keep-all;
}

.finance-ledger-table th:nth-child(1),
.finance-ledger-table td:nth-child(1) {
  width: 22%;
}

.finance-ledger-table th:nth-child(2),
.finance-ledger-table td:nth-child(2) {
  width: 9%;
  text-align: center;
}

.finance-ledger-table th:nth-child(3),
.finance-ledger-table td:nth-child(3) {
  width: 31%;
}

.finance-ledger-table th:nth-child(4),
.finance-ledger-table td:nth-child(4) {
  width: 10%;
}

.finance-ledger-table th:nth-child(5),
.finance-ledger-table td:nth-child(5) {
  width: 11%;
}

.finance-ledger-table th:nth-child(6),
.finance-ledger-table td:nth-child(6) {
  width: 11%;
}

.finance-ledger-table th:nth-child(7),
.finance-ledger-table td:nth-child(7) {
  width: 12%;
}

.finance-ledger-table .party-cell {
  font-size: 13px;
  letter-spacing: 0;
}

.finance-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: start;
}

.finance-upload-panel,
.finance-ledger-panel,
.finance-side-stack > section,
.finance-side-stack > .finance-kpis {
  min-width: 0;
}

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

.finance-ledger-panel {
  grid-column: 1 / -1;
}

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

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.metric.compact {
  min-height: 128px;
  justify-content: center;
}

.metric.compact span {
  font-size: 13px;
}

.metric.compact strong {
  font-size: 34px;
}

.contract-meta-fields {
  margin-top: 12px;
}

.finance-ledger-table {
  min-width: 100%;
}

.finance-ledger-table th,
.finance-ledger-table td {
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}

.finance-ledger-table th:nth-child(1),
.finance-ledger-table td:nth-child(1) {
  width: 16%;
}

.finance-ledger-table th:nth-child(2),
.finance-ledger-table td:nth-child(2) {
  width: 14%;
  text-align: left;
}

.finance-ledger-table th:nth-child(3),
.finance-ledger-table td:nth-child(3) {
  width: 24%;
}

.finance-ledger-table th:nth-child(4),
.finance-ledger-table td:nth-child(4) {
  width: 14%;
}

.finance-ledger-table th:nth-child(5),
.finance-ledger-table td:nth-child(5) {
  width: 8%;
}

.finance-ledger-table th:nth-child(6),
.finance-ledger-table td:nth-child(6) {
  width: 8%;
}

.finance-ledger-table th:nth-child(7),
.finance-ledger-table td:nth-child(7) {
  width: 10%;
}

.finance-ledger-table th:nth-child(8),
.finance-ledger-table td:nth-child(8) {
  width: 14%;
}

.finance-party-stack,
.doc-type-stack {
  display: grid;
  gap: 4px;
}

.doc-no-cell strong,
.finance-payment-cell strong {
  display: block;
  line-height: 1.45;
}

.finance-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-row-actions .compact {
  min-width: 72px;
}

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

.finance-reminder-card,
.finance-reminders-empty {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(76, 110, 172, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 253, 0.96)),
    linear-gradient(135deg, rgba(34, 92, 255, 0.03), rgba(24, 200, 255, 0.025));
}

.finance-reminder-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.finance-reminder-top strong {
  font-size: 14px;
}

.finance-reminder-top span,
.finance-reminder-card small,
.finance-reminders-empty span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.finance-reminder-card p,
.finance-reminders-empty strong {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.6;
}

.finance-party-stack strong,
.doc-type-stack strong {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.finance-party-stack .cell-meta,
.doc-type-stack .cell-meta {
  margin-top: 0;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .finance-shell {
    grid-template-columns: 1fr;
  }

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

th,
td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #eef3f8, #e8eef5);
  color: var(--ink-soft);
  font-weight: 700;
}

td input {
  min-width: 0;
  width: 100%;
}

.cell-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.classification-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin: 0;
  align-items: stretch;
}

.classification-summary span {
  display: block;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(78, 110, 169, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 247, 252, 0.96)),
    linear-gradient(135deg, rgba(34, 92, 255, 0.03), rgba(24, 200, 255, 0.03));
  color: var(--ink);
  font-size: 12px;
  line-height: 1.65;
  min-height: 96px;
  white-space: normal;
  word-break: break-word;
}

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

.classification-card,
.category-stat-card,
.category-explain-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(76, 110, 172, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 253, 0.96)),
    linear-gradient(135deg, rgba(34, 92, 255, 0.025), rgba(24, 200, 255, 0.03));
}

.classification-card.pending {
  border-color: rgba(183, 121, 31, 0.28);
  box-shadow: inset 0 0 0 1px rgba(183, 121, 31, 0.08);
}

.classification-card strong,
.classification-card span,
.classification-card small,
.category-stat-card strong,
.category-stat-card span,
.category-stat-card small,
.category-explain-card strong,
.category-explain-card span,
.category-explain-card small {
  display: block;
}

.classification-card span,
.classification-card small,
.category-stat-card span,
.category-stat-card small,
.category-explain-card span,
.category-explain-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.category-dashboard {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

.category-stat-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-explain-grid {
  display: grid;
  gap: 12px;
}

.weight-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.weight-chip {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(36, 88, 211, 0.14);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
}

.operations {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

.inline-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr 120px;
}

.task-form {
  grid-template-columns: 160px 1fr 1.4fr 120px;
}

.project-task-table {
  margin-top: 14px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(13, 138, 104, 0.14);
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

.feed {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.feed-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, var(--surface-2));
}

.feed-item strong {
  display: block;
  font-size: 13px;
}

.feed-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.low {
  color: var(--red);
  font-weight: 700;
}

.ok {
  color: var(--green);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  border: 1px solid rgba(33, 178, 112, 0.18);
  background: rgba(33, 178, 112, 0.08);
}

.confirm-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}

.recognition-table {
  table-layout: auto;
  min-width: 1040px;
}

.recognition-table th,
.recognition-table td {
  padding: 12px 10px;
  min-width: 0;
}

.recognition-table th:nth-child(1),
.recognition-table td:nth-child(1) {
  min-width: 136px;
}

.recognition-table th:nth-child(2),
.recognition-table td:nth-child(2) {
  min-width: 220px;
}

.recognition-table th:nth-child(3),
.recognition-table td:nth-child(3) {
  min-width: 180px;
}

.recognition-table th:nth-child(4),
.recognition-table td:nth-child(4) {
  min-width: 88px;
}

.recognition-table th:nth-child(5),
.recognition-table td:nth-child(5) {
  min-width: 104px;
}

.recognition-table th:nth-child(6),
.recognition-table td:nth-child(6) {
  min-width: 118px;
}

.recognition-table th:nth-child(7),
.recognition-table td:nth-child(7) {
  min-width: 180px;
}

.recognition-table input {
  min-height: 48px;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  text-overflow: ellipsis;
}

.recognition-table input[data-field="qty"],
.recognition-table input[data-field="price"] {
  text-align: right;
  letter-spacing: 0;
}

.recognition-table input[data-field="unit"] {
  text-align: center;
}

@media (min-width: 1540px) {
  .summary-grid {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
  }

  .recognition-grid {
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  }

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

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

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

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

@media (max-width: 1100px) {
  .workspace,
  .operations,
  .module-grid.two,
  .management-priority-layout,
  .subservice-nav,
  .inventory-layout,
  .recognition-grid,
  .classification-grid,
  .classification-summary,
  .workflow-rail,
  .insight-strip,
  .priority-strip,
  .kpi-stack,
  .category-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .upload-box {
    grid-template-columns: minmax(180px, 220px) minmax(260px, 1fr);
  }

  .upload-box > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .recognition-table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 14px 14px 0;
  }

  .topbar-inner,
  .panel-head,
  .inventory-shortcut {
    flex-direction: column;
    align-items: stretch;
  }

  main {
    padding: 14px;
  }

  .summary-grid,
  .upload-box,
  .subservice-nav,
  .doc-fields,
  .management-top-strip,
  .management-mini-groups,
  .management-priority-layout,
  .inline-form,
  .task-form,
  .sales-support-grid,
  .purchase-support-grid,
  .module-grid.two,
  .inventory-layout,
  .recognition-grid,
  .classification-grid,
  .classification-summary,
  .workflow-rail,
  .insight-strip,
  .priority-strip,
  .kpi-stack,
  .permission-form,
  .category-stat-grid,
  .operations,
  .table-search {
    grid-template-columns: 1fr;
  }

  .permission-form button {
    grid-column: span 1;
  }

  .topbar h1 {
    font-size: 30px;
  }
}
