/*
 * QSR Comments — application styles
 */

/* ── CSS variables ──────────────────────────────────────────────────────── */
:root {
  /* Dashboard palette — burnt orange theme */
  --red:        #bf5700;
  --red-light:  #fbf0e8;
  --red-mid:    #e8a33d;
  --bg:         #f5f5f3;
  --surface:    #fff;
  --border:     #e2e1da;
  --border2:    #ccccc4;
  --text:       #1a1a18;
  --muted:      #6b6b65;
  --muted2:     #9a9a94;
  --blue:       #185FA5;
  --blue-light: #E6F1FB;
  --green:      #3B6D11;
  --green-light:#EAF3DE;
  --amber:      #BA7517;
  --amber-light:#FAEEDA;
  --radius:     10px;
  --radius-sm:  6px;

  /* App chrome palette */
  --primary:      #bf5700;
  --primary-dark: #913f00;
  --secondary:    #0079bf;
  --tertiary:     #00897b;
  --accent:       #e8a33d;
  --ink:          #27251F;
  --line:         #e6e6e6;
  --card:         #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  padding: 0 0 48px;
}

/* ── Dashboard: header ──────────────────────────────────────────────────── */
.dash-header {
  background: var(--red); color: #fff;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.dash-header h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.dash-subtitle { font-size: 12px; opacity: .75; margin-top: 2px; }
.count-badge {
  background: rgba(255,255,255,.18); border-radius: 20px;
  padding: 4px 12px; font-size: 12px; font-weight: 500; white-space: nowrap;
}

/* ── Dashboard: layout ──────────────────────────────────────────────────── */
.dash-layout { display: flex; min-height: calc(100vh - 100px); }

.dash-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 14px; overflow-y: auto;
  position: sticky; top: 49px; /* topnav height */
  max-height: calc(100vh - 49px);
}
.dash-main { flex: 1; padding: 18px 20px; overflow-x: hidden; min-width: 0; }

/* ── Sidebar filters ────────────────────────────────────────────────────── */
.fs { margin-bottom: 14px; }
.fl {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.fl span { cursor: pointer; color: var(--blue); font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.fl span:hover { text-decoration: underline; }
.fi {
  width: 100%; padding: 6px 9px; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); font-size: 13px;
  background: var(--bg); color: var(--text); outline: none;
  appearance: auto;
}
.fi:focus { border-color: var(--red); background: var(--surface); }
.date-row { display: flex; gap: 6px; align-items: center; }
.date-sep { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 3px 8px; border-radius: 20px; border: 1px solid var(--border2); font-size: 11px; cursor: pointer; background: var(--bg); color: var(--muted); transition: all .1s; white-space: nowrap; user-select: none; }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; }
.chip-radio { display: none; }
.reset-btn {
  width: 100%; padding: 7px; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); background: transparent;
  font-size: 12px; cursor: pointer; color: var(--muted);
  margin-top: 6px; transition: all .1s;
}
.reset-btn:hover { border-color: var(--red); color: var(--red); }

/* ── Metric cards ───────────────────────────────────────────────────────── */
.metric-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px;
}
.mcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.mc-label { font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.mc-val { font-size: 26px; font-weight: 600; line-height: 1.1; }
.mc-val--sm { font-size: 16px; font-weight: 600; line-height: 1.3; }
.mc-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.mcard.red  .mc-val { color: var(--red); }
.mcard.amber .mc-val { color: var(--amber); }
.mcard.green .mc-val { color: var(--green); }
.mcard.blue  .mc-val { color: var(--blue); }

/* ── Rank cards ─────────────────────────────────────────────────────────── */
.rank-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.rank-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.rc-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.rc-empty { font-size: 12px; color: var(--muted2); }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rank-name { flex: 1; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar-wrap { flex: 2; background: var(--border2); border-radius: 3px; height: 7px; overflow: hidden; }
.rank-bar { display: block; height: 100%; border-radius: 3px; background: var(--red); }
.rank-count { min-width: 32px; text-align: right; color: var(--muted); font-size: 11px; }

/* ── Charts grid ────────────────────────────────────────────────────────── */
.charts-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px;
}
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.chart-card--wide { grid-column: 1 / -1; }
.chart-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.chart-wrap { position: relative; }

/* ── Insights ───────────────────────────────────────────────────────────── */
.dash-insights {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
}
.dash-insights h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: var(--text); }
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.insight-item {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 11px 13px; border-left: 3px solid var(--red);
}
.insight-item.amber { border-left-color: var(--amber); }
.insight-item.blue  { border-left-color: var(--blue); }
.insight-item.green { border-left-color: var(--green); }
.insight-item h3 { font-size: 11px; font-weight: 600; color: var(--muted); margin: 0 0 3px; text-transform: uppercase; letter-spacing: .04em; }
.insight-item p  { font-size: 13px; color: var(--text); line-height: 1.4; margin: 0; }
.dash-empty { font-size: 13px; color: var(--muted); font-style: italic; margin: 0; }

