:root {
  --bg: #f6f1e8;
  --white: #ffffff;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --ink: #172033;
  --muted: #687082;
  --line: #e7dccb;
  --accent: #ff7a59;
  --accent-deep: #d95a36;
  --accent-soft: #ffe4db;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --panel-shadow: 0 18px 48px rgba(23, 32, 51, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 122, 89, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(23, 32, 51, 0.08), transparent 30%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%);
  min-height: 100vh;
}

/* ── Loading overlay ─────────────────────────────────────────────── */
#loading-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(246, 241, 232, 0.88);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
}
#loading-overlay p { margin: 0; font-weight: 700; color: var(--muted); }
.spinner-lg {
  width: 48px; height: 48px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Toast notifications ─────────────────────────────────────────── */
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: all;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 700; color: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  max-width: 360px;
  animation: toastIn .22s ease forwards;
}
.toast.out { animation: toastOut .22s ease forwards; }
.toast.success { background: #16a34a; }
.toast.error   { background: var(--danger); }
.toast.info    { background: #2563eb; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
@keyframes toastIn  { from { opacity:0; transform: translateX(40px); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity:1; transform: translateX(0);    } to { opacity:0; transform: translateX(40px); } }

/* ── Button spinner ──────────────────────────────────────────────── */
.spinner-sm {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Layout ──────────────────────────────────────────────────────── */
.shell { max-width: 1520px; margin: 0 auto; padding: 28px; }

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

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

.brand-mark {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff9367 100%);
  color: #fff; font-weight: 900; letter-spacing: -0.04em;
  box-shadow: 0 14px 30px rgba(255, 122, 89, 0.24);
}

.brand-title {
  font-size: 18px; font-weight: 900; letter-spacing: -0.02em;
}

.sidebar,
.panel-card, .result-card {
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid rgba(231, 220, 203, 0.9);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(10px);
}

/* ── Workflow steps ───────────────────────────────────────────────── */
.workflow {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.workflow-step {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(231, 220, 203, 0.95);
  border-radius: 18px; padding: 18px 18px 16px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  user-select: none;
}
.workflow-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(255, 122, 89, .14);
  border-color: var(--accent);
}
.workflow-step.active-step {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.workflow-step span {
  display: block; color: var(--accent-deep); font-weight: 800;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.workflow-step strong { display: block; margin-bottom: 6px; font-size: 16px; }
.workflow-step p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.step-arrow { float: right; color: var(--accent); font-size: 18px; margin-top: -2px; }

/* ── Main layout ─────────────────────────────────────────────────── */
.layout {
  display: grid; grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px; align-items: start;
}

.sidebar { position: sticky; top: 24px; border-radius: var(--radius-lg); padding: 16px; }
.sidebar-title {
  margin: 4px 6px 12px; color: var(--muted);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
}

.nav-button {
  width: 100%; text-align: left; border: 0;
  background: transparent; color: var(--ink);
  font: inherit; font-weight: 700;
  padding: 14px 16px; border-radius: 14px;
  cursor: pointer; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}
.nav-button:hover { background: rgba(255, 122, 89, 0.08); transform: translateX(4px); }
.nav-button.active {
  background: linear-gradient(135deg, var(--accent) 0%, #ff9367 100%);
  color: #fff;
  box-shadow: 0 16px 30px rgba(255, 122, 89, 0.25);
}
.nav-badge {
  font-size: 11px; font-weight: 800;
  background: rgba(23,32,51,.1); color: var(--ink);
  border-radius: 999px; padding: 2px 8px; min-width: 24px; text-align: center;
}
.nav-button.active .nav-badge { background: rgba(255,255,255,.25); color: #fff; }

.main-column { display: grid; gap: 20px; }

.panel-card, .result-card { border-radius: var(--radius-lg); padding: 22px; }

.panel-header {
  display: flex; justify-content: space-between; gap: 16px;
  align-items: flex-start; margin-bottom: 20px;
}
.panel-header h2 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.02em; }
.panel-header p  { margin: 0; color: var(--muted); line-height: 1.6; max-width: 820px; }

.sub-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; background: rgba(23, 32, 51, 0.06);
  border-radius: 999px; color: var(--ink);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}

.grid-2 { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; }
.stack  { display: grid; gap: 18px; }

.section-card {
  background: var(--surface-strong); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px;
}
.section-card h3 { margin: 0 0 8px; font-size: 18px; }
.section-card p  { margin: 0 0 16px; color: var(--muted); line-height: 1.5; font-size: 14px; }

.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: var(--ink); }
.label-hint { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 6px; }

input, select {
  width: 100%; border: 1.5px solid var(--line);
  background: #fff; border-radius: 12px; padding: 12px 14px;
  font: inherit; color: var(--ink); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus {
  border-color: rgba(255, 122, 89, 0.65);
  box-shadow: 0 0 0 4px rgba(255, 122, 89, 0.12);
}
input.invalid, select.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(239,68,68,.1);
}
.field-error { margin-top: 6px; font-size: 12px; color: var(--danger); font-weight: 600; display: none; }
.field-error.visible { display: block; }
.api-error-summary {
  display: grid; gap: 6px;
  margin: 0 0 16px; padding: 12px 14px;
  border: 1px solid rgba(239, 68, 68, .32);
  border-radius: 14px;
  background: rgba(239, 68, 68, .08);
  color: #991b1b;
  font-size: 13px; line-height: 1.45;
}
.api-error-summary strong { color: #7f1d1d; }
.api-error-summary ul { margin: 2px 0 0 18px; padding: 0; }
.api-error-summary li { margin: 3px 0; }
.api-field-error { line-height: 1.35; }

.helper { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.button {
  border: 0; border-radius: 12px; padding: 12px 16px;
  font: inherit; font-weight: 800; cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }
.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #ff9367 100%);
  color: #fff; box-shadow: 0 12px 24px rgba(255, 122, 89, 0.22);
}
.button-secondary { background: rgba(23, 32, 51, 0.08); color: var(--ink); }
.button-danger { background: var(--danger); color: #fff; }
.button-small { padding: 8px 10px; font-size: 12px; border-radius: 10px; }
.button.hidden { display: none; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Table ───────────────────────────────────────────────────────── */
.table-card {
  background: var(--surface-strong); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
}
.table-toolbar {
  display: flex; justify-content: space-between; gap: 12px;
  align-items: center; padding: 18px 18px 0;
}
.table-toolbar h3  { margin: 0; font-size: 18px; }
.table-toolbar p   { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.table-wrap { overflow: auto; padding: 14px 18px 18px; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left; padding: 12px 10px;
  border-bottom: 1px solid rgba(231, 220, 203, 0.8);
  vertical-align: middle; font-size: 13px;
}
th {
  color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800;
}
tbody tr:hover { background: rgba(255, 122, 89, 0.04); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }

/* ── Pill / badge ────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 5px 10px;
  background: rgba(255, 122, 89, 0.12);
  color: var(--accent-deep); font-size: 12px; font-weight: 700;
}
.pill.filter-active {
  background: rgba(245,158,11,.15); color: #92400e;
}
.pill.success { background: rgba(34,197,94,.12); color: #15803d; }

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px;
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ── Associations ─────────────────────────────────────────────────  */
.association-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.links-expand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 4px 0; }
.links-expand-grid.single { grid-template-columns: 1fr; }
.col-expand { width: 32px; padding-right: 0 !important; }
.links-mini-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.links-mini-table thead th { padding: 4px 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border-bottom: 2px solid var(--line); text-align: left; }
.links-mini-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); color: var(--ink); }
.links-mini-table tr:last-child td { border-bottom: none; }
.links-mini-table tbody tr:hover td { background: var(--accent-soft); }
.row-expand-toggle { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 10px; padding: 4px 6px; border-radius: 6px; transition: color .15s, background .15s; line-height: 1; }
.row-expand-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.row-expand-toggle.open { color: var(--accent); }
.association-list { display: grid; gap: 10px; margin-top: 14px; }
.association-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.association-item strong { display: block; margin-bottom: 4px; }
.empty-note { color: var(--muted); font-size: 13px; padding: 12px 0 4px; }

/* Module settings toggles */
.module-toggle-list { display: grid; gap: 10px; margin-top: 6px; }
.module-toggle-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; cursor: pointer;
}
.module-toggle-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.module-checkbox { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.module-toggle-label { flex: 1; font-weight: 600; }
.module-order-btns { display: flex; gap: 4px; }
.module-order-btn {
  width: 28px; height: 28px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); cursor: pointer;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.module-order-btn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.module-order-btn:disabled { opacity: .3; cursor: default; }
.plugin-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 7px; margin-left: 6px;
  vertical-align: middle;
}
.plugin-delete-btn {
  font-size: 12px; padding: 4px 10px; font-family: inherit; font-weight: 600;
  border: 1px solid var(--danger); border-radius: 8px;
  color: var(--danger); background: transparent; cursor: pointer;
  transition: background .12s;
}
.plugin-delete-btn:hover { background: rgba(239,68,68,.08); }
.utility-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  color: var(--muted); background: rgba(104,112,130,.1);
  border-radius: 999px; padding: 1px 7px; margin-left: 6px;
  vertical-align: middle;
}

/* ── Result panel ────────────────────────────────────────────────── */
.result-card pre {
  margin: 14px 0 0;
  min-height: 160px; max-height: 380px; overflow: auto;
  border-radius: 16px; padding: 18px;
  background: #181b2e; color: #d8e0ff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px; line-height: 1.55; white-space: pre-wrap;
}
.result-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.result-status.ok  { background: rgba(34,197,94,.12); color: #15803d; }
.result-status.err { background: rgba(239,68,68,.12); color: #b91c1c; }

/* ── Associate modal ─────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(23, 32, 51, .56);
  backdrop-filter: blur(4px);
  z-index: 9500;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid rgba(231, 220, 203, .95);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0,0,0,.32);
  opacity: 1;
  isolation: isolate;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 0;
}
.modal-header h3 { font-size: 17px; font-weight: 700; margin: 0; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--muted); line-height: 1;
  padding: 4px 8px; border-radius: 8px;
  transition: background .12s;
}
.modal-close:hover { background: rgba(23,32,51,.08); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  padding: 16px 24px; display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--line);
}
.assoc-tabs {
  display: flex; gap: 8px; margin-bottom: 4px;
}
.assoc-tab {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: border-color .12s, background .12s;
}
.assoc-tab:has(input:checked) {
  border-color: var(--accent); background: rgba(255,109,63,.07); color: var(--accent);
}
.assoc-tab input { display: none; }

/* ── Action dropdown menu ────────────────────────────────────────── */
.action-menu { position: relative; display: inline-block; }

.action-trigger {
  border: none; background: transparent;
  border-radius: 8px; padding: 4px 10px;
  cursor: pointer; font-size: 20px; font-weight: 700;
  color: var(--muted); line-height: 1;
  transition: background .12s, color .12s;
}
.action-trigger:hover { background: rgba(23,32,51,.08); color: var(--ink); }

.action-dropdown {
  display: none;
  position: absolute; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 6px;
  box-shadow: 0 12px 36px rgba(0,0,0,.13);
  min-width: 176px; z-index: 300; white-space: nowrap;
  animation: dropIn .14s ease;
}
@keyframes dropIn { from { opacity:0; transform: translateY(-6px); } to { opacity:1; transform: translateY(0); } }

.action-menu.open .action-dropdown { display: block; }

.action-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 14px; border: none; background: transparent;
  border-radius: 9px; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--ink);
  transition: background .1s;
}
.action-item:hover { background: rgba(23,32,51,.06); }
.action-item-danger { color: var(--danger); }
.action-item-danger:hover { background: rgba(239,68,68,.08); }
.action-divider { height: 1px; background: var(--line); margin: 4px 6px; }

/* ── Table filter bar ────────────────────────────────────────────── */
.table-filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 18px 14px; border-bottom: 1px solid var(--line);
}
.filter-input, .filter-select {
  flex: 1; min-width: 120px; max-width: 200px;
  padding: 8px 12px; border: 1.5px solid var(--line);
  background: rgba(246,241,232,.5); border-radius: 10px;
  font: inherit; font-size: 13px; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.filter-input:focus, .filter-select:focus {
  border-color: rgba(255,122,89,.65);
  box-shadow: 0 0 0 3px rgba(255,122,89,.1); background: #fff;
}
.filter-input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.filter-clear {
  padding: 8px 14px; border: none; background: transparent;
  border-radius: 10px; cursor: pointer; font: inherit;
  font-size: 12px; font-weight: 700; color: var(--muted);
  transition: background .12s, color .12s;
}
.filter-clear:hover { background: rgba(239,68,68,.1); color: var(--danger); }

/* ── Pagination ──────────────────────────────────────────────────── */
.paginator {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 14px; gap: 12px;
}
.paginator-nav {
  display: flex; align-items: center; gap: 12px; flex: 1; justify-content: center;
}
.page-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); cursor: pointer;
  font-size: 14px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s, color .12s;
}
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-btn:disabled { opacity: 0.35; cursor: default; }
.page-info { font-size: 13px; color: var(--muted); min-width: 52px; text-align: center; }
.page-size-select {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); font: inherit; font-size: 12px; color: var(--muted);
  cursor: pointer; width: auto; flex-shrink: 0;
  transition: border-color .12s;
}
.page-size-select:focus { outline: none; border-color: var(--accent); }

