/* ──────────────────────────────────────────────────────────────────────
   Approvals — master-detail + Amend modal
   Master 340px, detail fluid. Extracted from docs/v3-dashboard-design.html
   §04 with only the wrapper scoped to .ap-page.
   ────────────────────────────────────────────────────────────────────── */

.ap-page {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1;
  min-height: 0;
}
.ap-master {
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  min-height: 0;
}
.ap-master-hdr {
  padding: 18px 20px 12px;
}
.ap-master-hdr .title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0;
  display: flex; align-items: baseline; gap: 10px;
}
.ap-master-hdr .title .ct {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0;
}
.ap-chips {
  padding: 0 18px 8px;
  display: flex; flex-wrap: wrap; gap: 5px;
}
.ap-chips .chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: -0.003em;
  transition: all 120ms ease;
}
.ap-chips .chip:hover { color: var(--ink); border-color: var(--rule-strong); }
.ap-chips .chip.on {
  background: var(--pill-on-bg);
  color: var(--pill-on-fg);
  border-color: var(--pill-on-bg);
}
.ap-chips .chip.on.urgent {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--pill-on-fg);
}
.ap-chips .chip .ct {
  font-family: var(--mono);
  color: var(--ink-4);
  margin-left: 4px;
  font-weight: 400;
}
.ap-chips .chip.on .ct { color: var(--pill-on-fg-muted); }
.ap-chips .row-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
  width: 100%;
  margin: 6px 0 -2px;
}
.ap-list {
  flex: 1; overflow-y: auto;
  padding: 4px 0 14px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.ap-list:hover { scrollbar-color: var(--rule) transparent; }
.ap-list::-webkit-scrollbar { width: 6px; }
.ap-list::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; transition: background 200ms ease; }
.ap-list:hover::-webkit-scrollbar-thumb { background: var(--rule); }

.ap-group-hdr {
  padding: 14px 20px 4px;
  display: flex; align-items: baseline;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.ap-group-hdr .ct {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}

.ap-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  margin: 1px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 120ms ease;
}
.ap-item:hover { background: var(--paper-hover); }
.ap-item.active { background: var(--paper-sel); }
.ap-item .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
  margin-top: 8px;
  flex-shrink: 0;
}
.ap-item.pending .dot { background: var(--clay); }
.ap-item.approved .dot { background: var(--moss); }
.ap-item.rejected .dot { background: var(--brick); }
.ap-item.amended .dot { background: var(--plum); }
.ap-item .main { min-width: 0; }
.ap-item .id {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 500;
}
.ap-item .channel {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.005em;
}
.ap-item .req {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ap-item .req .agent { color: var(--plum); font-weight: 500; }
.ap-item .req .state-tag { font-weight: 500; }
.ap-item.approved .req .state-tag { color: var(--moss); }
.ap-item.rejected .req .state-tag { color: var(--brick); }
.ap-item.amended .req .state-tag { color: var(--plum); }
.ap-item .age {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 6px;
}

.ap-master-foot {
  padding: 12px 20px;
  font-size: 11.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--rule-soft);
}
.ap-master-foot .num { color: var(--ink); font-weight: 600; }
.ap-master-foot .urgent { color: var(--clay); font-weight: 600; }

/* ───── detail pane ───── */
.ap-detail {
  display: flex;
  flex-direction: column;
  background: var(--paper-card);
  min-height: 0;
  overflow-y: auto;
  position: relative;
}
.ap-detail-hdr {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--rule-soft);
}
.ap-detail-hdr .crumb {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 6px;
}
.ap-detail-hdr .crumb .chan { color: var(--ink); }
.ap-detail-hdr .crumb .sep { color: var(--ink-4); margin: 0 6px; }
.ap-detail-hdr .id-row {
  display: flex; align-items: baseline; gap: 14px;
}
.ap-detail-hdr .id {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.018em;
}
.ap-detail-hdr .state {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ap-detail-hdr .state.pending { background: var(--clay-soft); color: var(--clay); border: 1px solid var(--clay); }
.ap-detail-hdr .state.approved { background: var(--moss-bg); color: var(--moss); border: 1px solid var(--moss); }
.ap-detail-hdr .state.rejected { background: var(--brick-bg); color: var(--brick); border: 1px solid var(--brick); }
.ap-detail-hdr .meta-row {
  margin-top: 14px;
  display: flex; gap: 32px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-3);
}
.ap-detail-hdr .meta-row .lbl {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-4);
  margin-right: 7px;
}
.ap-detail-hdr .meta-row .val { color: var(--ink-2); font-weight: 500; }
.ap-detail-hdr .meta-row .val .plum { color: var(--plum); }

.ap-detail-body {
  padding: 24px 28px 28px;
}

.ap-section-hd {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
  margin: 0 0 12px;
  display: flex; align-items: baseline; gap: 10px;
}
.ap-section-hd .meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-4);
  font-weight: 400;
}
.ap-section-hd + .ap-section-hd { margin-top: 28px; }

.ap-payload {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
  padding: 16px 18px;
  background: var(--paper-2);
  border-radius: var(--radius);
  color: var(--ink);
  margin-bottom: 28px;
  overflow-x: auto;
}
.ap-payload .gutter {
  display: inline-block;
  width: 22px;
  color: var(--ink-4);
  text-align: right;
  user-select: none;
  margin-right: 14px;
}
.ap-payload .punc { color: var(--ink-3); }
.ap-payload .key  { color: var(--steel); }
.ap-payload .str  { color: var(--moss); }
.ap-payload .num  { color: var(--clay); }
.ap-payload .bool { color: var(--plum); }

