:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background-color: #f5f6fb;
  color: #1f2937;
  --primary: #29307b;
  --primary-600: #252b6e;
  --primary-100: #eef0fb;
  --neutral-100: #f8f9fd;
  --neutral-200: #eef1f7;
  --neutral-300: #d7dbea;
  --text-muted: #6b7280;
  --shadow: 0 20px 40px rgba(41, 48, 123, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--neutral-100);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 8px;
}

p {
  margin: 0;
  margin-bottom: 8px;
  color: var(--text-muted);
}

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

.hidden {
  display: none;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card.nested {
  margin-top: 24px;
  padding: 20px;
  background: var(--neutral-100);
  border: 1px dashed var(--neutral-300);
}

.card-grid {
  display: grid;
  gap: 20px;
}

.card-header {
  margin-bottom: 20px; /* ajuste o valor como quiser */
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 14px;
  margin-bottom: 12px;
}

.two-columns {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.card p {
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(280px, 1fr);
  gap: 28px;
  padding: 40px;
  align-items: center;
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-aside {
  display: grid;
  gap: 18px;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.app-view {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #f4f5fb;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--neutral-200);
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sidebar-brand h2 {
  font-size: 1.1rem;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.menu-label {
  margin-top: 8px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.nav-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  color: #1f2937;
  font-weight: 500;
  cursor: pointer;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 16px;
}

.user-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--primary-100);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 600;
}

.main {
  padding: 32px 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  background: var(--primary-100);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.inline-info{
  padding:12px 14px;
  border-radius:12px;
  background: #f6f7fe;
  border: 1px solid rgba(41,48,123,0.12);
  color: #2a2f48;
  font-size: 0.92rem;
}

.page {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.page.active {
  display: flex;
}

.form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: #1f2937;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--neutral-300);
  font-family: inherit;
  font-size: 0.9rem;
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row {
  display: flex;
  gap: 12px;
}

.btn {
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 0.9rem;
}

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

.btn.primary:hover {
  background: var(--primary-600);
}

.btn.outline {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--neutral-300);
}

.status {
  font-size: 0.75rem;
  color: var(--primary);
}

.status.error {
  color: #b91c1c;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.table th,
.table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--neutral-200);
  text-align: left;
}

.table th {
  color: #374151;
  font-weight: 600;
}

.empty-state {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.checkbox-list {
  display: grid;
  gap: 0;                       /* sem “cards” separados */
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--neutral-300);
  background: #fff;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;      /* remove o “card” */
  border: none;                 /* remove borda do item */
  padding: 10px 6px;            /* item mais leve */
  border-radius: 0;
  font-size: 0.75rem;
}

/* separador entre itens (efeito lista) */
.checkbox-item + .checkbox-item {
  border-top: 1px solid var(--neutral-200);
}

/* deixa o checkbox com tamanho consistente */
.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* opcional: se você renderiza texto com <small> dentro do item */
.checkbox-item small {
  color: var(--text-muted);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline details {
  background: var(--neutral-100);
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid var(--neutral-200);
}

.timeline summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.timeline summary::-webkit-details-marker {
  display: none;
}

.timeline-card {
  display: grid;
  gap: 8px;
  padding: 12px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-100);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: grid;
  gap: 12px;
  z-index: 20;
}

.toast {
  background: #fff;
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 240px;
}

.toast.error {
  border-left-color: #b91c1c;
}

@media (max-width: 960px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .app-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .two-columns {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* garante que .hidden vença regras de display de views */
.login-view.hidden,
.app-view.hidden {
  display: none;
}






/* --- Statement / Extrato (timeline cards - updated layout) --- */
.timeline{
  display:grid;
  gap: 12px;
}

/* If JS uses <details>/<summary>, style them like the new pay-card */
.timeline details{
  border: 1px solid rgba(41,48,123,0.16);
  border-radius: 16px;
  background:#fff;
  overflow:hidden;
  padding:0;
}

.timeline details > summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
  gap:12px;
  padding: 12px 14px;
}

.timeline details > summary::-webkit-details-marker{display:none;}

.timeline details > summary:hover{
  background: rgba(41,48,123,0.05);
}

/* Body inside details */
.timeline details > .timeline-card,
.timeline details > div,
.timeline details > section{
  padding: 0 14px 14px;
}

.timeline details[open] > .timeline-card,
.timeline details[open] > div,
.timeline details[open] > section{
  display:block;
}

/* Optional helpers for common inner elements */
.timeline .tag{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background: var(--primary-100);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* --- Statement / Extrato --- */
.table-wrap{overflow:auto; border-radius: 14px; border:1px solid var(--neutral-300); background:#fff;}
table.dense th, table.dense td{padding:10px 10px;}
.badge{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(41,48,123,0.18);
  background: rgba(41,48,123,0.08);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.78rem;
  gap:8px;
}
.badge.muted{
  background: rgba(107,114,131,0.08);
  border-color: rgba(107,114,131,0.20);
  color: #4b5563;
}
.timeline{
  display:grid;
  gap: 12px;
}
.pay-card{
  border: 1px solid rgba(41,48,123,0.16);
  border-radius: 16px;
  background:#fff;
  overflow:hidden;
}
.pay-head{
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
  gap: 12px;
  padding: 12px 14px;
  cursor:pointer;
  margin-top: 10px;
  margin-bottom: 6px;
}
.pay-head:hover{background: rgba(41,48,123,0.05);}
.pay-title strong{display:block;}
.pay-title small{color: var(--text-muted);}
.pay-sum{
  text-align:right;
  min-width: 160px;
}
.pay-sum .big{
  font-weight: 900;
  font-size: 1rem;
}
.pay-sum .mini{
  color: var(--text-muted);
  font-size: 0.75rem;
}
.pay-body{
  display:none;
  padding: 0 14px 14px;
}
.pay-card.is-open .pay-body{display:block;}
.pay-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}
.alloc-row{
  border: 1px solid rgba(41,48,123,0.10);
  border-radius: 14px;
  padding: 10px 12px;
  background: #f6f7fe;
}
.alloc-row .line{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.alloc-row .line .muted{font-size:0.75rem;}
.divider {
  margin: 16px 0;
  height: 1px;
  background-color: #ccc;
}

.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 9999; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
}

.modal-dialog {
  position: relative;
  width: min(900px, calc(100% - 24px));
  margin: 48px auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
  padding: 16px;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.icon-btn {
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
}

.divider { height: 1px; background: rgba(0,0,0,.08); margin: 14px 0; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 10px;
}

.checkbox-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  background: rgba(0,0,0,.02);
}

.checkbox-item input { margin-top: 3px; }
.checkbox-item .meta { display: flex; flex-direction: column; gap: 2px; }
.checkbox-item .meta .key { font-weight: 600; font-size: 13px; }
.checkbox-item .meta .desc { font-size: 12px; opacity: .75; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 860px) {
  .checkbox-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.table-wrap { overflow: auto; }

/* --- Delete entity button (trash icon) --- */
.delete-entity-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.3;
  transition: opacity 0.2s, transform 0.15s;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
}
.delete-entity-btn:hover {
  opacity: 0.85;
  transform: scale(1.15);
  background: rgba(185, 28, 28, 0.08);
}

/* --- Hold-to-confirm delete button --- */
.btn-hold-delete {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 300px;
  padding: 14px 24px;
  border-radius: 12px;
  border: 2px solid #b91c1c;
  background: #fff;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.2s, color 0.2s;
}
.btn-hold-delete:hover {
  background: #fef2f2;
}
.btn-hold-delete:active {
  background: #fee2e2;
}
.btn-hold-delete.hold-complete {
  background: #b91c1c;
  color: #fff;
}

.btn-hold-label {
  pointer-events: none;
}

.btn-hold-progress-track {
  width: 100%;
  height: 4px;
  background: #fecaca;
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
}

.btn-hold-progress-bar {
  height: 100%;
  width: 0%;
  background: #b91c1c;
  border-radius: 999px;
  transition: width 0.03s linear;
}

.pay-right{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

/* ===== Extrato: filtros ===== */
.statement-controls{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  margin: 8px 0 10px;
}

.seg{
  display:inline-flex;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  border-radius: 999px;
  padding: 4px;
  gap:4px;
}

.seg button{
  border:0;
  background:transparent;
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:600;
  font-size:12px;
  color: rgba(255,255,255,.75);
}

.seg button.is-active{
  background: rgba(255,255,255,.10);
  color:#fff;
}

.toggle-chip{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.75);
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:600;
  font-size:12px;
}

.toggle-chip.is-active{
  background: rgba(255,255,255,.10);
  color:#fff;
}

.statement-sep td{
  padding:10px 12px;
  font-size:12px;
  font-weight:700;
  color: rgba(255,255,255,.65);
  letter-spacing:.02em;
}

/* ============================
   Onboarding Wizard
   ============================ */
.onboarding-wizard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.wizard-step .step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  background: var(--neutral-200);
  color: var(--text-muted);
  transition: all 0.2s;
}

.wizard-step.active .step-number {
  background: var(--primary);
  color: #fff;
}

.wizard-step.active {
  color: var(--primary);
  font-weight: 600;
}

.wizard-step.completed .step-number {
  background: #059669;
  color: #fff;
}

.wizard-step.completed {
  color: #059669;
}

.wizard-step + .wizard-step::before {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  background: var(--neutral-300);
  margin-right: 8px;
}

.wizard-step.completed + .wizard-step::before,
.wizard-step.active + .wizard-step::before {
  background: var(--primary);
}

.wizard-panel {
  display: none;
}

.wizard-panel.active {
  display: block;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--neutral-200);
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--neutral-300);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin: 16px 0;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-100);
}

.upload-area .upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--primary-100);
  border-radius: 8px;
  margin: 16px 0;
  font-size: 14px;
}