/* ── Plugin note items ───────────────────────────────────────────── */
.note-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.note-item:last-child { border-bottom: none; }
.note-delete {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13px; padding: 2px 6px; border-radius: 6px;
  transition: background .12s, color .12s;
}
.note-delete:hover { background: var(--danger, #e53e3e); color: #fff; }

/* ── Stage / lifecycle colored pills in table cells ──────────────── */
.stage-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .03em; white-space: nowrap;
  background: rgba(23,32,51,.07); color: var(--muted);
}
.stage-pill.won    { background: rgba(34,197,94,.14);  color: #15803d; }
.stage-pill.lost   { background: rgba(239,68,68,.12);  color: #b91c1c; }
.stage-pill.active { background: rgba(37,99,235,.1);   color: #1d4ed8; }
.stage-pill.lead   { background: rgba(245,158,11,.13); color: #92400e; }

/* ── Inline edit — expanded panel row ────────────────────────────── */

/* The original row gets a highlight so you know what you're editing */
.row-editing-parent { background: var(--accent-soft) !important; }
.row-editing-parent td { border-bottom: none !important; }
.row-editing-parent .action-menu { visibility: hidden; pointer-events: none; }
.row-links-parent { background: var(--accent-soft) !important; }
.row-links-parent td { border-bottom: none !important; }

/* The panel row sits directly below the highlighted row */
.row-edit-panel > td {
  padding: 0 18px 18px !important;
  border-bottom: 1px solid var(--line) !important;
}

.edit-panel {
  background: var(--surface-strong);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 20px 22px 18px;
  box-shadow: 0 8px 24px rgba(255, 122, 89, .1);
}

.edit-panel-label {
  font-size: 12px; font-weight: 800;
  color: var(--accent-deep); text-transform: uppercase;
  letter-spacing: .06em; margin: 0 0 14px;
}

.edit-panel-actions {
  display: flex; gap: 10px; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Inputs inside the edit panel — full size, no column constraints */
.edit-panel input, .edit-panel select {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff; border-radius: 10px;
  padding: 10px 12px; font: inherit;
  font-size: 13px; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.edit-panel input:focus, .edit-panel select:focus {
  border-color: rgba(255, 122, 89, .65);
  box-shadow: 0 0 0 3px rgba(255, 122, 89, .1);
}
.edit-panel input.invalid, .edit-panel select.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}

/* ── Responsive ──────────────────────────────────────────────────── */
.panel-hidden { display: none; }

@media (max-width: 1200px) { .grid-2, .association-grid, .workflow { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 720px) {
  .shell { padding: 18px; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: flex-start; }
}
