:root {
  --bg: #eef3ee;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --text: #13231d;
  --muted: #6c7e76;
  --line: #d9e5de;
  --accent: #16695e;
  --accent-strong: #0f4f47;
  --accent-soft: #dff4ee;
  --danger: #c2410c;
  --danger-soft: #fff3ea;
  --blue: #2563eb;
  --blue-soft: #eef4ff;
  --shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(22, 105, 94, 0.14), transparent 24%),
    linear-gradient(180deg, #f7faf8 0%, var(--bg) 100%);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 10%, rgba(22, 105, 94, 0.2), transparent 30%),
    radial-gradient(circle at 82% 80%, rgba(194, 65, 12, 0.12), transparent 26%),
    linear-gradient(135deg, #f8fbf8 0%, #edf4ef 100%);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 34px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14);
}

.login-kicker {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
}

.login-card p {
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.7;
}

.login-card .form-row {
  gap: 10px;
}

.login-card .form-row input {
  height: 52px;
  border-radius: 16px;
  font-size: 16px;
}

.login-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  justify-content: center;
  text-align: center;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: start;
}

.sidebar {
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.78);
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
}

.sidebar-card,
.panel,
.hero {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  border-radius: 24px;
  backdrop-filter: blur(12px);
}

.sidebar-card {
  padding: 18px;
  margin-bottom: 20px;
}

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

.sidebar-value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
}

.sidebar-tip {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  padding: 14px 16px;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.main {
  padding: 30px;
}

.hero {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.hero h1,
.panel h2 {
  margin: 0;
}

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

.inline-filter-bar,
.batch-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 18px 0;
}

.inline-filter-bar .form-row {
  min-width: 180px;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.filter-actions .secondary-btn,
.inline-filter-bar .filter-reset-btn {
  min-width: 104px;
}

.batch-toolbar {
  justify-content: flex-start;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fbfdfc;
}

.batch-toolbar span {
  color: var(--muted);
  font-weight: 700;
}

.batch-select-col {
  display: none;
  width: 58px;
  text-align: center;
}

.batch-mode .batch-select-col {
  display: table-cell;
}

.hero p,
.panel-tip {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.form-actions,
.manage-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.panel {
  padding: 24px;
}

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

.top-filter-panel,
.list-panel {
  margin-bottom: 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.layout-grid {
  display: grid;
  gap: 24px;
}

.audit-layout {
  grid-template-columns: 280px minmax(0, 1fr) 360px;
  align-items: start;
}

.content-stack {
  display: grid;
  gap: 24px;
}

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

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

.detail-layout {
  margin-top: 0;
}

.secondary-page {
  position: fixed;
  inset: 20px 20px 20px 300px;
  z-index: 50;
  padding: 8px;
  overflow: auto;
  background: rgba(238, 243, 238, 0.92);
  backdrop-filter: blur(14px);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.editor-panel {
  position: sticky;
  top: 24px;
}

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

.single-filter-grid {
  grid-template-columns: minmax(0, 320px);
}

.form-row {
  display: grid;
  gap: 8px;
}

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

.form-row input,
.select-input {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: var(--panel-strong);
  font-size: 14px;
  color: var(--text);
}

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

.split-actions {
  justify-content: space-between;
}

.primary-btn,
.secondary-btn,
.inline-btn {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  border: 0;
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.secondary-btn,
.inline-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

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

.audit-table {
  width: 100%;
  border-collapse: collapse;
}

.audit-table th,
.audit-table td {
  padding: 14px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.audit-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.audit-table td {
  font-size: 14px;
}

.row-active {
  background: #f4fbf8;
}

.compact-table td,
.compact-table th {
  white-space: nowrap;
}

.order-list,
.entry-list,
.process-form-list,
.settlement-order-list {
  display: grid;
  gap: 12px;
}

.order-card,
.entry-card,
.process-form-card,
.settlement-order-item {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.order-card,
.entry-card {
  padding: 16px;
}

.order-card {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.order-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.order-card.active {
  border-color: #83decf;
  box-shadow: 0 0 0 3px rgba(131, 222, 207, 0.2);
}

.order-card.error,
.entry-card.error,
.audit-row.error {
  background: var(--danger-soft);
  border-color: #f8c8b5;
}

.order-card.finalized,
.audit-row.locked {
  background: var(--blue-soft);
  border-color: #c7d9ff;
}

.order-thumb {
  width: 100%;
  height: 156px;
  object-fit: cover;
  border-radius: 14px;
  background: #eef3f1;
  margin-bottom: 12px;
}

.table-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef3f1;
}

.order-no,
.entry-name {
  font-size: 18px;
  font-weight: 800;
}

.order-sub,
.entry-meta,
.manage-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

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

.summary-card,
.meta-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f9fbfa;
  padding: 16px;
}

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

.summary-value {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 800;
}

.meta-value {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.subsection-title {
  margin: 22px 0 12px;
  font-size: 16px;
  font-weight: 800;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
}

.status-chip.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-chip.ok {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-chip.locked {
  background: var(--blue-soft);
  color: var(--blue);
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.process-form-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr 0.8fr auto;
  gap: 10px;
  align-items: end;
  padding: 16px;
}

.process-add-btn {
  width: fit-content;
}

.image-preview-card {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fafdfc;
  display: grid;
  gap: 12px;
}

.image-preview,
.detail-image {
  width: 100%;
  border-radius: 18px;
  background: #eef3f1;
}

.image-preview {
  max-height: 220px;
  object-fit: contain;
}

.order-detail-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}

.detail-image-card {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fafdfc;
  display: grid;
  gap: 12px;
}

.detail-image {
  height: 180px;
  object-fit: cover;
}

.detail-image-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.empty-inline {
  color: var(--muted);
  font-size: 14px;
}

.settlement-order-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
}

.settlement-order-item input {
  margin-top: 4px;
}

.settlement-order-meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.worker-entry-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 6px 0;
  color: var(--text);
}

.worker-entry-line span {
  color: var(--muted);
}

.worker-wechat-name {
  font-size: 12px;
}

.order-view-mode .order-editor-panel {
  display: none !important;
}

.detail-add-process-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.inline-form-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr auto;
  gap: 10px;
  align-items: center;
}

.inline-form-grid input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  background: #fff;
}

.danger-inline-btn {
  color: var(--danger);
  border-color: rgba(190, 18, 60, 0.24);
  background: var(--danger-soft);
}

.message-box {
  margin-top: 16px;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
}

.message-box.success {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.message-box.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
  background: #fbfdfc;
  line-height: 1.7;
}

.hidden {
  display: none;
}

.editable-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: var(--accent-strong);
  border-bottom: 1px dashed rgba(22, 105, 94, 0.45);
  cursor: pointer;
}

.editable-value:hover {
  background: var(--accent-soft);
  border-radius: 8px;
}

.inline-edit-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-edit-input {
  width: 120px;
  min-width: 80px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  font: inherit;
}

.inline-save-btn,
.inline-cancel-btn {
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 700;
}

.inline-save-btn {
  background: var(--accent);
  color: #fff;
}

.inline-cancel-btn {
  background: #eef2f1;
  color: var(--muted);
}

@media (max-width: 1420px) {
  .audit-layout,
  .two-col-grid {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }

  .secondary-page {
    inset: 12px;
  }
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }

  .main {
    padding: 20px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-grid,
  .summary-grid,
  .detail-meta-grid,
  .process-form-card,
  .inline-form-grid,
  .order-detail-hero {
    grid-template-columns: 1fr;
  }
}
