:root {
  --ink: #112437;
  --muted: #526981;
  --paper: #f4f8fc;
  --card: #ffffff;
  --line: #d6e2ee;
  --accent: #0e5a87;
  --good: #148061;
  --warn: #b77807;
  --bad: #9d3344;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(920px 360px at 108% -18%, #d8eef7 0%, transparent 58%),
    radial-gradient(760px 320px at -18% 100%, #ffe7dc 0%, transparent 58%),
    var(--paper);
  line-height: 1.45;
}

.wrap {
  width: min(1480px, calc(100vw - 14px));
  margin: 6px auto 12px;
  display: grid;
  gap: 8px;
}

.hero {
  border-radius: 20px;
  padding: 10px 12px;
  background: linear-gradient(125deg, #0d2f4f, #0672a8);
  color: #fff;
  box-shadow: 0 14px 30px rgba(13, 47, 79, 0.25);
}

.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: clamp(36px, 4.8vw, 50px);
  height: auto;
  flex: 0 0 auto;
}

.title {
  margin: 0;
  font-family: "Outfit", "Manrope", sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 3px 0 0;
  font-size: clamp(12px, 1.35vw, 14px);
  color: rgba(255, 255, 255, 0.92);
}

.hub-tabs {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 0;
  overflow-x: auto;
}

.hub-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 4px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.hub-tab.active {
  border-bottom-color: #fff;
  color: #fff;
}

.hub-tab.plus {
  font-size: 24px;
  line-height: 1;
  min-width: 28px;
  color: #fff;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 700;
  padding: 7px 11px;
  font-size: 12px;
  cursor: pointer;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 10px 24px rgba(17, 36, 55, 0.08);
  padding: 10px;
}

h2 {
  margin: 0;
  font-family: "Outfit", "Manrope", sans-serif;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metrics-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 8px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-label {
  margin: 0;
  color: #4d6781;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  line-height: 1.2;
}

.metric-value {
  margin: 4px 0 0;
  font-family: "Outfit", "Manrope", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #133d5e;
}

.metric-value.good { color: var(--good); }
.metric-value.warn { color: var(--warn); }
.metric-value.bad { color: var(--bad); }

.manager-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.manager-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.manager-name {
  margin: 0;
  font-family: "Outfit", "Manrope", sans-serif;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #133d5e;
}

.manager-meta {
  margin: 0;
  font-size: 12px;
  color: #516981;
  font-weight: 700;
}

.manager-metrics {
  margin: 0;
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: #2a4c67;
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}

.activity-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.activity-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fe 100%);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.activity-panel h3 {
  margin: 0;
  font-family: "Outfit", "Manrope", sans-serif;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: #133d5e;
}

.activity-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.activity-panel-sub {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.activity-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 8px;
  align-items: end;
}

.activity-full {
  grid-column: 1 / -1;
}

.activity-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.text-area {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1px solid #cad8e6;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.text-area:focus {
  outline: none;
  border-color: #8db3d7;
  box-shadow: 0 0 0 3px rgba(14, 90, 135, 0.14);
}

.compact-table {
  margin-top: 0;
}

.compact-table table {
  min-width: 0;
}

.compact-table thead th,
.compact-table tbody td {
  padding: 7px 8px;
  font-size: 12px;
}

.activity-entry-notes {
  white-space: pre-wrap;
  color: #23435d;
}

label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #214158;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input {
  width: 100%;
  border: 1px solid #cad8e6;
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 13px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.input:focus {
  outline: none;
  border-color: #8db3d7;
  box-shadow: 0 0 0 3px rgba(14, 90, 135, 0.14);
}

.btn-light {
  border: 1px solid #c8d7e6;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  background: #f7fbff;
  color: #143954;
  font-family: "Manrope", "Segoe UI", sans-serif;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-light:hover {
  background: #edf4ff;
}

.table-shell {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1160px;
}

thead th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #48627b;
  background: #f2f7fc;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  white-space: nowrap;
}

tbody td {
  padding: 7px 9px;
  border-bottom: 1px solid #edf2f6;
  vertical-align: top;
  font-size: 13px;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f7fbff;
}

.company-link {
  color: #1f3f5a;
  text-decoration: none;
  font-weight: 800;
}

.company-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact {
  color: var(--muted);
  margin-top: 2px;
  font-size: 12px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d4e1ef;
  background: #f2f7fc;
  color: #214159;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.source-pill.contract {
  border-color: #9ec7e7;
  background: #e9f5ff;
  color: #0c4f7d;
}

.money {
  font-weight: 800;
  color: var(--good);
  text-align: right;
  white-space: nowrap;
}

.helper {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.helper.good { color: var(--good); }
.helper.warn { color: var(--warn); }

.inline-control,
.inline-date {
  width: 100%;
  border: 1px solid #cad8e6;
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 12px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.inline-date {
  min-width: 126px;
}

.inline-control:focus,
.inline-date:focus {
  outline: none;
  border-color: #8db3d7;
  box-shadow: 0 0 0 2px rgba(14, 90, 135, 0.12);
}

@media (max-width: 1240px) {
  .metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .manager-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { grid-template-columns: 1fr 1fr; }
  .activity-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .wrap { width: min(1480px, calc(100vw - 10px)); }
  .hero { padding: 10px; }
  .controls { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manager-grid { grid-template-columns: 1fr; }
  .activity-form-grid { grid-template-columns: 1fr; }
}