.upload-file-info #upload-file-name {
  font-weight: 600;
}

.upload-file-info #upload-file-size {
  color: var(--text-muted);
}

/* Progress bar */
.progress-container {
  margin: 20px 0;
}

.progress-bar {
  height: 12px;
  background: var(--neutral-200);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.progress-text #exec-progress-text {
  font-weight: 600;
  color: var(--primary);
}

/* Integration configuration cards */
.integration-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.integration-card {
  display: block;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  background: #fff;
}

.integration-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 2px 8px rgba(99,102,241,0.08);
}

.integration-card:has(input:not(:checked)) {
  opacity: 0.55;
  background: var(--neutral-50, #f9fafb);
}

.integration-card:has(input:not(:checked)):hover {
  opacity: 0.8;
}

.integration-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.integration-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.integration-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.integration-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.integration-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--neutral-300);
  border-radius: 999px;
  transition: background 0.2s;
  cursor: pointer;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Legacy config-toggles (kept for compatibility) */
.config-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

/* Validation errors */
.error-list {
  max-height: 200px;
  overflow-y: auto;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 16px;
}

.error-list p {
  color: #991b1b;
  font-size: 13px;
  margin: 4px 0;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.alert.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* Status badges for results */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.success { background: #d1fae5; color: #065f46; }
.status-badge.partial { background: #fef3c7; color: #92400e; }
.status-badge.error { background: #fecaca; color: #991b1b; }
.status-badge.skipped { background: var(--neutral-200); color: var(--text-muted); }
.status-badge.pending { background: var(--neutral-200); color: var(--text-muted); }
.status-badge.running { background: #dbeafe; color: #1e40af; }

/* Step result icons in results table */
.step-icon { font-size: 16px; cursor: default; }
.step-icon.ok { color: #059669; }
.step-icon.warn { color: #d97706; }
.step-icon.fail { color: #dc2626; }
.step-icon.skip { color: #9ca3af; }

/* Step chips in results table */
.step-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: default;
}
.step-chip.chip-ok { background: #d1fae5; color: #065f46; }
.step-chip.chip-fail { background: #fecaca; color: #991b1b; }
.step-chip.chip-warn { background: #fef3c7; color: #92400e; }
.step-chip.chip-skip { background: var(--neutral-100, #f3f4f6); color: #9ca3af; }

/* Result summary banner */
.result-banner {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.banner-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.banner-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.banner-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* Results legend */
.results-legend {
  display: flex;
  gap: 18px;
  padding: 10px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-item .step-icon { font-size: 13px; }

/* Results detail table */
.results-detail-table { border-collapse: collapse; }
.results-detail-table td, .results-detail-table th { text-align: center; }
.results-detail-table td:nth-child(2),
.results-detail-table td:nth-child(3),
.results-detail-table th:nth-child(2),
.results-detail-table th:nth-child(3) { text-align: left; }

.result-row:hover { background: var(--neutral-50, #f9fafb); }
.result-row.row-error { border-left: 3px solid #dc2626; }
.result-row.row-partial { border-left: 3px solid #d97706; }
.result-row.row-skipped { opacity: 0.5; }

.expand-arrow {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s;
  width: 14px;
  text-align: center;
}

/* Detail panel inside expanded row */
.result-detail-row td { padding: 0 !important; background: var(--neutral-50, #f9fafb); }
.result-detail-panel {
  padding: 14px 20px 14px 42px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  padding: 3px 0;
}
.detail-line.sub { padding-left: 20px; }
.detail-label {
  min-width: 180px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.detail-val { color: var(--text-muted); word-break: break-word; }
.detail-val.ok { color: #059669; font-weight: 500; }
.detail-val.fail { color: #dc2626; font-weight: 500; }
.detail-val.warn { color: #d97706; font-weight: 500; }
.detail-val.muted { color: #9ca3af; }

/* Inline icon button (e.g. row remove) */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.4;
  transition: opacity 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover {
  opacity: 1;
  background: rgba(220, 38, 38, 0.08);
}
.btn-icon:hover svg {
  stroke: #dc2626;
}

/* Table wrap for horizontal scroll */
.table-wrap {
  overflow-x: auto;
}

/* ── Communications Timeline ────────────────────────────────────────── */

.comm-timeline {
  position: relative;
  padding-left: 28px;
}

.comm-timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--neutral-300);
  border-radius: 2px;
}

.comm-timeline-item {
  position: relative;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--neutral-200);
  box-shadow: 0 2px 8px rgba(41, 48, 123, 0.05);
  transition: box-shadow 0.2s, transform 0.2s;
}

.comm-timeline-item:hover {
  box-shadow: 0 4px 16px rgba(41, 48, 123, 0.1);
  transform: translateY(-1px);
}

.comm-timeline-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dot-bg, var(--primary));
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--dot-bg, var(--neutral-300));
}

.comm-timeline-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.comm-timeline-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  margin-bottom: 8px;
}

.comm-timeline-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.comm-timeline-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comm-timeline-meta strong {
  font-weight: 600;
  color: #1f2937;
}

.comm-timeline-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 4px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.comm-timeline-item:hover .comm-timeline-delete {
  opacity: 0.5;
}

.comm-timeline-delete:hover {
  opacity: 1 !important;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

/* Color swatch in event types table */
.color-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--neutral-300);
  vertical-align: middle;
}
