/* Complaint queue reading layer: calmer contrast, clearer rhythm, less color fatigue. */
.complaint-list-panel {
  border-color: #edd9d9;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(120, 45, 45, .04);
}

.complaint-list-panel .panel-heading {
  background: #ffffff;
}

.complaint-list-panel .filters {
  background: #ffffff;
}

.complaint-list-panel .table-shell {
  max-height: 72vh;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #ffffff;
}

.complaint-list-panel .complaint-table {
  width: max-content;
  min-width: 2200px !important;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.complaint-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 10px 12px;
  color: #714848;
  border-bottom: 2px solid #e7caca;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: .01em;
}

.complaint-table td {
  height: 52px;
  padding: 9px 12px;
  color: #452e2e;
  border-bottom: 1px solid #f0dede;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  vertical-align: middle;
  transition: background-color .15s ease;
}

.complaint-table tbody tr:nth-child(even) > td {
  background: #ffffff;
}

.complaint-table tbody tr:hover > td,
.complaint-table tbody tr:nth-child(even):hover > td {
  background: #fff2f2;
}

.complaint-table tr.platform-row-pending:hover > td {
  background: #f8e9e7;
}

.complaint-table tr.platform-row-processing:hover > td {
  background: #eaf2f6;
}

.complaint-table tr.platform-row-processed:hover > td,
.complaint-table tr.platform-row-overdue_processed:hover > td {
  background: #eaf3ec;
}

.complaint-table tr.platform-row-withdrawn:hover > td {
  background: #f2edf5;
}

.complaint-table tr.platform-row-overdue_unprocessed:hover > td {
  background: #f9e9e9;
}

.complaint-table tr.platform-row-irrelevant:hover > td,
.complaint-table tr.platform-row-unknown:hover > td {
  background: #fff5f5;
}

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

.complaint-table .selection-column { width: 42px; }

.complaint-table th:last-child,
.complaint-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  border-left: 1px solid #efdada;
  background: #ffffff;
  box-shadow: -8px 0 14px rgba(120, 45, 45, .045);
}

.complaint-table th:last-child { z-index: 7; }

.complaint-table .compact-text {
  display: block;
  width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 22px;
}

.complaint-table .compact-merchant { width: 200px; font-weight: 720; }
.complaint-table .compact-phone { width: 135px; font-weight: 720; }
.complaint-table .compact-assignment { width: 160px; }
.complaint-table .compact-trace { width: 220px; }
.complaint-table .compact-summary { width: 240px; }

.complaint-table .amount-highlight { color: #9f1830; font-size: 14px; font-weight: 850; }

.complaint-table .row-operation,
.complaint-table .inline-rule-action,
.complaint-table .inline-rule-buttons,
.complaint-table .compact-statuses {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
}

.complaint-table .operation-column button {
  height: 32px;
  padding: 6px 9px;
  white-space: nowrap;
  font-size: 12px;
}

.complaint-table .inline-rule-status {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 22px;
  margin: 0;
}
.complaint-table .inline-rule-status:empty { display: none; }

.complaint-table .tag,
.complaint-table .sla-badge,
.complaint-table .platform-status-badge,
.complaint-table .sensitive-complaint-badge,
.complaint-table .staff-mark-badge,
.complaint-table .urge-badge {
  display: inline-flex;
  white-space: nowrap;
  margin: 0;
  vertical-align: middle;
}

.complaint-table .cell-main {
  color: #3d2626;
  font-weight: 720;
  line-height: 1.55;
}

.complaint-table .cell-sub {
  margin-top: 6px;
  color: #805f5f;
  font-size: 12px;
  line-height: 1.65;
}

.complaint-table .mono {
  color: #755656;
  font-size: 11px;
  line-height: 1.55;
}

.complaint-table .tag,
.complaint-table .sla-badge,
.complaint-table .platform-status-badge {
  font-weight: 780;
  box-shadow: none;
}

.complaint-table .platform-status-line {
  margin-top: 8px;
  color: #836060;
  font-size: 11px;
}

.complaint-table .platform-status-badge.platform-pending,
.complaint-table .platform-status-badge.platform-processing {
  color: #825149;
  border-color: #dfbbb5;
  background: #f4e2df;
}

.complaint-table .platform-status-badge.platform-processed,
.complaint-table .platform-status-badge.platform-withdrawn {
  color: #476958;
  border-color: #bfd1c7;
  background: #eaf2ed;
}

.complaint-table .platform-status-badge.platform-overdue {
  color: #93414c;
  border-color: #e5bcc1;
  background: #faebed;
}

.complaint-table .platform-status-badge.platform-irrelevant,
.complaint-table .platform-status-badge.platform-unknown {
  color: #765353;
  border-color: #e7cccc;
  background: #fff5f5;
}

.complaint-table .inline-rule-select {
  width: 190px;
  min-height: 32px;
  height: 32px;
  border-color: #e8cccc;
  background: #ffffff;
  color: #452e2e;
  font-size: 13px;
}

.complaint-table .primary-button {
  background: #aa6455;
  border-color: #aa6455;
  box-shadow: none;
}

.complaint-table .primary-button:hover {
  background: #925044;
  border-color: #925044;
  filter: none;
}

.complaint-table .row-action,
.complaint-table .secondary-button {
  color: #654444;
  border-color: #e8cccc;
  background: #fff6f6;
}

.complaint-table .row-action:hover,
.complaint-table .secondary-button:hover {
  color: #4d3030;
  border-color: #d9b4b4;
  background: #fdeaea;
}

.complaint-table .mark-button:hover {
  border-color: #c77882;
  background: #f4dfe1;
}

.complaint-table .return-button:hover {
  border-color: #d28991;
  background: #f7dfe1;
}

.complaint-table .urge-button:hover {
  border-color: #be8a98;
  background: #efdce2;
}

.complaint-table .case-check,
.complaint-table #selectAll {
  accent-color: #a65d50;
}

