.app-main { min-width: 0; }
.workspace { padding: 32px clamp(20px, 4vw, 56px) 64px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  transform: translateY(-150%);
  border-radius: 8px;
  color: #fff;
  background: var(--forest);
}
.skip-link:focus { transform: translateY(0); }

.brand__mark {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
}
.brand__mark i { width: 4px; border-radius: 4px; background: var(--gold); }
.brand__mark i:nth-child(1) { height: 9px; }
.brand__mark i:nth-child(2) { height: 16px; }
.brand__mark i:nth-child(3) { height: 23px; }
.brand > span:last-child strong, .brand > span:last-child small { display: block; }
.brand > span:last-child strong { font-family: Georgia, serif; font-size: 18px; }
.brand > span:last-child small { color: rgba(255,255,255,.6); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.nav a { display: flex; align-items: center; gap: 10px; }
.nav a.is-active { color: #fff; background: rgba(255,255,255,.1); }
.sidebar__actions { display: grid; gap: 8px; margin-top: 28px; }
.sidebar__user {
  position: absolute;
  right: 20px;
  bottom: 22px;
  left: 20px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.14);
}
.sidebar__user strong, .sidebar__user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user strong { font-size: 12px; }
.sidebar__user small { color: rgba(255,255,255,.55); font-size: 10px; }
.sidebar__user > a { color: rgba(255,255,255,.65); text-decoration: none; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--forest); background: var(--gold); font-weight: 850; }