.ap-timeline {
  list-style: none; padding: 0; margin: 0 0 28px;
}
.ap-timeline li {
  display: grid;
  grid-template-columns: 80px 12px 1fr;
  gap: 0 16px;
  padding: 8px 0;
  font-size: 13.5px;
  align-items: center;
}
.ap-timeline li .t {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
.ap-timeline li .bullet {
  position: relative;
}
.ap-timeline li .bullet::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
}
.ap-timeline li.plum .bullet::before { background: var(--plum); }
.ap-timeline li.moss .bullet::before { background: var(--moss); }
.ap-timeline li.brick .bullet::before { background: var(--brick); }
.ap-timeline li.bullet-line { position: relative; }
.ap-timeline li + li .bullet::after {
  content: "";
  position: absolute;
  left: 50%; top: -16px;
  transform: translateX(-50%);
  width: 1px; height: 20px;
  background: var(--rule);
}
.ap-timeline li .body { color: var(--ink-2); }
.ap-timeline li .body em { color: var(--ink); font-style: normal; font-weight: 600; }
.ap-timeline li .body .who { color: var(--plum); font-weight: 500; }
.ap-timeline li.placeholder .body { color: var(--ink-4); font-style: italic; }

.ap-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
}
.ap-actions .label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
  margin-right: 8px;
}
.ap-actions .btn {
  padding: 8px 16px;
  font-size: 13px;
}
.ap-actions .decided-by {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
}
.ap-actions .decided-by .name { color: var(--plum); font-weight: 500; }

/* amend modal overlay (floats over the detail pane) */
.amend-modal {
  position: absolute;
  top: 80px; left: 60px; right: 60px;
  background: var(--paper-card);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 2px rgba(22,24,28,0.06),
    0 30px 80px -16px rgba(22,24,28,0.32);
  border: 1px solid var(--rule);
  z-index: 30;
  overflow: hidden;
}
.amend-modal::before {
  content: "modal · shown when Amend is clicked";
  position: absolute;
  top: -22px; left: 0;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.amend-modal .amh {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--rule-soft);
}
.amend-modal .amh .ttl {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.amend-modal .amh .ttl .id { font-family: var(--mono); font-size: 16px; color: var(--ink-2); margin-left: 8px; font-weight: 500; }
.amend-modal .amh .lead {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-top: 6px;
  max-width: 580px;
}
.amend-modal .amh .lead em { color: var(--ink); font-style: normal; font-weight: 600; }
.amend-modal .amb { padding: 16px 24px 18px; }
.amend-modal .amb .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.amend-modal .amb .col {
  background: var(--paper-2);
  border-radius: var(--radius);
  overflow: hidden;
}
.amend-modal .amb .col .lbl {
  padding: 8px 14px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
}
.amend-modal .amb .col .lbl .right { margin-left: auto; color: var(--clay); font-weight: 600; }
.amend-modal .amb .col .src {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  padding: 8px 0;
}
.amend-modal .amb .col .src .line {
  display: grid;
  grid-template-columns: 20px 12px 1fr;
  gap: 0 8px;
  padding: 1px 14px;
}
.amend-modal .amb .col .src .ln { color: var(--ink-4); text-align: right; font-size: 10.5px; }
.amend-modal .amb .col .src .sig { color: var(--ink-4); font-weight: 600; }
.amend-modal .amb .col .src .add { background: rgba(103,133,94,0.16); }
.amend-modal .amb .col .src .add .sig { color: var(--moss); }
.amend-modal .amb .col .src .add .num { color: var(--moss); }
.amend-modal .amb .col .src .rem { background: rgba(148,88,74,0.14); }
.amend-modal .amb .col .src .rem .sig { color: var(--brick); }
.amend-modal .amb .col .src .rem .text { color: var(--ink-3); }
.amend-modal .amb .col .src .rem .num { color: var(--brick); }
.amend-modal .amb .col .src .key { color: var(--steel); }
.amend-modal .amb .col .src .str { color: var(--moss); }
.amend-modal .amb .col .src .num { color: var(--clay); }
.amend-modal .amb .col .src .punc { color: var(--ink-3); }
.amend-modal .note-field {
  margin-top: 16px;
}
.amend-modal .note-field label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 6px;
}
.amend-modal .note-field textarea {
  width: 100%;
  background: var(--paper-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  resize: vertical;
  min-height: 58px;
  line-height: 1.55;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.amend-modal .note-field textarea:focus {
  background: var(--paper-card);
  border-color: var(--steel);
  box-shadow: 0 0 0 2px var(--steel-soft);
}
.amend-modal .amf {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px 16px;
  border-top: 1px solid var(--rule-soft);
  background: var(--paper);
}
.amend-modal .amf .hint { font-size: 11.5px; color: var(--ink-3); }
.amend-modal .amf .hint kbd { font-family: var(--mono); font-size: 10.5px; background: var(--paper-card); border: 1px solid var(--rule); padding: 0 5px; border-radius: 2px; }
.amend-modal .amf .spacer { flex: 1; }