.table-shell .complaint-table tr.sensitive-complaint-row > td {
  color: #573733;
  border-bottom-color: #efd6d1 !important;
  background: #fff3f4 !important;
}

.complaint-table tr.sensitive-complaint-row > td:first-child {
  box-shadow: inset 4px 0 #b84b4b;
}

.table-shell .complaint-table tr.sensitive-complaint-row:hover > td {
  background: #ffe6ea !important;
}

.table-shell .complaint-table tr.staff-marked-row > td {
  color: #573733;
  border-bottom-color: #edd7cc !important;
  background: #fff0f2 !important;
}

.complaint-table tr.staff-marked-row > td:first-child {
  box-shadow: inset 4px 0 #bd5a47;
}

.table-shell .complaint-table tr.staff-marked-row:hover > td {
  background: #ffe3e8 !important;
}

body[data-theme="dark"] .complaint-list-panel {
  border-color: #754235;
  background: #3b211b;
  box-shadow: 0 10px 28px rgba(30, 4, 2, .18);
}

body[data-theme="dark"] .complaint-list-panel .panel-heading,
body[data-theme="dark"] .complaint-list-panel .filters {
  background: #492820;
}

body[data-theme="dark"] .complaint-list-panel .table-shell {
  background: #351d18;
}

body[data-theme="dark"] .complaint-table th {
  color: #efd8d3;
  border-bottom-color: #87503f;
  background: #593027;
}

body[data-theme="dark"] .complaint-table th:last-child,
body[data-theme="dark"] .complaint-table td:last-child {
  border-left-color: #70413a;
  box-shadow: -8px 0 14px rgba(30, 4, 2, .16);
}

body[data-theme="dark"] .complaint-table .amount-highlight {
  color: #ff9ba8;
}

body[data-theme="dark"] .complaint-table td {
  color: #ead7d3;
  border-bottom-color: #644036;
  background: #43251f;
}

body[data-theme="dark"] .complaint-table tbody tr:nth-child(even) > td {
  background: #3c221d;
}

body[data-theme="dark"] .complaint-table tbody tr:hover > td,
body[data-theme="dark"] .complaint-table tbody tr:nth-child(even):hover > td {
  background: #553027;
}

body[data-theme="dark"] .complaint-table tr.platform-row-pending:hover > td {
  background: #5a302c;
}

body[data-theme="dark"] .complaint-table tr.platform-row-processing:hover > td {
  background: #304149;
}

body[data-theme="dark"] .complaint-table tr.platform-row-processed:hover > td,
body[data-theme="dark"] .complaint-table tr.platform-row-overdue_processed:hover > td {
  background: #30473a;
}

body[data-theme="dark"] .complaint-table tr.platform-row-withdrawn:hover > td {
  background: #49364f;
}

body[data-theme="dark"] .complaint-table tr.platform-row-overdue_unprocessed:hover > td {
  background: #5b2c2e;
}

body[data-theme="dark"] .complaint-table tr.platform-row-irrelevant:hover > td,
body[data-theme="dark"] .complaint-table tr.platform-row-unknown:hover > td {
  background: #493a33;
}

body[data-theme="dark"] .complaint-table .cell-main {
  color: #f4dfdc;
}

body[data-theme="dark"] .complaint-table .cell-sub,
body[data-theme="dark"] .complaint-table .mono,
body[data-theme="dark"] .complaint-table .platform-status-line {
  color: #c7aaa6;
}

body[data-theme="dark"] .complaint-table .inline-rule-select {
  color: #f1dedb;
  border-color: #72483b;
  background: #4b2a23;
}

body[data-theme="dark"] .complaint-table .row-action,
body[data-theme="dark"] .complaint-table .secondary-button {
  color: #ead7d3;
  border-color: #72483b;
  background: #4b2a23;
}

body[data-theme="dark"] .complaint-table .primary-button:hover {
  color: #fff1ee;
  border-color: #ca715e;
  background: #a95649;
}

body[data-theme="dark"] .complaint-table .row-action:hover,
body[data-theme="dark"] .complaint-table .secondary-button:hover {
  color: #f3dfdc;
  border-color: #95614f;
  background: #60372e;
}

body[data-theme="dark"] .complaint-table .mark-button:hover,
body[data-theme="dark"] .complaint-table .return-button:hover {
  border-color: #a85b66;
  background: #633039;
}

body[data-theme="dark"] .complaint-table tr.sensitive-complaint-row > td,
body[data-theme="dark"] .complaint-table tr.staff-marked-row > td {
  color: #f2d7cf;
  border-bottom-color: #7f4842 !important;
  background: #572b28 !important;
}

body[data-theme="dark"] .complaint-table tr.sensitive-complaint-row:hover > td,
body[data-theme="dark"] .complaint-table tr.staff-marked-row:hover > td {
  background: #63312d !important;
}

@media (max-width: 780px) {
  .complaint-list-panel .table-shell {
    max-height: 68vh;
    overflow: auto;
  }
  .complaint-table th { padding: 9px 10px; font-size: 12px; }
  .complaint-table td { padding: 8px 10px; font-size: 13px; }
  .complaint-table th:last-child,
  .complaint-table td:last-child {
    position: static;
    box-shadow: none;
  }
}
