:root {
  --unc-blue: #0c4a73;
  --unc-blue-deep: #072f4a;
  --unc-cyan: #00a1c6;
  --unc-gold: #f4b400;
  --ink: #163042;
  --muted: #5b7280;
  --line: #d7e2e8;
  --surface: #f4f8fb;
  --surface-strong: #ffffff;
  --shadow: 0 18px 40px rgba(7, 47, 74, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(12, 74, 115, 0.06), transparent 280px),
    var(--surface);
}

body {
  padding: 24px;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 36px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(7, 47, 74, 0.96), rgba(12, 74, 115, 0.92)),
    var(--unc-blue-deep);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 260px;
  height: 260px;
  border: 22px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.hero h1 {
  margin: 6px 0 10px;
  max-width: 12ch;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.95;
}

.hero__eyebrow,
.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--unc-gold);
}

.hero__lead {
  max-width: 60ch;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero__meta span,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(12, 74, 115, 0.12);
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 0.92rem;
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.panel--sticky {
  position: sticky;
  top: 24px;
  align-self: start;
}

.panel__section + .panel__section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.panel h2,
.group-card h3 {
  margin: 0 0 14px;
  font-size: 1.15rem;
}

.instruction-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.file-field,
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.file-field span,
.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

input[type="file"],
input[type="text"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.actions,
.card-actions,
.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.button--primary {
  background: var(--unc-blue);
  color: #fff;
}

.button--ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.button--success {
  background: #18864b;
  color: #fff;
}

.button--danger {
  background: #c63d3d;
  color: #fff;
}


.panel__note {
  background: linear-gradient(180deg, rgba(0, 161, 198, 0.08), rgba(255, 255, 255, 1));
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.results-header h2 {
  margin: 4px 0 0;
  font-size: 1.45rem;
}

.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-chips .chip {
  background: rgba(12, 74, 115, 0.08);
  color: var(--unc-blue-deep);
}

.warnings {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.warning {
  padding: 12px 14px;
  border: 1px solid rgba(244, 180, 0, 0.4);
  border-radius: 8px;
  background: rgba(244, 180, 0, 0.14);
  color: #664400;
}

.detected {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.detected-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(12, 74, 115, 0.06);
  font-size: 0.9rem;
}

.history-list {
  display: grid;
  gap: 10px;
}

.storage-status {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(12, 74, 115, 0.06);
  color: var(--unc-blue-deep);
  font-size: 0.92rem;
  font-weight: 600;
}

.storage-status.is-warning {
  background: rgba(244, 180, 0, 0.14);
  color: #664400;
}

.history-item,
.empty-history {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(12, 74, 115, 0.04);
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.history-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-item strong,
.history-item p {
  margin: 0;
}

.history-item p {
  color: var(--muted);
  font-size: 0.92rem;
}

.group-public-view {
  margin-bottom: 18px;
}

.group-public-view__hero {
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(7, 47, 74, 0.96), rgba(12, 74, 115, 0.92));
  color: #fff;
}

.group-public-view__hero h2 {
  margin: 8px 0 0;
  font-size: 2rem;
}

.group-public-view__hero p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
}

.group-public-view__meta {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.group-public-view__back {
  display: inline-flex;
  margin-top: 18px;
  color: var(--unc-blue);
  font-weight: 700;
  text-decoration: none;
}


.groups-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.empty-state {
  padding: 36px;
  border: 1px dashed rgba(12, 74, 115, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 10px;
}

.group-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.group-card__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.group-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 58px;
  padding: 0 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--unc-blue), var(--unc-cyan));
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
}

.group-meta {
  display: grid;
  gap: 4px;
}

.group-meta p {
  margin: 0;
  color: var(--muted);
}

.group-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-badges span {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(0, 161, 198, 0.1);
  color: var(--unc-blue-deep);
  font-size: 0.88rem;
  font-weight: 600;
}

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

.members-table th,
.members-table td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.members-table th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.mail-preview {
  padding: 16px;
  border-radius: 8px;
  background: rgba(12, 74, 115, 0.05);
  border: 1px solid rgba(12, 74, 115, 0.12);
}

.mail-preview p {
  margin: 0 0 8px;
  color: var(--muted);
}

.mail-preview code {
  display: block;
  overflow-x: auto;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .panel--sticky {
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    padding: 14px;
  }

  .hero,
  .panel,
  .group-card {
    padding: 18px;
  }

  .group-card__header,
  .results-header {
    flex-direction: column;
  }

  .members-table,
  .members-table tbody,
  .members-table tr,
  .members-table td {
    display: block;
    width: 100%;
  }

  .members-table thead {
    display: none;
  }

  .members-table td {
    padding: 8px 0;
    border: 0;
  }
}
