/* Shared white-ledger primitives for the active consultant workbench.
   Cards, editable fields, action controls, and generic work tables belong
   here so workflow and phase styles can refine them without rebuilding them. */

/* Reading surfaces */
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  box-shadow: var(--sm);
}

.card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 19px;
  letter-spacing: -.025em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.3px;
  line-height: 1.55;
  text-wrap: pretty;
}

.cardHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.cardHead h3 {
  margin-bottom: 6px;
}

.cardHead :is(h2, h3, h4) {
  color: var(--navy);
}

.cardHead :is(p, small) {
  color: var(--muted);
  font-weight: 400;
}

.card > :is(h3, h4):first-child {
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

/* Editable values intentionally differ from reading text. */
input,
select,
textarea {
  border: 1px solid rgba(63, 83, 106, .18);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea, [contenteditable="true"]) {
  border: 1px solid #b9c2cb;
  border-left: 3px solid var(--entry);
  border-radius: 6px;
  background-color: var(--entry-paper);
  background-image: repeating-linear-gradient(180deg, transparent 0, transparent 25px, rgba(54, 95, 141, .075) 26px);
  color: var(--entry-ink);
  font-family: var(--font-entry);
  font-size: .94em;
  font-weight: 600;
  letter-spacing: -.012em;
  line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea, [contenteditable="true"]):hover {
  border-color: #8fa2b4;
}

body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea, [contenteditable="true"]):focus {
  border-color: var(--entry);
  outline: 3px solid rgba(54, 95, 141, .16);
  outline-offset: 1px;
  background-color: #fff;
  box-shadow: 0 0 0 1px var(--entry);
}

body :is(input, textarea)::placeholder {
  color: #87919a;
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
}

body :is(input, select, textarea):disabled,
body :is(input, textarea)[readonly] {
  border-left-color: #aeb4b9;
  background: #f1f1ee;
  color: #6e757b;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--blue);
}

.wideField {
  grid-column: 1 / -1;
}

/* Workbench actions and their local status copy */
.actionRow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
  background: #f8fbff;
}

.actionRow.compact {
  border-bottom: 0;
  padding: 0 0 14px;
  background: transparent;
}

.actionRow.evenSpread {
  justify-content: flex-start;
  padding: 14px 16px;
}

.actionRow.evenSpread .actionBtn {
  min-width: 160px;
  flex: 0 1 auto;
  justify-content: center;
  text-align: center;
}

.actionRow.evenSpread .appMessage {
  flex-basis: 100%;
  text-align: center;
}

.actionBtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #bfc7ce;
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.actionBtn:not(.primary)::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 1px;
  background: var(--blue);
  box-shadow: none;
}

.actionBtn.small {
  padding: 7px 11px;
}

.actionBtn:hover {
  border-color: var(--blue);
  background: #f2f5f8;
  color: var(--entry-ink);
  transform: translateY(-1px);
}

.actionBtn:active {
  transform: translateY(0);
}

.actionBtn.primary {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.actionBtn.danger {
  color: var(--r0t);
}

.actionBtn.danger::before {
  background: var(--r0);
}

.appMessage {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.appMessage[data-tone="warn"] {
  color: #92400e;
}

.appMessage[data-tone="error"] {
  color: var(--r0t);
}

/* Scrollable ledger tables */
.tableWrap {
  max-height: 450px;
  overflow: auto;
  overflow-x: auto;
  border: 1px solid rgba(63, 83, 106, .13);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #b9d2f2 transparent;
  scrollbar-width: thin;
}

.tableWrap.short {
  max-height: min(68vh, 760px);
}

.tableWrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.tableWrap::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 999px;
  background: #b9d2f2;
}

.artifactTable {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.workflowTable {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.workflowTableCard {
  overflow: hidden;
}

.workflowTable td:last-child {
  white-space: nowrap;
}

.workflowRemove {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--r0t);
  font-weight: 700;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.artifactTable th,
.artifactTable td {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}

.artifactTable th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-color: rgba(63, 83, 106, .13);
  background: #f6f8f9;
  box-shadow: 0 1px 0 var(--line);
  color: var(--hz1t);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.artifactTable td {
  border-color: rgba(63, 83, 106, .10);
}

.artifactTable td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.artifactTable tbody tr:nth-child(even) td {
  background: #fafcff;
}

.artifactTable tbody tr:hover td {
  background: #f1f7ff;
}

.artifactTable select,
.artifactTable input,
.artifactTable textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.artifactId {
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

th {
  border-color: rgba(63, 83, 106, .13);
  background: #f0f2f3;
  color: #34424f;
  font-size: 11px;
}

td {
  border-color: rgba(63, 83, 106, .10);
}

@media (max-width: 720px) {
  .actionRow.evenSpread .actionBtn {
    min-width: 0;
    flex: 1 1 150px;
  }
}

@media print {
  .card {
    box-shadow: none;
  }
}
