:root {
  --bg: #f3efe6;
  --bg-accent: #e6dcc8;
  --panel: rgba(255, 250, 241, 0.92);
  --text: #14281d;
  --muted: #5f6f65;
  --line: rgba(20, 40, 29, 0.12);
  --brand: #0f766e;
  --brand-strong: #134e4a;
  --danger: #b91c1c;
  --shadow: 0 20px 60px rgba(20, 40, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 35%),
    radial-gradient(circle at right, rgba(180, 83, 9, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, #f8f6ef 100%);
  min-height: 100vh;
}

.page {
  width: min(1440px, calc(100% - 24px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero,
.panel,
.stat-card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-strong);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

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

h1 {
  font-size: clamp(1.9rem, 3.5vw, 3.35rem);
  line-height: 1.02;
  max-width: none;
  margin-bottom: 16px;
  text-wrap: balance;
}

.lead,
.panel-header p {
  color: var(--muted);
  max-width: 70ch;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 12px;
  min-width: 220px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, #1d4ed8 100%);
  color: white;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 48px;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(29, 78, 216, 0.22);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 20px;
  border-radius: 999px;
  color: var(--brand-strong);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid rgba(20, 40, 29, 0.12);
  background: rgba(255, 255, 255, 0.72);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(20, 40, 29, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(19, 78, 74, 0.1);
  color: var(--brand-strong);
  font-weight: 600;
}

.status-pill.error {
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger);
}

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

.stat-card {
  border-radius: 24px;
  padding: 20px;
}

.stat-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.stat-card strong {
  font-size: 2rem;
  line-height: 1;
}

.panel {
  border-radius: 28px;
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-header h2 {
  margin-bottom: 6px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1380px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th:last-child,
td:last-child {
  min-width: 420px;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: rgba(20, 40, 29, 0.03);
  position: sticky;
  top: 0;
  z-index: 1;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 12px;
}

.empty {
  color: var(--muted);
  padding: 24px 0 4px;
}

@media (max-width: 1100px) {
  .page {
    width: min(100% - 20px, 1440px);
  }

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

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
  }

  .hero-actions {
    align-items: flex-start;
    min-width: 0;
    width: 100%;
  }

  .hero-actions button,
  .hero-actions .status-pill,
  .hero-actions .secondary-button,
  .hero-actions .action-row {
    width: 100%;
  }

  .hero-actions button,
  .hero-actions .secondary-button,
  .hero-actions .status-pill {
    justify-content: center;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 780px) {
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 14px;
  }

  tr {
    background: rgba(255, 250, 241, 0.92);
    border: 1px solid rgba(20, 40, 29, 0.08);
    border-radius: 22px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
  }

  td {
    display: grid;
    grid-template-columns: minmax(110px, 36%) 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    word-break: break-word;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    font-weight: 700;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1200px);
    padding-top: 20px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .hero,
  .panel {
    border-radius: 22px;
    padding: 18px;
  }

  h1 {
    font-size: clamp(1.85rem, 8vw, 2.5rem);
  }

  .lead {
    font-size: 14px;
  }

  .stat-card {
    padding: 18px;
  }

  .stat-card strong {
    font-size: 1.7rem;
  }

  td {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  td::before {
    font-size: 10px;
  }
}