.topbar {
  min-height: 74px;
  margin: 0;
  padding: 15px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.87);
  backdrop-filter: blur(12px);
}
.topbar > div:nth-child(2) strong { display: block; font-family: Georgia, serif; font-size: 17px; }
.topbar__actions { display: flex; gap: 8px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.menu-button { display: none; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}
.button--primary { color: #fff; background: var(--forest); }
.button--primary:hover { background: var(--forest-2); }
.button--quiet { color: var(--forest); border-color: var(--line); background: #fff; }
.button--gold { color: #1e3029; background: var(--gold); }
.button--ghost-light { color: #fff; border-color: rgba(255,255,255,.24); background: transparent; }
.button--small { min-height: 34px; padding: 6px 10px; font-size: 11px; }
.button--large { min-height: 49px; }
.button--full { width: 100%; }

.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-intro h1 { max-width: 720px; margin-bottom: 9px; }
.page-intro p { max-width: 680px; margin-bottom: 0; color: var(--muted); }
.page-intro__actions, .record-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.page-intro--compact h1 { font-size: clamp(27px,3vw,36px); }

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 0 rgba(20,45,35,.02);
}
.panel__header { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.panel__header h2 { margin: 2px 0 0; }
.panel__header > a { color: var(--forest-2); font-size: 12px; font-weight: 800; text-decoration: none; }
.panel-note { margin: 18px 0 0; padding: 12px; border-radius: 10px; color: #665423; background: var(--gold-soft); font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-decoration: none;
}
.metric-card span, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.metric-card strong { display: block; margin: 8px 0 1px; font-family: Georgia,serif; font-size: 34px; font-weight: 500; }
.metric-card small { color: var(--muted); font-size: 11px; }
.metric-card--signal { color: #fff; border-color: var(--forest); background: var(--forest); }
.metric-card--signal span, .metric-card--signal small { color: rgba(255,255,255,.64); }
.metric-card--signal::after { position: absolute; right: -30px; bottom: -40px; width: 100px; height: 100px; border: 18px solid rgba(200,160,77,.24); border-radius: 50%; content: ""; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.75fr); gap: 18px; margin-bottom: 18px; }
.radar-panel { color: #fff; border-color: var(--forest); background: var(--forest); }
.radar-panel .panel__header a { color: var(--gold); }
.radar-empty { text-align: center; }
.radar-empty p { max-width: 520px; margin: 0 auto 18px; color: rgba(255,255,255,.66); }
.radar-empty h3 { margin-bottom: 7px; }
.radar { position: relative; width: 130px; height: 130px; margin: 5px auto 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: conic-gradient(from 40deg, transparent 0 76%, rgba(200,160,77,.42)); }
.radar span { position: absolute; inset: 23%; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; }
.radar span:nth-child(2) { inset: 45%; }
.radar span:nth-child(3) { inset: 66% auto auto 70%; width: 7px; height: 7px; border: 0; background: var(--gold); box-shadow: 0 0 0 5px rgba(200,160,77,.15); }
.radar--small { width: 54px; height: 54px; margin: 0; flex: 0 0 auto; background-color: var(--forest); }
.campaign-stack { display: grid; gap: 10px; }
.campaign-row { padding: 13px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; color: #fff; text-decoration: none; }
.campaign-row__top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.campaign-row small { color: rgba(255,255,255,.58); }
.connection-list { display: grid; }
.connection-list > div { display: grid; grid-template-columns: 12px 1fr; column-gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.connection-list > div:last-child { border-bottom: 0; }
.connection-list strong, .connection-list small { grid-column: 2; }
.connection-list small { color: var(--muted); }
.connection-dot { grid-row: span 2; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: #b3bcb6; }
.connection-dot.is-on { background: #3e9871; box-shadow: 0 0 0 4px #e2f2ea; }

.filters-panel { margin-bottom: 16px; }
.filters input, .filters select,
.form-stack input, .form-stack select, .form-stack textarea,
.field-grid input, .field-grid select, .field-grid textarea,
.note-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd8d1;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.filters input:focus, .filters select:focus,
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus,
.field-grid input:focus, .field-grid select:focus, .field-grid textarea:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(31,91,73,.1);
}
.field-grid textarea, .note-form textarea { min-height: 110px; resize: vertical; }
.search-field { min-width: 220px; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 780px; }
td small { display: block; margin-top: 2px; color: var(--muted); }
.table-primary { color: var(--forest); font-weight: 800; text-decoration: none; }
.table-primary:hover { text-decoration: underline; }
.table-copy { max-width: 280px; color: var(--muted); }
.source-label { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.row-arrow { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--forest); background: var(--gold-soft); text-decoration: none; }
.table-panel { margin-bottom: 18px; }

.score { display: inline-flex; min-width: 42px; justify-content: center; padding: 4px 8px; border-radius: 999px; color: #526058; background: #edf1ee; font-size: 11px; font-weight: 850; }
.score--high { color: #236344; background: #dff2e8; }
.score--medium { color: #735719; background: var(--gold-soft); }
.status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; color: #526058; background: #edf1ee; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.status--new, .status--qualified, .status--completed, .status--client { color: #236344; background: #dff2e8; }
.status--contacted, .status--running { color: #315d82; background: #e4eff9; }
.status--paused, .status--queued, .status--reviewed { color: #735719; background: var(--gold-soft); }
.status--failed, .status--not_fit, .status--cancelled { color: var(--danger); background: var(--danger-soft); }

.empty-state { padding: 38px 18px; color: var(--muted); text-align: center; }
.empty-state h3 { margin: 8px 0 5px; color: var(--ink); }
.empty-state p { margin-bottom: 0; }
.empty-state__icon { display: inline-grid; width: 45px; height: 45px; place-items: center; border-radius: 50%; color: var(--forest); background: var(--gold-soft); font-size: 21px; }
.empty-state--large { min-height: 360px; place-content: center; }
.empty-state--compact { padding: 22px 10px; }
.pagination { justify-content: center; gap: 6px; }
.pagination a { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-decoration: none; }
.pagination a.is-active { color: #fff; border-color: var(--forest); background: var(--forest); }

.form-layout { max-width: 980px; margin: 0 auto; }
.form-card { padding: clamp(20px,4vw,36px); }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.field-grid label, .form-stack label { display: grid; gap: 6px; color: #435148; font-size: 12px; font-weight: 760; }
.field-grid label small { color: var(--muted); font-weight: 400; }
.field-span-2 { grid-column: span 2; }
.step-label { display: inline-grid; width: 26px; height: 26px; margin-right: 8px; place-items: center; border-radius: 50%; color: #fff; background: var(--forest); font: 700 12px/1 Inter,sans-serif; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.check-field { display: flex !important; grid-template-columns: 20px 1fr; align-items: flex-start; gap: 9px !important; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf9; }
.check-field input { width: auto; margin-top: 3px; }
.option-stack { display: grid; gap: 9px; }
.guardrail-note { margin-top: 18px; padding: 13px; border-left: 3px solid var(--gold); color: var(--muted); background: var(--gold-soft); font-size: 12px; }

.record-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.record-identity { display: flex; align-items: center; gap: 15px; }
.record-identity h1 { margin-bottom: 4px; }
.record-identity p { margin: 0; color: var(--muted); }
.record-mark { display: grid; width: 62px; height: 62px; flex: 0 0 auto; place-items: center; border-radius: 17px; color: var(--forest); background: var(--gold-soft); font-family: Georgia,serif; font-size: 22px; }
.record-mark--radar { color: var(--gold); background: var(--forest); }
.record-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(270px,.7fr); gap: 18px; }
.record-main, .record-side { display: grid; align-content: start; gap: 18px; }
.detail-list dl, .detail-list { margin: 0; }
.detail-list > div, .detail-list dl > div { display: grid; grid-template-columns: 125px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child, .detail-list dl > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.analysis-block { padding: 14px; border-radius: 12px; background: #f7f9f7; }
.analysis-block + .analysis-block { margin-top: 10px; }
.analysis-block p { margin-bottom: 0; }
.fine-print { color: var(--muted); font-size: 11px; }
.form-stack { display: grid; gap: 15px; }
.note-form { display: grid; gap: 10px; }
.timeline { display: grid; }
.timeline__item { position: relative; padding: 11px 0 11px 18px; border-left: 1px solid var(--line); }
.timeline__item::before { position: absolute; top: 17px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); content: ""; }
.timeline__item p { margin-bottom: 3px; white-space: pre-wrap; }
.timeline__item small { color: var(--muted); }

.campaign-cards { display: grid; gap: 13px; }
.campaign-card { display: flex; gap: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; color: inherit; background: #fff; text-decoration: none; }
.campaign-card:hover { border-color: #b8c7bc; box-shadow: var(--shadow); }
.campaign-card > div:last-child { min-width: 0; flex: 1; }
.campaign-card__top { display: flex; justify-content: space-between; gap: 10px; }
.campaign-card__top h3 { margin-bottom: 3px; }
.campaign-card__top p { color: var(--muted); }
.campaign-card__meta { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.campaign-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: var(--forest); background: var(--gold-soft); }
.campaign-overview { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.mini-stat { padding: 16px; }
.mini-stat span, .mini-stat small { display: block; color: var(--muted); font-size: 11px; }
.mini-stat strong { display: block; margin: 5px 0; font-family: Georgia,serif; font-size: 27px; }
.campaign-progress-card__number { font-family: Georgia,serif; font-size: 34px; }
.progress--large { height: 12px; }

.alert--warning { color: #715719; background: var(--gold-soft); border: 1px solid #e5d4a9; }
.alert--success { color: #205b43; background: #def1e7; border: 1px solid #b8ddc9; }
.alert--error { color: #7f3030; background: #f9e4e4; border: 1px solid #ebc3c3; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.login-frame { display: grid; width: min(980px,100%); min-height: 600px; grid-template-columns: 1.05fr .95fr; overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.22); }
.login-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 38px; color: #fff; background: var(--forest); }
.login-story h1 { max-width: 480px; margin-bottom: 14px; font-size: clamp(34px,4vw,52px); }
.login-story p { max-width: 460px; color: rgba(255,255,255,.68); }
.brand--login { color: #fff !important; }
.login-panel { display: grid; padding: 34px; place-items: center; }
.login-card { width: min(360px,100%); padding: 0; box-shadow: none; }
.login-card h2 { margin: 4px 0 8px; font-size: 32px; }
.login-card > p { margin-bottom: 24px; color: var(--muted); }
.login-radar { position: absolute; right: -80px; bottom: -90px; width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.login-radar span { position: absolute; inset: 24%; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.login-radar span:nth-child(2) { inset: 43%; }
.login-radar span:nth-child(3) { inset: 62%; }
.login-radar b { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(transparent 0 76%,rgba(200,160,77,.35)); }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid, .record-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .workspace { padding: 22px 16px 45px; }
  .topbar { padding: 12px 16px; }
  .topbar > div:nth-child(2), .topbar__actions .button--quiet { display: none; }
  .menu-button { display: inline-grid; place-items: center; }
  .page-intro, .record-hero { align-items: flex-start; flex-direction: column; }
  .page-intro__actions, .record-actions { width: 100%; }
  .page-intro__actions .button, .record-actions .button { flex: 1; }
  .field-grid, .campaign-overview { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .login-frame { min-height: 0; grid-template-columns: 1fr; }
  .login-story { min-height: 260px; padding: 26px; }
  .login-story h1 { font-size: 34px; }
  .login-panel { padding: 30px 22px; }
}

