:root {
  --ink: #172033;
  --muted: #667085;
  --paper: #f3f6fb;
  --surface: #ffffff;
  --line: #dce3ed;
  --brand: #176b87;
  --brand-dark: #0f536b;
  --accent: #7c3aed;
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --radius: 18px;
}

body {
  background:
    radial-gradient(circle at 8% 5%, rgba(23, 107, 135, .09), transparent 24rem),
    radial-gradient(circle at 92% 16%, rgba(124, 58, 237, .07), transparent 22rem),
    var(--paper);
}

.topbar {
  height: 70px;
  background: linear-gradient(110deg, #0d2f3d, #123f51 58%, #183455);
  box-shadow: 0 8px 28px rgba(15, 47, 61, .14);
}

.brand { font-size: 21px; letter-spacing: -.02em; }
.container { padding-top: 36px; }
.panel, .section-block, .profile-card, .metric-card {
  box-shadow: 0 12px 36px rgba(23, 32, 51, .06);
}

.workspace-hero, .page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 32px;
  margin-bottom: 22px;
  border: 1px solid rgba(23, 107, 135, .16);
  border-radius: 24px;
  background: linear-gradient(120deg, rgba(255,255,255,.96), rgba(239,248,251,.96));
}

.workspace-hero h1 { font-size: clamp(30px, 4vw, 44px); max-width: 720px; letter-spacing: -.035em; }
.workspace-hero .muted { max-width: 700px; margin-bottom: 0; }
.primary-cta { padding: 13px 20px; white-space: nowrap; box-shadow: 0 10px 22px rgba(23,107,135,.2); }
.primary-cta span { margin-left: 10px; font-size: 18px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 30px; }
.metric-card { display: flex; align-items: center; gap: 14px; padding: 18px; background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: 16px; }
.metric-card strong { display: block; font-size: 25px; line-height: 1; }
.metric-card div > span { color: var(--muted); font-size: 13px; }
.metric-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #e3f4f8; color: var(--brand); font-weight: 800; }
.metric-icon.accent { background: #f0eafe; color: var(--accent); }
.metric-icon.success { background: #e8f7ed; color: #067647; }

.section-block { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 22px; padding: 26px; margin: 22px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 2px; font-size: 24px; }
.text-action { color: var(--brand); font-weight: 700; text-decoration: none; white-space: nowrap; }
.text-action:hover { text-decoration: underline; }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); gap: 18px; }
.profile-card { border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 20px; transition: transform .18s ease, box-shadow .18s ease; }
.profile-card:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(23,32,51,.1); }
.profile-card-top, .card-actions, .detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.document-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(135deg, #e2f5f8, #edf0ff); color: var(--brand); font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.profile-state { padding: 5px 9px; border-radius: 99px; background: #fff1d6; color: #8a4b08; font-size: 12px; font-weight: 700; }
.profile-state.ready { background: #dcfae6; color: #067647; }
.profile-card h3 { margin: 17px 0 4px; font-size: 20px; }
.profile-meta { margin: 0 0 15px; color: var(--muted); font-size: 13px; }
.marker-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.marker-list span { padding: 3px 7px; border-radius: 7px; background: #f1f5f9; color: #475467; font: 700 12px/1.4 ui-monospace, Consolas, monospace; }
.marker-list.large span { font-size: 14px; padding: 6px 9px; }
.card-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid #edf0f4; }
.button.secondary, button.secondary { background: #e8f3f6; color: var(--brand-dark); }
.button.secondary:hover, button.secondary:hover { background: #d7ebf0; }
.icon-danger { background: none; color: var(--danger); padding: 7px; font-size: 13px; }
.icon-danger:hover { background: var(--danger-bg); }

.table-shell { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.jobs-table th { background: #f8fafc; }
.jobs-table td { background: #fff; }
.jobs-table tbody tr:hover td { background: #fbfdff; }
.jobs-table td strong, .jobs-table td small { display: block; }
.jobs-table td small { color: var(--muted); margin-top: 2px; }
.jobs-table tr:last-child td { border-bottom: 0; }
.empty-state { padding: 34px; text-align: center; border: 1px dashed #cbd5e1; border-radius: 16px; background: #fafcff; }
.empty-state strong { font-size: 18px; }
.empty-state p { color: var(--muted); }

.profile-settings { display: grid; grid-template-columns: 1fr minmax(300px, .85fr); gap: 36px; align-items: start; }
.compact-panel { padding-top: 18px; padding-bottom: 18px; }
.label-hint { color: var(--muted); font-weight: 400; }
.step-number { display: inline-block; color: var(--brand); background: #e7f4f7; padding: 4px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.replace-schema { min-width: 290px; display: grid; gap: 8px; }
.success-notice { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.detail-actions { justify-content: flex-start; margin-top: 18px; }
.detail-actions form { margin: 0; }
.danger-solid { background: var(--danger); }
.danger-solid:hover { background: #912018; }

.validation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 22px; }
.metric-icon.warning { background: #fff1d6; color: #8a4b08; }
.validation-summary { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.validation-summary dt, .validation-summary dd { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.validation-summary dt { background: #f8fafc; font-weight: 700; }
.validation-summary dt:last-of-type, .validation-summary dd:last-of-type { border-bottom: 0; }
.issue-list { padding-left: 22px; color: var(--danger); }
.warning-list { color: #8a4b08; }
.preview-panel, .confirm-panel { display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.preview-panel h2, .confirm-panel h2 { margin-top: 8px; }
.preview-form { min-width: min(100%, 440px); }
.preview-form label { display: block; margin-bottom: 10px; }
.preview-form select { width: 100%; }
button:disabled { cursor: not-allowed; opacity: .5; }

@media (max-width: 850px) {
  .workspace-hero, .page-heading { align-items: flex-start; flex-direction: column; padding: 22px; }
  .metric-grid { grid-template-columns: 1fr; }
  .validation-grid { grid-template-columns: 1fr; }
  .profile-settings { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; }
  .replace-schema { min-width: 0; width: 100%; }
  .preview-panel, .confirm-panel { align-items: stretch; flex-direction: column; }
  .preview-form { min-width: 0; width: 100%; }
}
