:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-muted: #eef3f1;
  --ink: #17211f;
  --muted: #697773;
  --line: #dbe4e1;
  --primary: #1d6b5f;
  --primary-dark: #134d45;
  --accent: #bf6b25;
  --info: #2c5c91;
  --danger: #b63d45;
  --shadow: 0 18px 45px rgba(25, 45, 41, 0.12);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background: #18332f;
  color: #f7fbfa;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: #d98d3f;
  border-radius: 8px;
  color: #17211f;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.panel-heading h3,
.eyebrow {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  margin-top: 4px;
  color: rgba(247, 251, 250, 0.68);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(247, 251, 250, 0.78);
  text-align: left;
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-item.active-soft {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(247, 251, 250, 0.9);
}

.nav-caret {
  margin-left: auto;
  color: rgba(247, 251, 250, 0.72);
}

.submenu {
  display: grid;
  gap: 5px;
  padding-left: 32px;
}

.submenu-item {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(247, 251, 250, 0.72);
  text-align: left;
}

.submenu-item:hover,
.submenu-item.active {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
}

.sidebar-note {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-note span {
  color: rgba(247, 251, 250, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar h2 {
  margin-top: 5px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.14;
}

.top-actions,
.toolbar,
.segmented,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-button,
.primary-button,
.icon-button,
.segmented button,
.row-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.ghost-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
}

.ghost-button:hover,
.icon-button:hover,
.row-actions button:hover {
  border-color: #a9b9b5;
  background: #f9fbfa;
}

.ghost-button.danger {
  color: var(--danger);
}

.primary-button {
  width: 100%;
  margin-top: 4px;
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button.inline {
  width: auto;
  min-width: 150px;
  margin-top: 0;
  padding: 0 16px;
}

.inventory-add-variant-button {
  min-width: 92px;
  border-color: #1d6fe8;
  background: #1d6fe8;
  color: #ffffff;
}

.inventory-add-variant-button:hover {
  border-color: #1557ba;
  background: #1557ba;
}

.ghost-button.small,
.primary-button.small {
  width: auto;
  min-width: 58px;
  min-height: 30px;
  margin-top: 0;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
}

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

.dashboard-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.desktop-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.desktop-card h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.account-profile div:last-child {
  display: grid;
  gap: 5px;
}

.account-profile span {
  color: var(--muted);
  font-size: 13px;
}

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

.account-stats span {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.account-stats strong {
  color: var(--ink);
  font-size: 20px;
}

.desktop-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.desktop-list li {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #30413d;
  line-height: 1.55;
}

.metric-block {
  display: grid;
  gap: 7px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-block strong {
  font-size: 28px;
  line-height: 1;
}

.collector-panel,
.analysis-panel,
.reminder-panel,
.inventory-panel,
.form-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.collector-panel,
.analysis-panel,
.reminder-panel,
.inventory-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.form-panel {
  display: grid;
  gap: 15px;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h3 {
  margin-top: 4px;
  font-size: 20px;
}

.icon-button {
  display: grid;
  width: 38px;
  place-items: center;
}

label {
  display: grid;
  gap: 7px;
  color: #30413d;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  outline: none;
}

input,
select {
  padding: 0 11px;
}

textarea {
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 107, 95, 0.13);
}

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

.list-panel {
  min-width: 0;
  padding: 16px;
}

.toolbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.collector-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
}

.search-box,
.url-box {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.search-box span,
.url-box span {
  display: grid;
  width: 38px;
  place-items: center;
  color: var(--muted);
}

.search-box input,
.url-box input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.toolbar select {
  width: 150px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef3f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.loading {
  background: #eaf0fa;
  color: var(--info);
}

.status-pill.success {
  background: #e6f5ec;
  color: #25613c;
}

.status-pill.error {
  background: #fae9ec;
  color: var(--danger);
}

.company-result {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.result-main {
  display: grid;
  gap: 6px;
}

.result-main strong {
  font-size: 18px;
}

.result-main span {
  color: #30413d;
  line-height: 1.6;
}

.result-main a {
  color: var(--primary);
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.result-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.result-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-grid p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.analysis-result {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.analysis-result.single {
  grid-template-columns: 1fr;
}

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

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

.analytics-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

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

.analytics-card strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.analytics-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.analytics-filter-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

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

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

.analytics-chart-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.analytics-chart-panel h4 {
  margin: 0 0 12px;
  font-size: 15px;
}

.analytics-chart-bars {
  display: grid;
  gap: 10px;
}

.analytics-chart-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(120px, 2fr) minmax(86px, 1fr);
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.analytics-chart-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5efec;
}

.analytics-chart-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.muted-chart .analytics-chart-track i {
  background: #9ca3af;
}

.analytics-pie-list {
  display: grid;
  gap: 8px;
}

.analytics-pie-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
}

.analytics-pie-row em {
  color: var(--muted);
  font-style: normal;
}

.analytics-list {
  display: grid;
  gap: 8px;
}

.analytics-list div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.score-block {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 126px;
  border: 1px solid rgba(29, 107, 95, 0.2);
  border-radius: 8px;
  background: #ffffff;
}

.score-block strong {
  color: var(--primary-dark);
  font-size: 44px;
  line-height: 1;
}

.score-block span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.analysis-summary {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.analysis-summary h4 {
  margin: 0;
  font-size: 18px;
}

.analysis-summary p {
  margin: 0;
  color: #30413d;
  line-height: 1.7;
}

.dimension-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dimension-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

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

.analysis-columns div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.analysis-columns ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #30413d;
  line-height: 1.55;
}

.reminder-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) 190px 130px minmax(220px, 1.4fr) auto;
  gap: 12px;
}

.reminder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reminder-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reminder-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
}

.reminder-metrics strong {
  color: var(--ink);
}

.reminder-toolbar select {
  width: 130px;
}

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

.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #ffffff;
}

.reminder-item.overdue {
  border-left-color: var(--danger);
  background: #fffafb;
}

.reminder-item.done {
  border-left-color: #a9b9b5;
  background: #f8faf9;
  opacity: 0.78;
}

.reminder-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.reminder-main strong {
  font-size: 15px;
}

.reminder-main span {
  color: #30413d;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.reminder-main small {
  color: var(--muted);
}

.inventory-filter {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f9f8;
}

.inventory-filter label {
  gap: 6px;
  font-size: 13px;
}

.inventory-filter-actions {
  display: flex;
  gap: 8px;
}

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

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-group button,
.inventory-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.action-group button:hover,
.inventory-tabs button:hover {
  border-color: #a9b9b5;
  background: #f9fbfa;
}

.inventory-actions select {
  width: 180px;
}

.inventory-table-wrap {
  overflow: auto;
  border: 1px solid #cfd8d5;
  border-radius: 8px;
  background: #ffffff;
}

.inventory-product-list {
  --inventory-product-list-header-height: 39px;
  --inventory-product-list-row-height: 75px;
  max-height: calc(var(--inventory-product-list-header-height) + (var(--inventory-product-list-row-height) * 10));
  overflow-y: auto;
}

.inventory-product-list .inventory-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.inventory-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.inventory-table th,
.inventory-table td {
  padding: 8px 9px;
  border-right: 1px solid #d5ddda;
  border-bottom: 1px solid #d5ddda;
  font-size: 13px;
  white-space: nowrap;
}

.inventory-table th {
  background: #f2f4f4;
  color: #17211f;
  font-weight: 800;
}

.inventory-table td {
  color: #30413d;
}

.inventory-table tbody tr {
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.inventory-table tbody tr:hover {
  background: #f8fbff;
}

.inventory-table tbody tr.selected-row {
  background: #eaf3ff;
  box-shadow: inset 3px 0 0 #2c5c91;
}

.inventory-table .emphasis,
.stock-zero,
.inventory-note {
  color: #e00000;
}

.stock-low {
  color: #bf6b25;
  font-weight: 800;
}

.stock-ok {
  color: #155b52;
  font-weight: 800;
}

.product-thumb {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid #bfc9c6;
  background: #ffffff;
}

.product-thumb.small {
  width: 42px;
  height: 42px;
}

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

.inventory-detail {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.inventory-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #f6f9f8;
}

.inventory-tabs button {
  border-width: 0 1px 0 0;
  border-radius: 0;
  color: #53615e;
}

.inventory-tabs button.active {
  background: #ffffff;
  color: #0c61c9;
  font-weight: 800;
}

.inventory-table-wrap.compact {
  border: 0;
  border-radius: 0;
}

.inventory-table.detail {
  min-width: 1180px;
}

.order-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.order-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

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

.order-table th {
  background: #f6f9f8;
  color: #30413d;
  font-size: 12px;
  font-weight: 800;
}

.select-col {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.select-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
}

.order-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.manual-create-form {
  display: grid;
  gap: 14px;
}

.manual-create-section {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.manual-create-section legend {
  padding: 0 6px;
  color: #17211f;
  font-weight: 800;
}

.exchange-product-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.exchange-product-filter label {
  gap: 6px;
  font-size: 13px;
}

.exchange-product-filter button {
  min-height: 40px;
  white-space: nowrap;
}

.invoice-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
  margin: 12px 0;
}

.invoice-preview-card {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.invoice-preview-card img {
  width: 100%;
  max-height: 420px;
  border: 1px solid #d9e2df;
  border-radius: 6px;
  object-fit: contain;
  cursor: zoom-in;
  background: #f3f6f5;
}

.invoice-preview-card figcaption,
.file-card-body {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.invoice-preview-card figcaption strong,
.file-card-body strong {
  color: var(--ink);
  font-size: 13px;
}

.file-card-body {
  min-height: 180px;
  place-content: center;
  border: 1px dashed #b8c9c4;
  border-radius: 6px;
  background: #eef5f3;
  text-align: center;
}

.invoice-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 20, 18, 0.72);
}

.invoice-zoom-panel {
  display: grid;
  gap: 12px;
  width: min(1180px, 96vw);
  max-height: 92vh;
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
}

.invoice-zoom-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.invoice-zoom-heading span {
  color: var(--muted);
  font-size: 12px;
}

.invoice-zoom-panel img {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.manual-create-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.manual-create-grid .wide {
  grid-column: span 4;
}

.manual-create-customer-field {
  position: relative;
}

.manual-create-customer-results {
  display: grid;
  gap: 6px;
  max-height: 168px;
  margin-top: 8px;
  overflow-y: auto;
}

.manual-create-customer-result {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.manual-create-customer-result:hover {
  border-color: rgba(29, 107, 95, 0.35);
  background: var(--surface-muted);
}

.manual-create-customer-result strong,
.manual-create-customer-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-create-customer-result span,
.manual-create-empty {
  color: var(--muted);
  font-size: 12px;
}

.manual-create-empty {
  margin: 0;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.manual-product-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.manual-product-picker {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.inventory-variant-picker {
  grid-template-columns: repeat(2, minmax(160px, 1fr)) auto;
  margin-bottom: 12px;
}

.inventory-variant-table {
  min-width: 900px;
}

.inventory-variant-table input {
  min-width: 92px;
}

.inventory-note-grid {
  margin-top: 12px;
}

.after-sales-tabs {
  margin-bottom: 12px;
}

.after-sales-evidence {
  display: flex;
  gap: 6px;
  align-items: center;
}

.manual-create-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 12px;
  color: #30413d;
}

.manual-create-summary strong {
  color: #e00000;
}

.manual-create-submit-row {
  display: flex;
  justify-content: flex-end;
}

.manual-create-submit-row .primary-button {
  min-width: 128px;
}

.manual-create-table {
  min-width: 1120px;
}

.manual-edit-table {
  min-width: 1360px;
}

.manual-edit-input {
  width: 120px;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.manual-edit-input.wide-input {
  width: 180px;
}

.manual-edit-input.number {
  width: 86px;
}

.line-number-input {
  width: 72px;
  min-height: 28px;
}

.segmented {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.segmented button {
  padding: 0 12px;
  color: var(--muted);
}

.segmented button.active {
  border-color: rgba(29, 107, 95, 0.35);
  background: var(--surface-muted);
  color: var(--primary-dark);
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 830px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f6f9f8;
  color: #53615e;
  font-size: 12px;
  font-weight: 800;
}

td {
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

#customerTable tr {
  cursor: pointer;
}

#customerTable tr:hover td {
  background: #f8fbfa;
}

#manualOrderTable tr[data-order-no] {
  cursor: pointer;
}

#manualOrderTable tr[data-order-no]:hover td {
  background: #f8fbfa;
}

.customer-main {
  display: grid;
  gap: 5px;
}

.customer-main strong {
  font-size: 15px;
}

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

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.key {
  background: #fff2df;
  color: #8a4f19;
}

.tag.normal {
  background: #e8f4f2;
  color: #155b52;
}

.tag.prospect {
  background: #eaf0fa;
  color: #244f82;
}

.tag.vendor {
  background: #f0edf7;
  color: #59417e;
}

.tag.active {
  background: #e6f5ec;
  color: #25613c;
}

.tag.follow {
  background: #fff6db;
  color: #7b5a10;
}

.tag.paused {
  background: #fae9ec;
  color: #8a2b36;
}

.actions-col {
  width: 128px;
}

.row-actions button {
  width: 36px;
  min-height: 34px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  margin-top: 12px;
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.customer-detail-panel {
  display: grid;
  gap: 10px;
}

.customer-subpage {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.subpage-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.subpage-header h3 {
  margin: 4px 0;
  font-size: 24px;
}

.subpage-header span {
  color: var(--muted);
  font-size: 13px;
}

.customer-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.customer-profile-grid div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.customer-profile-grid .wide {
  grid-column: span 2;
}

.customer-profile-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-profile-grid strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.detail-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.detail-toolbar label {
  width: 180px;
}

.detail-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap.compact {
  box-shadow: none;
}

.order-detail-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.order-detail-table th,
.order-detail-table td {
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}

.order-detail-table th {
  background: #f6f9f8;
  color: #30413d;
  font-weight: 800;
}

.order-note-input {
  min-width: 160px;
  min-height: 32px;
}

.hidden {
  display: none !important;
}

.permission-hidden {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #edf2f0;
}

.auth-dialog {
  width: min(440px, 100%);
  padding: 32px;
  border: 1px solid #cfdbd7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(17, 54, 49, 0.16);
}

.auth-dialog h1 {
  margin: 10px 0 8px;
  font-size: 26px;
}

.auth-description {
  margin: 0 0 22px;
  color: #60716d;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label,
.employee-form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.auth-form input,
.employee-form-grid input,
.employee-form-grid select,
.permission-module select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #ced9d5;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #142a26;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: #176f63;
}

.auth-message.error {
  color: #b42318;
}

.password-overlay {
  background: rgba(19, 45, 40, 0.48);
}

.password-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.password-dialog-actions .primary-button {
  min-width: 112px;
}

.current-employee {
  color: #49615b;
  font-size: 13px;
}

.employee-management {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #d6e0dd;
  border-radius: 8px;
  background: #fff;
}

.employee-heading-actions,
.employee-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.employee-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.employee-list-panel,
.employee-editor,
.permission-audit-panel {
  min-width: 0;
  border-top: 1px solid #d6e0dd;
  padding-top: 14px;
}

.employee-list-panel tbody tr {
  cursor: pointer;
}

.employee-form {
  display: grid;
  gap: 16px;
}

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

.employee-active-field {
  display: flex !important;
  align-items: center;
  align-self: end;
  min-height: 40px;
}

.employee-active-field input {
  width: 18px;
  min-height: 18px;
}

.permission-tree {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  border-top: 1px solid #d6e0dd;
  border-bottom: 1px solid #d6e0dd;
  padding: 12px 0;
}

.permission-module {
  display: grid;
  gap: 8px;
}

.permission-module-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: #f1f5f3;
}

.permission-module-heading select {
  width: 160px;
  min-height: 34px;
}

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

.permission-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #dce5e2;
  border-radius: 6px;
}

.permission-item span,
.permission-item small {
  display: block;
  min-width: 0;
}

.permission-item small {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #6d7e79;
  font-weight: 400;
}

.audit-list {
  display: grid;
  gap: 6px;
}

.audit-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 180px;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e4ebe9;
}

.audit-item time {
  color: #657670;
  text-align: right;
}

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

@media (max-width: 720px) {
  .employee-form-grid,
  .permission-items {
    grid-template-columns: 1fr;
  }

  .audit-item {
    grid-template-columns: 1fr;
  }

  .audit-item time {
    text-align: left;
  }
}

@media (max-width: 1120px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: static;
    gap: 16px;
    padding: 16px;
  }

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

  .sidebar-note {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .collector-form {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .reminder-form {
    grid-template-columns: 1fr;
  }

  .reminder-toolbar,
  .reminder-item {
    align-items: stretch;
    flex-direction: column;
  }

  .reminder-toolbar select {
    width: 100%;
  }

  .inventory-filter {
    grid-template-columns: 1fr;
  }

  .inventory-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-actions select,
  .inventory-filter-actions button {
    width: 100%;
  }

  .order-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-create-grid,
  .exchange-product-filter,
  .manual-product-row {
    grid-template-columns: 1fr;
  }

  .manual-create-grid .wide {
    grid-column: auto;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions button,
  .toolbar select,
  .primary-button.inline {
    flex: 1;
    width: 100%;
  }

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

  .dashboard-panel {
    grid-template-columns: 1fr;
  }

  .analytics-grid,
  .analytics-grid.compact,
  .analytics-two-column,
  .analytics-three-column,
  .analytics-chart-grid,
  .analytics-filter-form {
    grid-template-columns: 1fr;
  }

  .analytics-chart-row {
    grid-template-columns: 1fr;
  }

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

  .detail-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .subpage-header {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-profile-grid {
    grid-template-columns: 1fr;
  }

  .customer-profile-grid .wide {
    grid-column: auto;
  }

  .detail-toolbar label {
    width: 100%;
  }

  .analysis-result,
  .analysis-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 14px;
  }

  .nav-list,
  .metrics,
  .two-column {
    grid-template-columns: 1fr;
  }

  .brand h1 {
    font-size: 16px;
  }

  .topbar h2 {
    font-size: 25px;
  }

  .collector-panel,
  .analysis-panel,
  .reminder-panel,
  .inventory-panel,
  .form-panel,
  .list-panel {
    padding: 14px;
  }
}
