/* Buttons, cards, forms, tables, badges. */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card + .card { margin-top: 1rem; }

/* Plan-gated feature prompt: a quiet accent, not a hard sell. */
.upgrade-card { border-left: 3px solid var(--accent); }

/* Key/value profile list. */
.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.25rem; margin: 0; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: .92rem; font-weight: 500;
  padding: .5rem .9rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: #cfd6d3; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #275c4e; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }

label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .25rem; }
input, select, textarea {
  width: 100%; font: inherit; padding: .55rem .65rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #cfe3db; border-color: var(--accent); }
.field { margin-bottom: .9rem; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }

.badge {
  display: inline-block; font-size: .75rem; font-weight: 600;
  padding: .15rem .5rem; border-radius: 999px; background: #eef1f0; color: var(--ink-soft);
}
.error { color: var(--band-misaligned); font-size: .9rem; min-height: 1.2em; }
.toast { font-size: .85rem; color: var(--accent); min-height: 1.2em; }

/* UX-1: shared in-app confirm + notify (additive; see specs/ux1-inapp-confirm-notify.md). */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(27, 34, 32, 0.45);
}
.modal-overlay[hidden] { display: none !important; }
.modal-card {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: 0 12px 40px rgba(27, 34, 32, 0.12);
}
.modal-card:focus { outline: 2px solid #cfe3db; outline-offset: 2px; }
.modal-title { font-size: 1.05rem; margin: 0 0 0.5rem; color: var(--ink); }
.modal-body { font-size: 0.92rem; margin: 0 0 1rem; color: var(--ink-soft); }
.modal-actions { justify-content: flex-end; margin: 0; }
.btn-danger {
  background: var(--band-misaligned);
  color: #fff;
  border-color: var(--band-misaligned);
}
.btn-danger:hover { background: #9a3a31; border-color: #9a3a31; }

.notice-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.88rem;
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(27, 34, 32, 0.08);
  pointer-events: auto;
}
.notice-text { flex: 1; line-height: 1.4; }
.notice-dismiss {
  flex-shrink: 0;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.15rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.notice-dismiss:hover { color: var(--ink); }
.notice--success { border-left: 3px solid var(--band-optimized); }
.notice--info { border-left: 3px solid var(--band-aligned); }
.notice--warning { border-left: 3px solid var(--band-drifting); background: #f4e6cf; }
.notice--error { border-left: 3px solid var(--band-misaligned); background: #f4dad6; color: var(--ink); }

/* Independent Alignment Review (self-vs-expert) -- shared by results + report.
   The table inherits the global table styles; only the stat row is new. */
.iar-overall { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .75rem 0 1rem; }
.iar-stat { min-width: 6rem; }
.iar-num { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.iar-label { font-size: .8rem; color: var(--ink-soft); margin-top: .15rem; }

/* Operational read (OTIF) — shared by org-profile. */
.op-read-overall { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .75rem 0 1rem; }
.op-read-stat { min-width: 6rem; }
.op-read-num { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.op-read-label { font-size: .8rem; color: var(--ink-soft); margin-top: .15rem; }
.op-read-dispositions { font-size: .85rem; margin: .5rem 0; }
.op-read-components { font-size: .85rem; margin: -.5rem 0 .75rem; }
.op-read-table { width: 100%; margin-top: .5rem; }
.op-read-card .delta-down { color: var(--band-misaligned); font-weight: 600; }
.op-read-card .delta-up { color: var(--band-optimized); font-weight: 600; }
.op-read-card .delta-flat { color: var(--ink-soft); }

/* Oversight performance trend (gap-over-time) */
.ovp-rollup { margin: 0 0 .75rem; }
.ovp-metric { padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.ovp-metric:last-child { border-bottom: none; }
.ovp-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.ovp-series { font-size: .85rem; margin-top: .2rem; }
.ovp-head .delta-up, .ovp-rollup .delta-up { color: var(--band-optimized); font-weight: 600; }
.ovp-head .delta-down, .ovp-rollup .delta-down { color: var(--band-misaligned); font-weight: 600; }
.ovp-head .delta-flat, .ovp-rollup .delta-flat { color: var(--ink-soft); }

/* Dollar impact panel */
.cost-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin: .5rem 0; }
.cost-form .field { margin: 0; }
.cost-form input { width: 9rem; }
.dv-totals { margin: 0 0 .5rem; }
.dv-metric { padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.dv-metric:last-child { border-bottom: none; }
