:root {
  --ink: #112437;
  --muted: #54697f;
  --paper: #f4f8fc;
  --card: #ffffff;
  --line: #d7e2ed;
  --accent: #0e5a87;
  --radius: 16px;
  --good: #148061;
  --warn: #b77807;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 360px at 110% -20%, #d8eef7 0%, transparent 58%),
    radial-gradient(780px 340px at -20% 100%, #ffe7dc 0%, transparent 58%),
    var(--paper);
  line-height: 1.45;
}

.wrap {
  width: min(1460px, 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;
}

.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;
}

.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;
  font-family: "Manrope", "Segoe UI", sans-serif;
  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 {
  margin-top: 0;
  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;
}

.controls {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}

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;
}

.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: 980px;
}

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;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #d4e1ef;
  background: #f2f7fc;
  color: #214159;
  white-space: nowrap;
}

.money {
  font-weight: 800;
  color: var(--good);
}

.helper {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.helper.good { color: var(--good); }
.helper.warn { color: var(--warn); }

.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;
}

.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); }

.action-cell {
  min-width: 210px;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-btn {
  border: 1px solid #c8d7e6;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  background: #f7fbff;
  color: #143954;
  font-family: "Manrope", "Segoe UI", sans-serif;
  white-space: nowrap;
  line-height: 1;
}

.mini-btn:hover {
  background: #edf4ff;
}

.mini-btn.warn {
  border-color: #e1c196;
  background: #fff7ec;
  color: #905400;
}

.mini-btn.bad {
  border-color: #e6b0b8;
  background: #fff0f2;
  color: #8c2f3c;
}

.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: 128px;
}

.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: 1100px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .wrap { width: min(1460px, calc(100vw - 10px)); }
  .hero { padding: 10px; }
  .brand-lockup { width: 100%; align-items: flex-start; }
  .hub-tabs { gap: 12px; overflow-x: auto; }
  .hub-tab { white-space: nowrap; }
  .controls { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
