:root {
  --ink: #30251f;
  --muted: #77675f;
  --line: #e6ddd5;
  --surface: #fffdf9;
  --surface-soft: #f7f2eb;
  --accent: #a74f34;
  --accent-deep: #7f3825;
  --sidebar-bg: #101828;
  --sidebar-text: #98a2b3;
  --sidebar-active: #f8fafc;
  --green: #3e7458;
  --gold: #9a6a20;
  --danger: #aa3f3f;
  --shadow: 0 18px 45px rgba(60, 39, 29, 0.09);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: #f4eee7;
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(167, 79, 52, 0.08), transparent 40%),
    #f4eee7;
}

.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid rgba(133, 88, 67, 0.14);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  font-size: 24px;
  font-weight: 700;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 16px 16px;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-mark {
  width: 40px;
  height: 40px;
  margin: 0;
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  color: #fb923c;
  background: rgba(249, 115, 22, 0.12);
  font-size: 18px;
}

.sidebar-brand .brand-mark svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.sidebar-brand strong {
  display: block;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 650;
}

.sidebar-brand span {
  color: #667085;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  scrollbar-width: thin;
}

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

.nav-group-toggle,
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.nav-group-toggle {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-weight: 600;
}

.nav-group-toggle:hover,
.nav-group-toggle.active {
  color: #f8fafc;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.045);
}

.nav-group-toggle.active {
  background: transparent;
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  color: #667085;
  background: rgba(255, 255, 255, 0.045);
}

.nav-group-toggle.active .nav-icon {
  color: #fb923c;
  background: rgba(249, 115, 22, 0.1);
}

.nav-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

.nav-chevron {
  margin-left: auto;
  color: #475467;
  font-size: 17px;
  line-height: 1;
  transition: transform 160ms ease;
}

.nav-group-toggle.active .nav-chevron {
  color: #98a2b3;
}

.nav-group.expanded .nav-chevron {
  transform: rotate(90deg);
}

.nav-submenu {
  position: relative;
  display: none;
  gap: 3px;
  padding: 1px 0 2px 20px;
}

.nav-submenu::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 17px;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
  content: "";
}

.nav-group.expanded .nav-submenu {
  display: grid;
}

.nav-item {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #98a2b3;
  font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--sidebar-active);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.075);
  font-weight: 600;
}

.nav-item-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  color: #667085;
  background: transparent;
}

.nav-item.active .nav-item-icon {
  color: #fb923c;
  background: rgba(249, 115, 22, 0.08);
}

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

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.content {
  padding: 26px 28px 48px;
}

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

.metric-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.metric-label {
  color: var(--muted);
}

.metric-value {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}

.metric-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(61, 42, 32, 0.035);
}

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

.panel-head h2 {
  margin: 0;
  font-size: 17px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 18px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar .grow {
  flex: 1;
  min-width: 220px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #d9cec5;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 79, 52, 0.1);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  font-weight: 600;
}

.button:hover {
  background: var(--accent-deep);
}

.button.secondary {
  border-color: #d9cec5;
  color: var(--ink);
  background: #fff;
}

.button.secondary:hover {
  background: var(--surface-soft);
}

.button.ghost {
  border-color: transparent;
  color: var(--accent);
  background: transparent;
}

.button.danger {
  background: var(--danger);
}

.button.small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #eee7e0;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #faf6f1;
  font-size: 12px;
  font-weight: 600;
}

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

.cell-main {
  display: block;
  font-weight: 600;
}

.cell-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  color: #735443;
  background: #f0e8e1;
  font-size: 12px;
}

.badge.green {
  color: #2f664b;
  background: #e2f0e7;
}

.badge.gold {
  color: #7a591c;
  background: #f6e9c8;
}

.badge.orange {
  color: #91432d;
  background: #f7dfd5;
}

.badge.gray {
  color: #69615c;
  background: #ece8e4;
}

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

.catalog-thumb {
  display: grid;
  width: 64px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e1d7cf;
  border-radius: 7px;
  object-fit: cover;
  background: #f6f1eb;
}

