/* eva_escalation — issue-page banner/control box and the escalation history tab.
   Loaded site-wide from EvaEscalation::Hooks::ViewLayoutsHook (view_layouts_base_html_head). */

/* --- Banner + control box (view_issues_show_description_bottom) --------------------------- */
.eva-esc-box {
  container-type: inline-size;
  margin: 1em 0;
  padding: 8px 12px;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  background: #fafafa;
}
.eva-esc-box.eva-esc-box-active { border-color: #d22; background: #fff5f5; }

.eva-esc-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: bold; }
.eva-esc-flag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  background: #d22;
  color: #fff;
  text-transform: uppercase;   /* so translations aren't shouted in the locale file */
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.eva-esc-flag-closed { background: #2a8c4a; }   /* settled by closing the ticket */
.eva-esc-flag-hold   { background: #b8860b; }   /* reopened, slot could not be reclaimed */
.eva-esc-meta { font-weight: normal; color: #444; }

.eva-esc-note-quote {
  margin: 6px 0 0;
  padding: 4px 10px;
  border-left: 3px solid #d9d9d9;
  color: #444;
  white-space: pre-wrap;
}
.eva-esc-hint { margin: 6px 0 0; color: #666; font-size: 0.9em; }

.eva-esc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.eva-esc-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.eva-esc-btn-danger { border-color: #d22 !important; color: #d22 !important; }
.eva-esc-toggle { font-size: 0.9em; }
.eva-esc-note { flex-basis: 100%; }
.eva-esc-note textarea { width: 100%; box-sizing: border-box; }
.eva-esc-blocked { margin: 0; color: #b33; }
.eva-esc-histlink { font-size: 0.9em; }

/* --- History tab -------------------------------------------------------------------------- */
.eva-esc-history { container-type: inline-size; }
.eva-esc-history table.list { width: 100%; }
.eva-esc-history .eva-esc-open   { color: #d22; font-weight: bold; }   /* holds the slot */
.eva-esc-history .eva-esc-closed { color: #2a8c4a; font-weight: bold; } /* closed while escalated */
.eva-esc-history .eva-esc-hold   { color: #b8860b; font-weight: bold; } /* reopened, slot taken */
.eva-esc-history .eva-esc-muted { color: #888; }
.eva-esc-history .eva-esc-row-active td { background-color: #fff5f5; }
.eva-esc-history .eva-esc-inline-note { color: #888; cursor: help; }

/* redmineflux_lotus renders #history in a narrow (~1/3 width) column, so the seven-column table
   has to collapse rather than overflow. data-label on every cell supplies the row headings. */
@container (max-width: 560px) {
  .eva-esc-history table.list thead { display: none; }
  .eva-esc-history table.list tr { display: block; border-bottom: 1px solid #ddd; padding: 6px 0; }
  .eva-esc-history table.list td {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    text-align: right;
  }
  .eva-esc-history table.list td::before {
    content: attr(data-label);
    color: #666;
    font-weight: bold;
    text-align: left;
  }
}

@media print {
  .eva-esc-box { background: #fff; }
  .eva-esc-flag { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