/* ── Cases table ────────────────────────────────────────────────────────── */
.dash-table-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.dash-table-hdr {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.dash-table-hdr h2 { margin: 0; font-size: 13px; font-weight: 600; }
.dash-hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.dash-table-wrap { overflow-x: auto; max-height: 480px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash-table th {
  background: var(--red); color: #fff;
  padding: 8px 10px; text-align: left; font-weight: 500; font-size: 11px;
  white-space: nowrap; cursor: pointer; user-select: none;
  position: sticky; top: 0;
}
.dash-table th:hover { background: #913f00; }
.dash-table.sortable th.sort-col { cursor: pointer; }
.dash-table.sortable th.sorted-asc::after  { content: " ▲"; font-size: 9px; }
.dash-table.sortable th.sorted-desc::after { content: " ▼"; font-size: 9px; }
.dash-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dash-table tr:nth-child(even) td { background: #fdf8f4; }
.dash-table tr:hover td { background: #fbf0e8; }
.dash-table .nowrap { white-space: nowrap; }
.badge-propel { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 500; }
.badge-propel.yes { background: var(--green-light); color: var(--green); }
.badge-propel.no  { background: #f1efe8; color: #5f5e5a; }
.dash-pager {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12px; color: var(--muted);
}
.dash-pager button {
  padding: 5px 12px; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); background: transparent;
  cursor: pointer; font-size: 12px; color: var(--text);
}
.dash-pager button:hover { border-color: var(--red); color: var(--red); }
.dash-pager button:disabled { opacity: .4; cursor: default; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .metric-cards { grid-template-columns: repeat(2, 1fr); }
  .charts-grid  { grid-template-columns: 1fr; }
  .chart-card--wide { grid-column: auto; }
}
@media (max-width: 860px) {
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .rank-cards { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .metric-cards { grid-template-columns: 1fr 1fr; }
  .dash-main { padding: 12px 14px; }
}

/* ====================== App chrome: nav, pages, forms ====================== */
.topnav {
  margin: 0; padding: 12px 24px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}
.topnav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topnav .brand img { display: block; flex-shrink: 0; }
.topnav .brand-text { font-weight: 700; font-size: 17px; letter-spacing: -0.2px; color: #fff; }
.topnav .navlinks { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topnav .navlinks a { color: #e8e8e8; text-decoration: none; }
.topnav .navlinks a:hover { color: #fff; }
.topnav .who { color: #b9b9b9; font-size: 13px; }
.topnav .tag, .tag {
  background: var(--primary); color: #fff; border-radius: 999px; font-size: 10px;
  padding: 2px 7px; margin-left: 4px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700;
}
.topnav .linkbtn { background: transparent; border: 1px solid #555; color: #fff; }

/* Flash */
.flash-wrap { margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.flash.notice { background: #e9f3ec; color: #1e7e34; border: 1px solid #cfe6d6; }
.flash.alert { background: #fbeaea; color: #b02a2a; border: 1px solid #f0cccc; }

/* Page shell (everything except the full-bleed dashboard) */
.page { max-width: 1100px; margin: 22px auto 0; }
.page.narrow { max-width: 620px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-head .head-actions { display: flex; gap: 8px; }
.muted-sub { font-size: 14px; color: var(--muted); font-weight: 400; }
.empty { color: var(--muted); font-style: italic; }

/* Grid tables */
table.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.grid th { background: #fafafa; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
table.grid tr:last-child td { border-bottom: 0; }
table.grid a { color: var(--secondary); text-decoration: none; }
table.grid a:hover { text-decoration: underline; }
.actions-cell { display: flex; gap: 10px; align-items: center; white-space: nowrap; }

/* Detail lists */
dl.detail { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 0 0 20px; }
dl.detail dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
dl.detail dd { margin: 2px 0 0; font-size: 15px; }
.page h2 { font-size: 16px; margin: 6px 0 12px; }
.muted { color: var(--muted); }

/* Forms */
.page form { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
.page .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.page .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.page .field label { font-size: 12px; font-weight: 600; color: #444; }
.page .field input[type=text], .page .field input[type=email], .page .field input[type=tel],
.page .field input[type=password], .page .field select {
  padding: 9px 10px; border: 1px solid #cfcfcf; border-radius: 8px; font-size: 14px; background: #fff; width: 100%;
}
.page .field.check { flex-direction: row; align-items: flex-start; gap: 8px; }
.page .field.check label { font-weight: 400; }
.page .hint { color: var(--muted); font-size: 12px; }
fieldset.checks { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 4px 0 16px; }
fieldset.checks legend { font-size: 12px; font-weight: 600; color: #444; padding: 0 6px; }
fieldset.checks legend small { font-weight: 400; color: var(--muted); }
.checkitem { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.errors { background: #fbeaea; border: 1px solid #f0cccc; color: #b02a2a; border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.errors ul { margin: 6px 0 0; padding-left: 20px; }

/* Buttons */
.btn { display: inline-block; border: 0; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #cfcfcf; }
.btn.danger { background: #b02a2a; color: #fff; }
.linkbtn { background: none; border: 0; color: var(--secondary); cursor: pointer; font-size: 14px; padding: 0; }
.linkbtn.danger { color: #b02a2a; }
.linkbtn:hover { text-decoration: underline; }

/* Devise auth pages */
.page form a, .topnav + .flash-wrap + h2 { color: var(--secondary); }

/* Let the topnav links wrap before they overflow on narrow screens. */
.topnav .navlinks { flex-wrap: wrap; row-gap: 6px; }

@media (max-width: 900px) {
  /* Wide management tables scroll horizontally instead of overflowing. */
  table.grid { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 768px) {
  body { padding: 0 14px 36px; }
  .masthead { margin: 0 -14px 16px; padding: 18px 16px 20px; }
  .masthead h1 { font-size: 21px; }
  .topnav { margin: 0 -14px; }
  .page { margin-top: 16px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head .head-actions { width: 100%; }
}

@media (max-width: 640px) {
  dl.detail, .page .field-row { grid-template-columns: 1fr; }
  .topnav { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .num { font-size: 24px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .table-scroll { max-height: 60vh; }
}

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

/* ====================== Mailbox processing (admin console) ====================== */
.mailbox-counts {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px;
}
.mcount {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 20px; display: flex; flex-direction: column; gap: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04); min-width: 90px;
}
.mcount-num { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1; }
.mcount-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }

.btn.active-filter { background: var(--ink); color: #fff; border-color: var(--ink); }

.badge-status {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: capitalize;
}
.badge-status--delivered  { background: #d9efec; color: #00695f; }
.badge-status--failed     { background: #fbeaea; color: #b02a2a; }
.badge-status--bounced    { background: #fef3dc; color: #7a5200; }
.badge-status--processing { background: #deeaf8; color: #0058a0; }
.badge-status--pending    { background: #f1f1f1; color: #666; }

/* ====================== Clickable table rows (dashboard) ====================== */
.row-clickable { cursor: pointer; }
.row-clickable:hover td { background: #fbf0e8; }
.guest-link { color: var(--blue); text-decoration: none; font-weight: 500; }
.guest-link:hover { text-decoration: underline; }

/* ====================== Comment detail + guest views ====================== */
.cd-back-link {
  color: rgba(255,255,255,.85); font-size: 13px; text-decoration: none;
  border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius-sm);
  padding: 5px 12px; white-space: nowrap; transition: all .15s;
}
.cd-back-link:hover { background: rgba(255,255,255,.15); color: #fff; }

.cd-body {
  max-width: 960px; margin: 20px auto; padding: 0 20px 48px;
  display: flex; flex-direction: column; gap: 14px;
}

.cd-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.cd-card--clickable { cursor: pointer; transition: box-shadow .15s; }
.cd-card--clickable:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); border-color: var(--red-mid); }

.cd-card-head {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); background: var(--bg);
}

.cd-card-row {
  padding: 12px 16px 0; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.cd-card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  flex-wrap: wrap; color: var(--text);
}
.cd-case-num { font-weight: 600; color: var(--red); }
.cd-visit-date { color: var(--muted); }
.cd-dot { color: var(--border2); }
.cd-case-badges { display: flex; gap: 5px; flex-wrap: wrap; }

.cd-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; padding: 4px 0;
}
.cd-grid--compact { padding: 4px 0 0; }

.cd-field { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.cd-grid .cd-field:nth-last-child(-n+3):nth-child(3n+1),
.cd-grid .cd-field:nth-last-child(-n+2):nth-child(3n+1),
.cd-grid .cd-field:nth-last-child(-n+1):nth-child(3n+1) { border-bottom: none; }

.cd-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted2); margin-bottom: 3px;
}
.cd-val { font-size: 14px; color: var(--text); }
.cd-empty { color: var(--muted2); }

.cd-guest-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.cd-guest-link:hover { text-decoration: underline; }

.cd-mono { font-family: "SF Mono", SFMono-Regular, Consolas, monospace; font-size: 12px; }

.cd-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.cd-table th {
  background: var(--red); color: #fff;
  padding: 8px 14px; text-align: left; font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.cd-table td {
  padding: 8px 14px; border-bottom: 1px solid var(--border); vertical-align: top;
}
.cd-table tr:last-child td { border-bottom: none; }
.cd-table tr:nth-child(even) td { background: #fdf8f4; }

.cd-comment-text {
  padding: 14px 16px; margin: 0; font-size: 14px; line-height: 1.6;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
}
.cd-comment-preview {
  margin: 8px 16px 12px; font-size: 13px; line-height: 1.55;
  color: var(--muted); white-space: pre-wrap; word-break: break-word;
}

.cd-empty-msg {
  padding: 16px; margin: 0; font-size: 13px; color: var(--muted); font-style: italic;
}

/* Nav open-complaints count badge */
.nav-count-badge {
  display: inline-block; background: var(--red); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  padding: 1px 6px; margin-left: 3px; vertical-align: middle;
}

/* Disputed comments — filter form panel */
.dispute-filter-form { padding: 14px 16px; }
.dispute-filter-row {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
}
.dispute-filter-group {
  display: flex; flex-direction: column; gap: 4px; min-width: 140px;
}
.dispute-filter-group--wide { min-width: 220px; flex: 1; }
.dispute-filter-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.dispute-filter-input { width: 100%; }
.dispute-filter-actions {
  display: flex; align-items: center; gap: 10px; padding-bottom: 1px;
}

/* Disputed comments filter pills */
.dispute-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.dispute-filters .btn { display: flex; align-items: center; gap: 4px; }

/* Workflow status badges */
.badge-workflow {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
}
.badge-workflow.open   { background: var(--amber-light); color: var(--amber); }
.badge-workflow.closed { background: var(--green-light);  color: var(--green); }

/* Workflow card head (flex to accommodate badge) */
.wf-card-head {
  display: flex; align-items: center; justify-content: space-between;
}

/* Workflow update history */
.wf-updates {
  border-bottom: 1px solid var(--border);
}
.wf-update {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.wf-update:last-child { border-bottom: none; }
.wf-update-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 5px;
}
.wf-update-user  { font-size: 13px; font-weight: 600; color: var(--text); }
.wf-update-time  { font-size: 12px; color: var(--muted); }
.wf-update-body  {
  margin: 0; font-size: 14px; line-height: 1.55;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
}

/* Workflow new-update form */
.wf-form { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.wf-form-field { display: flex; flex-direction: column; gap: 5px; }
.wf-label { font-size: 12px; font-weight: 600; color: #444; }
.wf-textarea {
  padding: 9px 10px; border: 1px solid #cfcfcf; border-radius: 8px;
  font-size: 14px; font-family: inherit; resize: vertical;
  width: 100%; background: #fff;
}
.wf-textarea:focus { outline: none; border-color: var(--red); }
.wf-form-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.wf-close-check {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; cursor: pointer; color: var(--text);
}
.wf-no-updates { color: var(--muted2); font-size: 13px; }

/* Dispute status badges */
.badge-dispute {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
}
.badge-dispute.none               { background: #f1f1ee; color: var(--muted); }
.badge-dispute.under-dispute      { background: #fef3dc; color: #7a5200; }
.badge-dispute.successfully-disputed { background: #fbeaea; color: #b02a2a; }

/* Dispute status card body */
.cd-dispute-body {
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.cd-dispute-current { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cd-dispute-note { font-size: 12px; color: var(--muted); font-style: italic; }
.cd-dispute-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn.dispute-resolve { background: #b02a2a; color: #fff; }
.btn.dispute-resolve:hover { background: #8e2020; }

@media (max-width: 700px) {
  .cd-grid { grid-template-columns: 1fr 1fr; }
  .cd-body { padding: 0 12px 36px; }
}