.catalog-thumb.placeholder {
  color: #a18f84;
  font-size: 11px;
}

.empty {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(43, 32, 27, 0.48);
}

.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(36, 25, 20, 0.25);
}

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

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-foot {
  border-top: 1px solid var(--line);
}

.modal-body {
  padding: 20px;
}

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

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: 17px;
  min-height: 17px;
}

.form-section {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid #e7ded7;
  border-radius: 12px;
  background: #fff;
}

.form-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px 13px;
  border-bottom: 1px solid #eee7e0;
  background: #fbfaf8;
}

.form-section-head h3 {
  margin: 0;
  color: #3a2e28;
  font-size: 14px;
  font-weight: 700;
}

.form-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-section-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  padding: 17px;
}

.field-block {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.field-block.full {
  grid-column: 1 / -1;
}

.field-label,
.field-label-row {
  color: #65564e;
  font-size: 12px;
  font-weight: 650;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-counter {
  color: #9a8980;
  font-size: 11px;
  font-weight: 400;
}

.field-control {
  display: flex;
  align-items: center;
  min-height: 46px;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid #ddd3cc;
  border-radius: 10px;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field-control:focus-within {
  border-color: #b86644;
  box-shadow: 0 0 0 3px rgba(167, 79, 52, 0.09);
  background: #fffdfa;
}

.field-control > svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: #9d887d;
  stroke-width: 1.8;
}

.field-control input,
.field-control select,
.field-control textarea {
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.field-control input:focus,
.field-control select:focus,
.field-control textarea:focus {
  box-shadow: none;
}

.field-control select {
  cursor: pointer;
}

.field-control.mono input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.2px;
}

.field-prefix,
.field-suffix {
  flex: 0 0 auto;
  color: #8c776c;
  font-size: 13px;
  font-weight: 650;
}

.field-hint {
  color: #9d8b81;
  font-size: 11px;
  line-height: 1.45;
}

.textarea-control {
  align-items: flex-start;
  min-height: 116px;
  padding-top: 11px;
  padding-bottom: 11px;
}

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

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid #e2d8d1;
  border-radius: 11px;
  background: #f7f4f1;
}

.segmented-control label {
  flex: 1 1 95px;
  min-width: 84px;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented-control span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #75645b;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.segmented-control input:checked + span {
  color: #8f3f28;
  background: #fff;
  box-shadow: 0 2px 8px rgba(75, 49, 36, 0.08);
}

.stepper-control {
  display: grid;
  grid-template-columns: 42px minmax(54px, 1fr) 42px;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid #ddd3cc;
  border-radius: 10px;
  background: #fff;
}

.stepper-control button {
  border: 0;
  color: #795548;
  background: #f7f3ef;
  font-size: 19px;
}

.stepper-control input {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-right: 1px solid #e6ddd7;
  border-left: 1px solid #e6ddd7;
  border-radius: 0;
  text-align: center;
  box-shadow: none;
}

.switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid #e4dad3;
  border-radius: 11px;
  background: #fcfaf8;
}

.switch-card.full {
  grid-column: 1 / -1;
}

.switch-copy {
  display: grid;
  gap: 3px;
}

.switch-copy strong {
  color: #4e3e36;
  font-size: 13px;
}

.switch-copy small {
  color: #98867c;
  font-size: 11px;
  line-height: 1.45;
}

.switch-input {
  position: relative;
  flex: 0 0 auto;
}

.switch-input input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-input span {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d7cec8;
  transition: 160ms ease;
}

.switch-input span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(50, 35, 28, 0.18);
  content: "";
  transition: 160ms ease;
}

.switch-input input:checked + span {
  background: #a8563a;
}

.switch-input input:checked + span::after {
  transform: translateX(18px);
}

.form-actions {
  position: sticky;
  bottom: -20px;
  display: flex;
  justify-content: flex-end;
  margin: 4px -20px -20px;
  padding: 14px 20px;
  border-top: 1px solid #e9e1db;
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(12px);
}

