.finalcad-body {
  background:
    radial-gradient(circle at top right, rgba(11, 92, 173, 0.06), transparent 24%),
    linear-gradient(180deg, #f6f9fc 0%, #f2f6fb 100%);
}

.finalcad-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
}

.finalcad-page {
  padding: 28px 0 48px;
}

.hero-card,
.panel,
.stat-card {
  background: #ffffff;
  border: 1px solid #e7ecf3;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(18, 40, 76, 0.06);
}

.hero-card,
.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #5f738f;
  font-weight: 700;
}

.hero-card h1,
.panel h2 {
  margin: 0 0 8px;
}

.hero-copy,
.panel__header p {
  margin: 0;
  color: #5c6b80;
}

.hero-actions {
  flex-shrink: 0;
}

.hero-actions--inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-actions--spaced {
  margin-top: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(18, 40, 76, 0.09);
}

.stat-label {
  display: block;
  color: #5c6b80;
  font-size: 13px;
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: 28px;
  line-height: 1;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.filters-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #31445d;
}

.filters-grid select,
.filters-grid input {
  border: 1px solid #d7e0eb;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.filters-grid select:hover,
.filters-grid input:hover {
  border-color: #b7c7da;
}

.filters-grid select:focus,
.filters-grid input:focus {
  outline: none;
  border-color: #0b5cad;
  box-shadow: 0 0 0 4px rgba(11, 92, 173, 0.12);
}

.filter-search {
  grid-column: 1 / -1;
}

.panel__header--split {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px;
}

.dashboard-table th,
.dashboard-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
  font-size: 14px;
}

.dashboard-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.dashboard-table tbody tr {
  transition: background-color .15s ease;
}

.dashboard-table tbody tr:hover {
  background: #f9fbfe;
}

.table-message-cell {
  padding: 22px 14px !important;
}

.table-message {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
}

.table-message--info {
  background: #eef4ff;
  color: #2554a3;
}

.table-message--muted {
  background: #f3f6fa;
  color: #52657c;
}

.table-message--error {
  background: #fff2f2;
  color: #b42318;
}

.table-message__spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: finalcad-spin .75s linear infinite;
  flex: 0 0 auto;
}

@keyframes finalcad-spin {
  to {
    transform: rotate(360deg);
  }
}

.status-pill,
.ok-chip,
.warn-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  background: #eef4ff;
  color: #2554a3;
}

.ok-chip {
  background: #e9f8ef;
  color: #177245;
}

.warn-chip {
  background: #fff3e2;
  color: #a85c00;
}

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease, background-color .15s ease;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  cursor: not-allowed;
  opacity: .65;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: #0b5cad;
  color: white;
  box-shadow: 0 10px 18px rgba(11, 92, 173, 0.18);
}

.btn-primary:hover {
  background: #0a5198;
}

.btn-secondary {
  background: #eef4ff;
  color: #2554a3;
}

.btn-secondary:hover {
  background: #e1ecff;
}

.detail-empty {
  color: #66768d;
  font-style: italic;
}

.detail-state {
  min-height: 72px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.detail-grid-v1 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-box-v1 {
  background: #f8fafc;
  border: 1px solid #e8eef5;
  border-radius: 16px;
  padding: 16px;
}

.detail-box-v1 h3 {
  margin: 0 0 10px;
  color: #16304f;
}

.field-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f7;
}

.field-row:last-child {
  border-bottom: none;
}

.field-label {
  font-weight: 700;
  color: #34475e;
}

.field-value {
  color: #253447;
  white-space: pre-wrap;
  word-break: break-word;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #0b5cad;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(11, 92, 173, 0.18);
}

.brand__text {
  color: #10233d;
  font-weight: 700;
}

.topbar__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
}

.topnav {
  display: flex;
  gap: 14px;
}

.topnav a {
  text-decoration: none;
  color: #44566f;
  font-weight: 600;
}

.topnav a:hover {
  color: #0b5cad;
}

@media (max-width: 1100px) {
  .stats-grid,
  .filters-grid,
  .detail-grid-v1 {
    grid-template-columns: 1fr 1fr;
  }

  .filter-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .hero-card,
  .topbar__inner,
  .panel__header--split {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions,
  .hero-actions--inline {
    width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .stats-grid,
  .filters-grid,
  .detail-grid-v1 {
    grid-template-columns: 1fr;
  }

  .filter-search {
    grid-column: auto;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
