:root {
  --bg: #f5f7f4;
  --ink: #0e1b2a;
  --muted: #5a6877;
  --panel: #ffffff;
  --line: #d8e0e8;
  --accent: #0e7c66;
  --accent-2: #f2a100;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Tahoma", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, #cde8dc 0, transparent 35%),
    radial-gradient(circle at 85% 15%, #ffe5b5 0, transparent 30%),
    var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}

.topbar nav a,
.brand {
  margin-right: 0.8rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.page {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.page-wide {
  max-width: 1780px;
}

.hero {
  background: linear-gradient(140deg, #0e7c66, #1f3b57);
  color: #fff;
  border-radius: 16px;
  padding: 2rem;
}

.cta-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  background: #fff;
  color: #0b3d33;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}

.btn-alt {
  background: var(--accent-2);
  color: #2b1e00;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.two-col-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.readiness-card {
  border-left: 5px solid #1d6f5f;
}

.metric-card h2 {
  margin-top: 0;
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0.25rem 0;
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-pass {
  background: #dff6ef;
  color: #0f5c4d;
  border: 1px solid #9ed8c7;
}

.badge-warn {
  background: #fff4d8;
  color: #7c5700;
  border: 1px solid #efd38a;
}

.badge-fail {
  background: #ffe3e3;
  color: #8a1f1f;
  border: 1px solid #f1afaf;
}

.filter-form {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.filter-form .action-btn {
  min-height: 42px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.compact-table {
  font-size: 0.86rem;
}

.data-scroll {
  overflow-x: auto;
}

.dashboard-page {
  padding-bottom: 2rem;
}

.dashboard-filter-card,
.dashboard-board-card {
  overflow: hidden;
}

.dashboard-foundation-card {
  margin: 1rem 0;
}

.dashboard-scroll {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.dashboard-table {
  min-width: 1320px;
}

.dashboard-table td:nth-child(2),
.dashboard-table th:nth-child(2) {
  min-width: 340px;
}

.dashboard-table td:nth-child(1),
.dashboard-table th:nth-child(1),
.dashboard-table td:nth-child(3),
.dashboard-table th:nth-child(3),
.dashboard-table td:nth-child(4),
.dashboard-table th:nth-child(4),
.dashboard-table td:nth-child(5),
.dashboard-table th:nth-child(5),
.dashboard-table td:nth-child(6),
.dashboard-table th:nth-child(6),
.dashboard-table td:nth-child(7),
.dashboard-table th:nth-child(7),
.dashboard-table td:nth-child(8),
.dashboard-table th:nth-child(8),
.dashboard-table td:nth-child(9),
.dashboard-table th:nth-child(9),
.dashboard-table td:nth-child(10),
.dashboard-table th:nth-child(10),
.dashboard-table td:nth-child(11),
.dashboard-table th:nth-child(11) {
  white-space: nowrap;
}

.planner-page {
  padding-bottom: 2rem;
}

.planner-hero {
  margin-bottom: 1rem;
}

.planner-controls-card,
.planner-results-card {
  margin-top: 1rem;
}

.planner-notes-field {
  grid-column: 1 / -1;
}

.planner-round-grid {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.planner-round-card {
  border-top: 4px solid var(--accent);
}

.planner-round-head,
.planner-candidate-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.planner-round-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.planner-candidate-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.planner-candidate-card {
  background: #fbfcfe;
}

.planner-candidate-top {
  border-left: 4px solid var(--accent-2);
}

.planner-labels {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.planner-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0 0;
}

.planner-kv div {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.planner-kv dt {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--muted);
}

.planner-kv dd {
  margin: 0.2rem 0 0;
  font-weight: 700;
}

.smart-board-page {
  padding-bottom: 2rem;
}

.smart-board-hero {
  margin-bottom: 1rem;
}

.smart-board-round-grid {
  display: grid;
  gap: 1rem;
}

.smart-board-round-card {
  border-top: 4px solid var(--accent);
}

.smart-board-round-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.smart-board-insight-grid {
  margin: 1rem 0;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.smart-board-panel h3 {
  margin-top: 0;
}

.smart-board-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.smart-board-item-good {
  border-left: 4px solid #0e7c66;
}

.smart-board-item-reach {
  border-left: 4px solid #f2a100;
}

.smart-board-item-avoid {
  border-left: 4px solid #b14343;
}

.smart-board-meta {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 0.25rem;
}

.smart-board-table {
  min-width: 720px;
}

code {
  background: #eff5fb;
  padding: 0.1rem 0.25rem;
  border-radius: 6px;
}

.ops-controls {
  display: flex;
  gap: 1rem;
  margin: 0.5rem 0 1rem;
  flex-wrap: wrap;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
}

.ops-actions {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.release-form {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.field {
  display: grid;
  gap: 0.25rem;
}

.field label {
  color: var(--muted);
  font-size: 0.9rem;
}

.field select,
.field input {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.field select:disabled,
.field input:disabled {
  background: #f3f6f8;
}

.ghost-btn {
  justify-self: start;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.action-btn {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #f7fffb, #edf4ff);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

.action-btn:hover {
  border-color: var(--accent);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.status {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

h1, h2 {
  letter-spacing: 0.2px;
}

pre {
  white-space: pre-wrap;
  color: var(--muted);
}

.click-row {
  cursor: pointer;
}

.click-row:hover {
  background: #eef4ff;
}

.active-row {
  background: #dfeafe;
}

.tier-badge {
  display: inline-block;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.tier-badge-overall {
  background: #e5f6ee;
  border-color: #a7dec9;
  color: #1d5f4d;
}

.tier-badge-position {
  background: #edf1ff;
  border-color: #c8d2ff;
  color: #2f3f7e;
}

.usage-risk-badge {
  display: inline-block;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25px;
}

.usage-risk-yes {
  background: #e8f8ea;
  border-color: #b8e1bc;
  color: #1b6a2a;
}

.usage-risk-no {
  background: #fff2e0;
  border-color: #f0d2a7;
  color: #81511b;
}

.draft-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.3rem;
  max-width: 100%;
}

.draft-tag {
  display: inline-block;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.69rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.draft-tag-green {
  background: #e8f8ea;
  border-color: #b8e1bc;
  color: #1b6a2a;
}

.draft-tag-red {
  background: #fff0ea;
  border-color: #f0beb0;
  color: #8a2f1d;
}

.draft-tag-amber {
  background: #fff3db;
  border-color: #efd4a1;
  color: #7a5314;
}

.draft-tag-slate {
  background: #eef1f5;
  border-color: #cfd7e3;
  color: #425268;
}

.draft-tag-emerald {
  background: #e4f8ec;
  border-color: #a9ddbe;
  color: #16643a;
}

.draft-tag-cyan {
  background: #e5f8fb;
  border-color: #a9dce4;
  color: #15566a;
}

.draft-tag-blue {
  background: #e8f0ff;
  border-color: #bfd0f5;
  color: #254b88;
}

.draft-tag-indigo {
  background: #ececfe;
  border-color: #c6c7f2;
  color: #3a3f86;
}

.draft-tag-violet {
  background: #f4eafd;
  border-color: #d9bdf5;
  color: #5c2f8e;
}

.draft-tag-teal {
  background: #e2f7f3;
  border-color: #a8ddd3;
  color: #1d5b54;
}

.draft-tag-orange {
  background: #fff2e4;
  border-color: #f0cba7;
  color: #8b4a1a;
}

.draft-tag-rose {
  background: #ffe8ee;
  border-color: #efbfcc;
  color: #8f2c49;
}

.draft-tag-gold {
  background: #fff8dc;
  border-color: #eedc9f;
  color: #6a5710;
}

.draft-tag-sky {
  background: #e2f4fd;
  border-color: #a9d9f0;
  color: #1a5a7c;
}

.explainability-summary {
  margin: 0.6rem 0 0.8rem;
  padding: 0.65rem 0.7rem;
  background: #f3f8ff;
  border: 1px solid #d7e6fb;
  border-radius: 10px;
  color: #32485f;
}

.tier-separator-row td {
  background: #eff4fa;
  color: #2f4661;
  font-weight: 700;
  border-top: 1px solid #d2dce8;
  border-bottom: 1px solid #d2dce8;
}

.tier-separator-content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.tier-separator-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.tier-separator-meta {
  font-size: 0.8rem;
  color: #56708e;
}

.metric-pill {
  display: inline-block;
  min-width: 4.2rem;
  text-align: center;
  padding: 0.34rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1;
  background: #eef1f5;
  color: #2b3e51;
}

.metric-pill-good {
  background: #b8d8cf;
  color: #173d35;
}

.metric-pill-neutral {
  background: #d5d7da;
  color: #1f2d3b;
}

.metric-pill-danger {
  background: #e8bcbc;
  color: #5f1f1f;
}

.value-badge {
  display: inline-block;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.value-great-value {
  background: #e2f8e9;
  border-color: #a8dfb7;
  color: #19672f;
}

.value-value {
  background: #ebf6e8;
  border-color: #bfdfb5;
  color: #246834;
}

.value-fair {
  background: #eef2f7;
  border-color: #d1dae4;
  color: #3b4f66;
}

.value-rich {
  background: #fff2dd;
  border-color: #f0d0a0;
  color: #7c5116;
}

.value-overpriced {
  background: #ffe7e3;
  border-color: #efbbb0;
  color: #892d26;
}

.value-great-pick {
  background: #dff8e6;
  border-color: #9ed7af;
  color: #1c6c35;
}

.value-good-pick {
  background: #edf4e7;
  border-color: #c5d9bb;
  color: #2f6440;
}

.value-avoid {
  background: #ffe4e0;
  border-color: #efb9b0;
  color: #8a2d25;
}

.tier-block {
  margin-top: 1rem;
  border: 1px solid #d7e0ec;
  border-radius: 12px;
  overflow: hidden;
}

.tier-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.9rem;
  background: linear-gradient(90deg, #edf4ff 0%, #f6f9ff 100%);
  border-bottom: 1px solid #d7e0ec;
}

.tier-block-header h3 {
  margin: 0;
  font-size: 0.96rem;
  color: #20374e;
}

.tier-block-header p {
  margin: 0;
  font-size: 0.78rem;
  color: #425f7a;
  font-weight: 700;
}

@media (max-width: 720px) {
  .data-table {
    display: block;
    overflow-x: auto;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