.button.primary-large {
  min-height: 46px;
  padding: 0 24px;
  border-radius: 10px;
}

.identity-card,
.security-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #e4d9d2;
  border-radius: 12px;
  background: #fbf7f3;
}

.identity-card strong,
.security-banner strong {
  display: block;
  color: #4d3b32;
}

.identity-card span,
.security-banner span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.security-banner > svg {
  width: 24px;
  height: 24px;
  color: #3d7b5a;
}

.password-strength {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: #85736a;
  font-size: 11px;
}

.strength-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e1dc;
}

.strength-track i {
  display: block;
  width: 0;
  height: 100%;
  background: #b65b3d;
  transition: width 160ms ease, background 160ms ease;
}

.strength-track i.medium {
  background: #c28b31;
}

.strength-track i.strong {
  background: #3f7958;
}

.preview-panel {
  align-self: start;
  padding: 16px;
  border: 1px solid #e5dcd5;
  border-radius: 12px;
  background: #faf8f5;
}

.preview-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.preview-panel-head span {
  color: #5b473e;
  font-size: 13px;
  font-weight: 700;
}

.preview-panel-head small {
  color: #9d8b81;
}

.message-preview-card,
.content-preview-card,
.product-preview-card {
  padding: 16px;
  border: 1px solid #e7ddd6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(66, 44, 33, 0.05);
}

.message-preview-type {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #8f4a31;
  background: #f7e2d8;
  font-size: 11px;
}

.message-preview-card strong,
.content-preview-card strong,
.product-preview-card strong {
  display: block;
  color: #46362f;
}

.message-preview-card p,
.content-preview-card p,
.product-preview-card p {
  margin: 8px 0 12px;
  color: #7d6a61;
  font-size: 12px;
  line-height: 1.7;
}

.message-preview-card small {
  color: #a7958b;
}

.content-preview-card > span {
  color: #a05a3e;
  font-size: 11px;
}

.product-preview-card img,
.product-preview-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  object-fit: cover;
  background: #f2ece7;
}

.product-preview-placeholder {
  gap: 7px;
  color: #a38e83;
  font-size: 12px;
}

.product-preview-card > span {
  color: #a64f34;
  font-size: 19px;
  font-weight: 700;
}

.product-preview-card > span small {
  color: #a48d80;
  font-size: 11px;
  font-weight: 400;
}

.operation-list,
.message-stream,
.file-list,
.audit-list {
  display: grid;
}

.operation-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 126px 100px;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #eee7e0;
}

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

.operation-icon,
.file-icon,
.task-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  color: #9d563a;
  background: #f7e6dc;
}

.operation-icon svg,
.file-icon svg,
.task-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.operation-icon.payment {
  color: #3f765a;
  background: #e5f0e8;
}

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

.operation-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.operation-title-line strong {
  color: #45362f;
  font-size: 14px;
}

.operation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  margin-top: 5px;
  color: #99877d;
  font-size: 11px;
}

.operation-main p {
  overflow: hidden;
  margin: 7px 0 0;
  color: #75645b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-amount {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.operation-amount span {
  color: #9c8a80;
  font-size: 11px;
}

.operation-amount strong {
  color: #9e492f;
  font-size: 17px;
}

.operation-action {
  display: flex;
  justify-content: flex-end;
}

.message-stream-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #eee7e0;
}

.message-stream-row.unread {
  background: #fffbf7;
}

.message-stream-main p {
  margin: 7px 0 0;
  color: #77645b;
  font-size: 12px;
  line-height: 1.7;
}

.message-type-chip {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #8a5a44;
  background: #f4e5dc;
  font-size: 11px;
}

.message-stream-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.message-stream-side time,
.audit-row time {
  color: #9d8b81;
  font-size: 11px;
}

.entity-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #8e462f;
  background: #f5dfd3;
  font-weight: 700;
}

