:root {
  color: #172033;
  background: #f4f7fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: #245ca8;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.loading {
  margin: 0 auto;
  max-width: 960px;
  padding: 64px 24px;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #101828;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, #6ea8fe, #86efac);
  border-radius: 16px;
  color: #101828;
  display: inline-flex;
  font-weight: 800;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.eyebrow {
  color: #5273aa;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #9db7df;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  border-radius: 12px;
  color: #dbe7ff;
  padding: 11px 12px;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  background: rgb(255 255 255 / 12%);
  color: #ffffff;
}

.login-card {
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 18px;
  margin-top: auto;
  padding: 18px;
}

.login-card h2,
.login-card p {
  margin: 0 0 10px;
}

.login-card p:last-child {
  color: #c7d5ea;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 0;
}

.content {
  min-width: 0;
  padding: 32px;
}

.topbar {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 0;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 0;
}

.grid,
.card-grid,
.metrics-grid,
.two-column,
.form-grid,
.filters {
  display: grid;
  gap: 16px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.metric-card,
.list-card,
.lead-card,
.mini-card {
  background: #ffffff;
  border: 1px solid #dce5f2;
  border-radius: 20px;
  box-shadow: 0 18px 60px rgb(16 24 40 / 7%);
}

.card {
  padding: 22px;
}

.metric-card,
.list-card,
.lead-card,
.mini-card {
  padding: 18px;
}

.metric-card span,
.metric-card p,
.detail-list dt,
.lead-topline p {
  color: #64748b;
}

.metric-card strong {
  display: block;
  font-size: 2.2rem;
  letter-spacing: -0.04em;
  margin: 6px 0;
}

.section-heading,
.lead-topline,
.list-card-header,
.form-actions,
.button-row {
  align-items: center;
  display: flex;
  gap: 12px;
}

.section-heading,
.lead-topline,
.list-card-header {
  justify-content: space-between;
}

.section-heading {
  margin-bottom: 18px;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 15px;
}

.primary-button {
  background: #245ca8;
  color: #ffffff;
}

.secondary-button {
  background: #e8eef8;
  color: #17345f;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e5edf7;
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #475569;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge,
.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  white-space: nowrap;
}

.status-pill {
  margin-top: 4px;
}

.badge-approved-production,
.badge-succeeded,
.badge-active,
.status-pill.success {
  background: #dcfce7;
  color: #166534;
}

.badge-pending-review,
.badge-running,
.badge-queued,
.status-pill.warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-manual-only,
.badge-poc-only,
.badge-medium,
.badge-unknown {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-blocked,
.badge-failed,
.badge-rejected,
.badge-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.badge-approved {
  background: #dcfce7;
  color: #166534;
}

.badge-duplicate,
.badge-canceled,
.badge-timed-out {
  background: #ede9fe;
  color: #5b21b6;
}

.form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid label,
.filters label,
.notes-field {
  color: #334155;
  display: grid;
  font-weight: 800;
  gap: 8px;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #cfd9e8;
  border-radius: 12px;
  color: #172033;
  padding: 11px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

small,
.form-message {
  color: #64748b;
  font-weight: 500;
}

.full-span {
  grid-column: 1 / -1;
}

.filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.mention-list,
.lead-list,
.card-grid {
  display: grid;
  gap: 14px;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0 0;
}

.detail-list dt {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 4px 0 0;
}

.quote {
  background: #f8fbff;
  border-left: 4px solid #6ea8fe;
  border-radius: 12px;
  padding: 14px;
}

.routing-note {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  color: #475569;
  font-size: 0.92rem;
  padding: 12px 14px;
}

.score {
  background: #eff6ff;
  border-radius: 14px;
  color: #1d4ed8;
  font-weight: 800;
  padding: 10px 12px;
}

.notes-field {
  margin: 16px 0;
}

.button-row {
  flex-wrap: wrap;
}

.check-list {
  line-height: 1.8;
  padding-left: 20px;
}

.empty-state {
  background: #f8fbff;
  border: 1px dashed #b7c6da;
  border-radius: 16px;
  color: #64748b;
  padding: 18px;
}

@media (max-width: 980px) {
  .app-shell,
  .metrics-grid,
  .two-column,
  .form-grid,
  .filters,
  .card-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .topbar,
  .section-heading,
  .lead-topline,
  .list-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
