/* ChangeFlow, Axenara x Pulsin
   Theme variables sit at :root so a future tenant just overrides them.
   Pulsin brand: Cocoa Dusk #402020, Rich Orange #de6b0a, Ivory Latte #faebc4,
   Pale Oat #f2eade, Hazelnut Shadow #814d3c. */

:root {
  /* Tenant theme, Pulsin */
  --brand-primary: #de6b0a;
  --brand-primary-hover: #c45e08;
  --brand-dark: #402020;
  --brand-accent: #814d3c;
  --brand-cream: #faebc4;
  --brand-cream-soft: #f2eade;
  --brand-cream-tint: #fbf6e8;

  /* Neutrals */
  --bg: #ffffff;
  --bg-soft: #faf7f2;
  --surface: #ffffff;
  --border: #e8e2d4;
  --border-strong: #d4cab5;
  --text: #2a1a1a;
  --text-muted: #6b5f55;
  --text-faint: #9b8f83;

  /* Semantic */
  --status-draft: #6b5f55;
  --status-pending: #b8851a;
  --status-pending-bg: #fdf4dc;
  --status-approved: #2d7a3e;
  --status-approved-bg: #e8f4ec;
  --status-rejected: #a83232;
  --status-rejected-bg: #fbeaea;
  --status-implemented: #1a5f7a;
  --status-implemented-bg: #e6f1f5;
  --status-emergency: #c8390a;
  --status-emergency-bg: #fbe9de;

  /* Layout */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(64, 32, 32, 0.04);
  --shadow: 0 2px 8px rgba(64, 32, 32, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Top bar === */
.topbar {
  background: var(--brand-dark);
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.topbar .brand .leaf {
  width: 22px; height: 22px;
  background: var(--brand-primary);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: inline-block;
}

.topbar nav { display: flex; gap: 4px; margin-left: 16px; flex: 1; }
.topbar nav a {
  color: rgba(255,255,255,0.78);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.topbar nav a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.topbar nav a.active { background: rgba(255,255,255,0.12); color: #fff; }

.topbar .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
}
.topbar .user-chip:hover { background: rgba(255,255,255,0.14); }

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

/* Larger demo banner */
.demo-banner {
  background: var(--brand-cream);
  color: var(--brand-dark);
  font-size: 12px;
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.demo-banner select {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 3px 8px;
  font-size: 12px;
  color: var(--brand-dark);
}

/* === Layout === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--brand-dark);
}
.page-header .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { margin: 0 6px; color: var(--text-faint); }

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card + .card { margin-top: 16px; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 16px; font-weight: 600; color: var(--brand-dark); }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-primary-hover); color: #fff; }

.btn-secondary {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--brand-accent); }

.btn-ghost {
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

.btn-danger {
  background: #fff;
  border-color: var(--status-rejected);
  color: var(--status-rejected);
}
.btn-danger:hover { background: var(--status-rejected); color: #fff; }

.btn-approve {
  background: var(--status-approved);
  color: #fff;
}
.btn-approve:hover { background: #246a35; color: #fff; }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }

/* === Form === */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
label .req { color: var(--status-rejected); }
label .hint { font-weight: 400; color: var(--text-muted); margin-left: 6px; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(222, 107, 10, 0.12);
}
textarea { resize: vertical; min-height: 90px; }

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Radio cards for change type */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card {
  display: block;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
}
.radio-card:hover { border-color: var(--brand-accent); background: var(--brand-cream-tint); }
.radio-card input { display: none; }
.radio-card input:checked + .radio-card-inner { color: var(--brand-dark); }
.radio-card:has(input:checked) {
  border-color: var(--brand-primary);
  background: var(--brand-cream-tint);
  box-shadow: 0 0 0 2px rgba(222, 107, 10, 0.15);
}
.radio-card-title { font-weight: 600; font-size: 14px; color: var(--brand-dark); margin-bottom: 3px; }
.radio-card-desc { font-size: 12px; color: var(--text-muted); }

/* === Status pills === */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-draft { color: var(--status-draft); background: #ede9e0; }
.pill-pending { color: var(--status-pending); background: var(--status-pending-bg); }
.pill-approved { color: var(--status-approved); background: var(--status-approved-bg); }
.pill-rejected { color: var(--status-rejected); background: var(--status-rejected-bg); }
.pill-implemented { color: var(--status-implemented); background: var(--status-implemented-bg); }
.pill-emergency { color: var(--status-emergency); background: var(--status-emergency-bg); }

.type-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.type-prod { background: #fde6d8; color: #8a3a08; }
.type-dev { background: #e3edfb; color: #1d4e8a; }
.type-project { background: #efe7f8; color: #5a3a87; }
.type-emergency { background: var(--status-emergency); color: #fff; }

/* === Tables === */
.cr-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cr-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.cr-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.cr-table tr:last-child td { border-bottom: none; }
.cr-table tr:hover td { background: var(--bg-soft); cursor: pointer; }
.cr-table .cr-id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.cr-table .cr-title { font-weight: 500; color: var(--text); }
.cr-table .cr-title:hover { color: var(--brand-primary); }

/* Filters */
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.filters .search { flex: 1; min-width: 220px; }
.filters .search input { padding-left: 36px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b5f55' stroke-width='2'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>"); background-repeat: no-repeat; background-position: 12px center; }

/* === CR detail layout === */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 16px;
  font-size: 14px;
}
.detail-meta dt { color: var(--text-muted); font-size: 13px; }
.detail-meta dd { color: var(--text); }

/* Comments / activity */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-content { flex: 1; }
.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
  gap: 12px;
}
.activity-author { font-weight: 600; font-size: 14px; }
.activity-time { font-size: 12px; color: var(--text-muted); }
.activity-action { font-size: 14px; color: var(--text-muted); }
.activity-action strong { color: var(--text); font-weight: 500; }
.activity-comment {
  margin-top: 6px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.55;
}

/* Audit trail items */
.audit-event {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.audit-event:last-child { border-bottom: none; }
.audit-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  margin-top: 7px;
  flex-shrink: 0;
}
.audit-time { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* Attachments */
.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 13px;
}
.attachment-icon {
  width: 32px; height: 32px;
  background: var(--brand-cream-soft);
  color: var(--brand-accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

/* Emergency banner */
.banner-emergency {
  background: var(--status-emergency-bg);
  border: 1px solid var(--status-emergency);
  color: var(--brand-dark);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.banner-emergency .icon {
  width: 24px; height: 24px;
  background: var(--status-emergency);
  color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.banner-emergency strong { color: var(--status-emergency); }

.banner-info {
  background: var(--brand-cream-tint);
  border: 1px solid var(--brand-cream);
  color: var(--brand-dark);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

/* Login page */
.login-wrap {
  min-height: 100vh;
  background: var(--brand-cream-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(222, 107, 10, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(64, 32, 32, 0.06) 0%, transparent 40%);
}
.login-card {
  background: #fff;
  padding: 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(64, 32, 32, 0.08);
  width: 100%;
  max-width: 400px;
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-brand .logo-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: 0.3px;
}
.login-brand .leaf {
  width: 28px; height: 28px;
  background: var(--brand-primary);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.login-brand .tenant {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.quick-login {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.quick-login-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-align: center;
}
.quick-login-list { display: flex; flex-direction: column; gap: 6px; }
.quick-login-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: 13px;
}
.quick-login-item:hover {
  border-color: var(--brand-primary);
  background: var(--brand-cream-tint);
}
.quick-login-item .role-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius);
  background: var(--brand-cream);
  color: var(--brand-dark);
  margin-left: auto;
  font-weight: 500;
}

/* Stats row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 768px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--brand-dark);
}
.stat-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Empty state for hidden views */
.role-hidden { display: none; }

/* Approval action panel */
.action-panel {
  background: var(--brand-cream-tint);
  border: 1px solid var(--brand-cream);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.action-panel h3 {
  font-size: 15px;
  color: var(--brand-dark);
  margin-bottom: 8px;
}
.action-panel p { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.action-row { display: flex; gap: 10px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tabs a {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  cursor: pointer;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* New status pills */
.pill-quote { color: #6a3a87; background: #efe7f8; }
.pill-onhold { color: #6b5f55; background: #ede9e0; }
.pill-golive { color: #134f66; background: #d6ebf3; }
.pill-golive-ok { color: #0e6e4a; background: #d9eee2; }

/* Next-action chip on list rows */
.next-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}
.next-action::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  display: inline-block;
}
.next-action.axenara { background: rgba(64, 32, 32, 0.08); color: var(--brand-dark); }
.next-action.axenara::before { background: var(--brand-accent); }
.next-action.pulsin { background: var(--brand-cream-tint); color: var(--brand-dark); }
.next-action.pulsin::before { background: var(--brand-primary); }
.next-action.neutral { background: var(--bg-soft); color: var(--text-muted); }
.next-action.neutral::before { background: var(--text-faint); }

/* Ageing indicators on list rows */
.cr-table tr.age-warm td:first-child { box-shadow: inset 3px 0 0 #f0a040; }
.cr-table tr.age-hot td:first-child { box-shadow: inset 3px 0 0 #d4581a; }
.cr-table tr.age-stale td:first-child { box-shadow: inset 3px 0 0 var(--status-rejected); }
.age-label {
  font-size: 11px;
  color: var(--text-muted);
}
.age-label.age-warm { color: #b07020; font-weight: 500; }
.age-label.age-hot { color: #b04020; font-weight: 600; }
.age-label.age-stale { color: var(--status-rejected); font-weight: 600; }

/* Content tinting in activity feed */
.activity-item.from-axenara .avatar { background: var(--brand-accent); }
.activity-item.from-pulsin .avatar { background: var(--brand-primary); }
.activity-item.from-axenara .activity-comment { background: var(--brand-cream-soft); }
.activity-item.from-pulsin .activity-comment { background: var(--bg-soft); }

/* Classification badge */
.classification {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid;
  margin-bottom: 6px;
}
.classification-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.class-monthly { background: #e8f4ec; border-color: var(--status-approved); color: #1a5430; }
.class-monthly .classification-icon { background: var(--status-approved); color: #fff; }
.class-project { background: #efe7f8; border-color: #6a3a87; color: #4a2862; }
.class-project .classification-icon { background: #6a3a87; color: #fff; }
.class-hosting { background: #e6f1f5; border-color: var(--status-implemented); color: #134f66; }
.class-hosting .classification-icon { background: var(--status-implemented); color: #fff; }
.class-thirdparty { background: var(--brand-cream-soft); border-color: var(--brand-accent); color: var(--brand-dark); }
.class-thirdparty .classification-icon { background: var(--brand-accent); color: #fff; }
.class-needs { background: #fdf4dc; border-color: var(--status-pending); color: #6b5410; }
.class-needs .classification-icon { background: var(--status-pending); color: #fff; }

/* Quote block */
.quote-card {
  background: linear-gradient(180deg, var(--brand-cream-tint) 0%, #fff 100%);
  border: 1px solid var(--brand-cream);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
}
.quote-card h3 {
  font-size: 15px;
  color: var(--brand-dark);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.quote-card .quote-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.quote-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.quote-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.quote-stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--brand-dark);
}
.quote-stat-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.quote-breakdown {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.quote-breakdown th {
  background: var(--bg-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.quote-breakdown td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.quote-breakdown tr:last-child td { border-bottom: none; }
.quote-breakdown .num { text-align: right; font-variant-numeric: tabular-nums; }
.quote-breakdown tr.total td { background: var(--bg-soft); font-weight: 600; }

.quote-section {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.quote-section-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
  font-weight: 600;
}

/* Amendment card */
.amendment-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid #6a3a87;
  border-radius: var(--radius-lg);
  padding: 22px;
}
.amendment-card h3 {
  font-size: 15px;
  color: var(--brand-dark);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.amendment-status {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.amendment-status.draft { background: #ede9e0; color: var(--text-muted); }
.amendment-status.proposed { background: var(--status-pending-bg); color: var(--status-pending); }
.amendment-status.signed { background: var(--status-approved-bg); color: var(--status-approved); }

.amendment-fin {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

.amendment-summary {
  background: var(--bg-soft);
  border-left: 3px solid #6a3a87;
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.signature-box {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}
.signature-box.signed {
  border-style: solid;
  border-color: var(--status-approved);
  background: var(--status-approved-bg);
}
.signature-box .sig-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.signature-box .sig-name {
  font-family: "Brush Script MT", "Lucida Handwriting", cursive;
  font-size: 22px;
  color: var(--brand-dark);
  margin: 4px 0 6px;
  line-height: 1.2;
}
.signature-box .sig-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.signature-box.empty .sig-name {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-faint);
  font-style: italic;
}

/* Go-live tab specific */
.golive-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.golive-config .config-item {
  font-size: 13px;
}
.golive-config .config-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 3px;
}

.test-row {
  display: grid;
  grid-template-columns: 40px 1fr 100px 110px;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.test-row:last-child { border-bottom: none; }
.test-outcome {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.test-outcome.pass { background: var(--status-approved-bg); color: var(--status-approved); }
.test-outcome.fail { background: var(--status-rejected-bg); color: var(--status-rejected); }
.test-outcome.partial { background: var(--status-pending-bg); color: var(--status-pending); }
.test-row .test-meta { font-size: 11px; color: var(--text-muted); }
.test-row .test-notes { color: var(--text); }

.test-add-form {
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
}

/* Risk matrix */
.risk-matrix {
  display: grid;
  grid-template-columns: auto repeat(4, 1fr);
  gap: 2px;
  font-size: 11px;
  margin-top: 8px;
}
.risk-cell {
  padding: 6px;
  text-align: center;
  background: var(--bg-soft);
  border-radius: 3px;
  color: var(--text-muted);
}
.risk-axis { font-weight: 600; color: var(--brand-dark); }
.risk-low { background: #e8f4ec; color: #1a5430; }
.risk-med { background: #fdf4dc; color: #8a6510; }
.risk-high { background: #fbe9de; color: #8a3a08; }
.risk-crit { background: #fbeaea; color: #791f1f; }
.risk-cell.active {
  outline: 2px solid var(--brand-dark);
  font-weight: 600;
}

/* Impact/likelihood compact */
.risk-readout {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}
.risk-readout .item { font-size: 12px; }
.risk-readout .item-label { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; font-size: 10px; margin-bottom: 2px; }
.risk-readout .item-value { font-weight: 600; color: var(--brand-dark); font-size: 14px; }

/* Link types */
.link-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.link-row:last-child { border-bottom: none; }
.link-type-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  min-width: 130px;
}

/* Watchers */
.watcher-avatars {
  display: flex;
  margin-left: -4px;
}
.watcher-avatars .avatar {
  margin-left: -8px;
  border: 2px solid #fff;
  width: 26px; height: 26px;
  font-size: 10px;
}
.watcher-avatars .avatar:first-child { margin-left: 4px; }
.watcher-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px dashed var(--border-strong);
  margin-left: -8px;
  color: var(--text-muted);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
.watcher-add:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* Tabs inside CR detail */
.cr-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  margin-top: -8px;
  flex-wrap: wrap;
}
.cr-tabs a {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cr-tabs a:hover { color: var(--text); text-decoration: none; }
.cr-tabs a.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}
.cr-tabs .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--brand-cream);
  color: var(--brand-dark);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
}
.cr-tabs .badge.attention { background: var(--status-pending); color: #fff; }

/* Plan / rollback boxes */
.plan-box {
  background: var(--bg-soft);
  border-left: 3px solid var(--brand-accent);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-top: 8px;
}
.plan-box.rollback { border-left-color: var(--status-pending); }
.plan-box.testing { border-left-color: var(--status-implemented); }
.plan-empty {
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  padding: 14px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Sub-section heading inside cards */
.sub-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sub-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.sub-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sub-section h3 .req-tag {
  font-size: 10px;
  background: var(--status-rejected);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

/* Contact attempts table (emergency CRs) */
.contact-attempts {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}
.contact-attempts th, .contact-attempts td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.contact-attempts th {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--bg-soft);
}

/* Agreement page */
.agreement-header {
  background: linear-gradient(180deg, var(--brand-cream-tint) 0%, #fff 100%);
  border: 1px solid var(--brand-cream);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.agreement-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.agreement-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.agreement-stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.agreement-stat .value {
  font-size: 22px;
  font-weight: 600;
  color: var(--brand-dark);
}
.amendment-timeline-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.amendment-timeline-item:last-child { border-bottom: none; }
.amendment-timeline-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6a3a87;
  margin-top: 6px;
  flex-shrink: 0;
}

/* @mention suggestions */
.mention-suggestions {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
  min-width: 220px;
  max-height: 200px;
  overflow-y: auto;
}
.mention-suggestion {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.mention-suggestion:hover, .mention-suggestion.selected {
  background: var(--bg-soft);
}
.mention-chip {
  background: var(--brand-cream);
  color: var(--brand-dark);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
}

/* Empty state with action */
.empty-state {
  text-align: center;
  padding: 40px 24px;
}
.empty-state .empty-icon {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--brand-cream-tint);
  color: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.empty-state .empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 4px;
}
.empty-state .empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.footer {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 12px;
}
.footer a { color: var(--text-muted); }

/* Stat tiles on the dashboard */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
  display: block;
}
.stat-tile:hover {
  border-color: var(--brand-primary);
  transform: translateY(-1px);
  text-decoration: none;
}
.stat-tile.attention {
  background: linear-gradient(180deg, var(--brand-cream-tint) 0%, #fff 100%);
  border-color: var(--brand-cream);
}
.stat-tile .stat-count {
  font-size: 28px;
  font-weight: 600;
  color: var(--brand-dark);
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat-tile.attention .stat-count { color: var(--brand-primary); }
.stat-tile .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Form helper text */
.helper {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === v4 additions === */

/* New pill: changes requested */
.pill-changes { color: #6e3a14; background: #fce4cd; }

/* Class label tweaks for new terminology */
.class-retainer { background: #e8f4ec; border-color: var(--status-approved); color: #1a5430; }
.class-retainer .classification-icon { background: var(--status-approved); color: #fff; }
.class-billable { background: #efe7f8; border-color: #6a3a87; color: #4a2862; }
.class-billable .classification-icon { background: #6a3a87; color: #fff; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(40, 20, 20, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.18s;
  padding: 24px;
  overflow-y: auto;
}
.modal-overlay.open { opacity: 1; }
.modal-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(40, 20, 20, 0.22);
  transform: translateY(8px);
  transition: transform 0.2s;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.modal-overlay.open .modal-dialog { transform: translateY(0); }
.modal-lg { max-width: 760px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; color: var(--brand-dark); margin: 0; }
.modal-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 6px;
  padding: 0;
}
.modal-close:hover { background: var(--bg-soft); color: var(--text); }
.modal-body { padding: 22px 24px; }

/* Decision radio cards */
.decision-options {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.decision-option {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: border-color 0.15s, background 0.15s;
}
.decision-option:hover { border-color: var(--brand-primary); }
.decision-option.selected {
  border-color: var(--brand-primary);
  background: var(--brand-cream-tint);
}
.decision-option input[type="radio"] { margin-top: 3px; flex-shrink: 0; }
.decision-option .opt-label { font-weight: 600; font-size: 14px; color: var(--brand-dark); margin-bottom: 2px; }
.decision-option .opt-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* Condition checklist */
.condition-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}
.condition-item.done {
  background: var(--status-approved-bg);
  color: var(--text-muted);
}
.condition-item.done .condition-text {
  text-decoration: line-through;
}
.condition-item input[type="checkbox"] {
  margin: 3px 0 0; flex-shrink: 0;
}
.condition-text { flex: 1; }
.condition-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Repeatable input rows for adding conditions, change items */
.repeat-input {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.repeat-input input { margin: 0; flex: 1; }
.repeat-remove {
  background: none;
  border: 1px solid var(--border);
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 0;
}
.repeat-remove:hover { color: var(--status-rejected); border-color: var(--status-rejected); }
.repeat-add {
  background: none;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  margin-top: 4px;
}
.repeat-add:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* Quote phases */
.phase-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.phase-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.phase-row:last-child { border-bottom: none; }
.phase-row.total {
  background: var(--bg-soft);
  font-weight: 600;
}
.phase-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.phase-status.proposed { background: var(--bg-soft); color: var(--text-muted); }
.phase-status.approved { background: var(--status-approved-bg); color: var(--status-approved); }
.phase-status.deferred { background: var(--status-pending-bg); color: var(--status-pending); }
.phase-status.rejected { background: var(--status-rejected-bg); color: var(--status-rejected); }
.phase-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
}
.phase-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 130px;
}

/* Quote version history */
.quote-version-toggle {
  background: none;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
}
.quote-version-toggle:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.quote-version-history {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
}
.quote-version-item {
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.quote-version-item .superseded { color: var(--text-faint); text-decoration: line-through; }

/* Tags */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  margin-right: 4px;
}
.tag-chip::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
}
.tag-chip.removable { padding-right: 4px; cursor: default; }
.tag-chip .tag-remove {
  background: rgba(255,255,255,0.25);
  border: none;
  color: #fff;
  width: 16px; height: 16px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tag-chip .tag-remove:hover { background: rgba(255,255,255,0.45); }
.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.tag-pick-option {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  cursor: pointer;
  background: #fff;
}
.tag-pick-option:hover { border-color: var(--brand-primary); }
.tag-pick-option.selected {
  background: var(--brand-cream-tint);
  border-color: var(--brand-primary);
  font-weight: 500;
}

/* Schedule conflict warning */
.conflict-warning {
  background: #fdf4dc;
  border: 1px solid #e0c87a;
  border-left: 3px solid var(--status-pending);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 8px;
  font-size: 13px;
  color: #6b5410;
}
.conflict-warning strong { color: #4a3a08; }

/* Schedule / calendar view */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 14px;
}
.calendar-day-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 0;
  font-weight: 600;
}
.calendar-day {
  min-height: 84px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 12px;
}
.calendar-day.today { background: var(--brand-cream-tint); border-color: var(--brand-cream); }
.calendar-day.outside { background: var(--bg-soft); color: var(--text-faint); }
.calendar-day .day-num { font-weight: 600; color: var(--brand-dark); margin-bottom: 4px; }
.calendar-day.outside .day-num { color: var(--text-faint); }
.calendar-event {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
  background: var(--brand-cream);
  color: var(--brand-dark);
  cursor: pointer;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-event.emergency { background: var(--status-emergency-bg); color: var(--status-emergency); }
.calendar-event:hover { text-decoration: none; opacity: 0.85; }

/* Reports widgets */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.report-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.report-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.report-card .value {
  font-size: 28px;
  font-weight: 600;
  color: var(--brand-dark);
  line-height: 1.1;
  margin-bottom: 4px;
}
.report-card .sub { font-size: 12px; color: var(--text-muted); }
.report-bar {
  display: flex;
  height: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 12px;
}
.report-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 500;
}
.report-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
}
.report-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.report-legend-swatch {
  width: 12px; height: 12px; border-radius: 3px;
}

/* Edit history / diff */
.edit-item {
  border-left: 3px solid var(--border-strong);
  padding: 10px 14px;
  background: var(--bg-soft);
  margin-bottom: 10px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
}
.edit-item .edit-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.edit-diff {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  margin-top: 6px;
}
.edit-diff .field-name {
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 4px;
}
.edit-diff .old-value {
  color: #791f1f;
  background: var(--status-rejected-bg);
  padding: 2px 4px;
  border-radius: 3px;
  text-decoration: line-through;
}
.edit-diff .new-value {
  color: #1a5430;
  background: var(--status-approved-bg);
  padding: 2px 4px;
  border-radius: 3px;
}

/* Saved filter chips */
.saved-filters-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.saved-filter-chip {
  padding: 4px 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.saved-filter-chip:hover { border-color: var(--brand-primary); }
.saved-filter-chip.active {
  background: var(--brand-cream-tint);
  border-color: var(--brand-primary);
  font-weight: 500;
}

/* Template picker */
.template-list { display: grid; gap: 10px; }
.template-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.template-card:hover { border-color: var(--brand-primary); }
.template-card.selected {
  border-color: var(--brand-primary);
  background: var(--brand-cream-tint);
}
.template-card .tpl-name {
  font-weight: 600;
  color: var(--brand-dark);
  font-size: 14px;
  margin-bottom: 4px;
}
.template-card .tpl-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.template-card .tpl-meta {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}

/* Recurring rule cards */
.recurring-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.recurring-row.inactive { opacity: 0.55; }
.recurring-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.recurring-cadence {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-cream);
  color: var(--brand-dark);
}

/* Changes-requested response panel */
.changes-thread {
  border: 1.5px solid #d4a574;
  border-radius: var(--radius);
  padding: 16px;
  background: #fff8ec;
  margin-bottom: 16px;
}
.changes-thread h3 {
  font-size: 14px;
  color: #6e3a14;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.change-item {
  background: #fff;
  border: 1px solid #e8d4b3;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.change-item.resolved {
  border-color: var(--status-approved);
  background: var(--status-approved-bg);
}
.change-item .change-num {
  font-size: 11px;
  font-weight: 700;
  color: #6e3a14;
  margin-bottom: 2px;
}
.change-item .change-text {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 4px;
}
.change-item .change-priority {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  font-weight: 600;
}
.change-item .change-priority.must { background: var(--status-rejected-bg); color: var(--status-rejected); }
.change-item .change-priority.should { background: var(--status-pending-bg); color: var(--status-pending); }
.change-item .change-priority.could { background: var(--bg-soft); color: var(--text-muted); }
.change-response {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.change-response-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}

/* CR list rows on dashboard (restored) */
.cr-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.cr-row:last-child { border-bottom: none; }
.cr-row:hover { text-decoration: none; background: var(--bg-soft); margin: 0 -8px; padding: 12px 8px; border-radius: var(--radius); }
.cr-row.age-warm { box-shadow: inset 3px 0 0 #f0a040; }
.cr-row.age-hot { box-shadow: inset 3px 0 0 #d4581a; }
.cr-row.age-stale { box-shadow: inset 3px 0 0 var(--status-rejected); }