.entity-avatar.large {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.customer-grid,
.content-source-grid,
.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.customer-card,
.content-source-card,
.task-card {
  padding: 17px;
  border: 1px solid #e6ddd6;
  border-radius: 11px;
  background: #fff;
}

.customer-card-top,
.task-card-head,
.content-source-top,
.task-card-foot,
.content-source-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-card-top {
  justify-content: flex-start;
}

.customer-card-top strong,
.content-source-card > strong,
.task-card > strong {
  display: block;
  color: #4c3a32;
  font-size: 14px;
}

.customer-card-top span,
.content-source-meta {
  display: block;
  margin-top: 4px;
  color: #97857b;
  font-size: 11px;
}

.customer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.customer-stats div {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8f5f2;
}

.customer-stats span {
  display: block;
  color: #99877d;
  font-size: 11px;
}

.customer-stats strong {
  display: block;
  margin-top: 4px;
}

.customer-card-foot {
  color: #9b887e;
  font-size: 11px;
}

.content-source-card > p {
  margin: 12px 0 16px;
  color: #74635a;
  font-size: 12px;
  line-height: 1.7;
}

.content-source-foot {
  color: #9a887f;
  font-size: 11px;
}

.file-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(140px, 0.7fr) 150px auto;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid #eee7e0;
}

.file-main strong,
.file-owner strong,
.file-time strong {
  display: block;
}

.file-main span,
.file-owner span,
.file-time span,
.file-owner small {
  display: block;
  margin-top: 4px;
  color: #9a887e;
  font-size: 11px;
}

.task-card > .cell-sub {
  margin: 5px 0 13px;
}

.task-result-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}

.task-result-thumb {
  display: grid;
  width: 48px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #f2ece7;
}

.task-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-result-thumb svg {
  width: 16px;
  height: 16px;
  color: #a18d82;
}

.task-result-count {
  margin-left: auto;
  color: #8d796f;
  font-size: 11px;
}

.task-card-foot,
.content-source-foot {
  padding-top: 13px;
  border-top: 1px solid #eee7e0;
  color: #99877d;
  font-size: 11px;
}

.audit-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 13px;
  padding: 15px 18px;
  border-bottom: 1px solid #eee7e0;
}

.audit-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #c47a58;
  box-shadow: 0 0 0 4px #f8eae3;
}

.audit-main p {
  margin: 6px 0;
  color: #7d6a61;
  font-size: 12px;
}

.audit-main code {
  display: block;
  overflow: hidden;
  color: #907d73;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.status-item {
  min-width: 108px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.status-item strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}

.chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(32px, 1fr));
  align-items: end;
  gap: 12px;
  height: 190px;
  padding-top: 12px;
}

.chart-column {
  display: grid;
  align-items: end;
  height: 100%;
  gap: 8px;
  text-align: center;
}

.chart-bar {
  min-height: 0;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #c26d4d, #9d4931);
}

.chart-label {
  color: var(--muted);
  font-size: 11px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.detail-list {
  display: grid;
  gap: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #eee7e0;
}

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

.detail-row dt {
  color: var(--muted);
}

.detail-row dd {
  margin: 0;
  word-break: break-word;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #c7b5a9;
}

.timeline-item strong {
  display: block;
}

.timeline-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: #3f312b;
  box-shadow: 0 12px 32px rgba(34, 24, 20, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #943c3c;
}

.loading {
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1040px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .nav {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .topbar {
    padding: 12px 16px;
  }

  .content {
    padding: 18px 16px 36px;
  }

  .metric-grid,
  .form-grid,
  .form-section-body,
  .customer-grid,
  .content-source-grid,
  .task-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .operation-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .operation-amount,
  .operation-action {
    grid-column: 2;
    justify-items: start;
    justify-content: flex-start;
  }

  .file-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .file-owner,
  .file-time,
  .file-row > .operations {
    grid-column: 2;
  }

  .message-stream-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .message-stream-side {
    grid-column: 2;
    justify-items: start;
  }

  .modal-backdrop {
    padding: 12px;
  }
}
