.admin-shell {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

.admin-shell.narrow {
  max-width: 26rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.admin-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 0.75rem;
}

.admin-event-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(139, 115, 85, 0.12);
}

.admin-event-title h1 {
  font-family: "Frank Ruhl Libre", serif;
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
}

.admin-event-date {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}

.admin-pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.pill-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.95rem;
  min-height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 115, 85, 0.22);
  background: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.88rem;
  color: #5c5048;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pill-tab:hover {
  border-color: rgba(201, 169, 98, 0.45);
  color: #3d342c;
}

.pill-tab.is-active {
  background: linear-gradient(145deg, #d4b978, #c9a962);
  border-color: rgba(154, 123, 60, 0.45);
  color: #fff9f0;
  font-weight: 600;
}

.pill-logout {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.pill-tab-logout {
  cursor: pointer;
  font: inherit;
  background: rgba(255, 255, 255, 0.65);
}

.pill-tab:focus-visible,
.pill-tab-logout:focus-visible {
  outline: 2px solid #6b5344;
  outline-offset: 2px;
}

.illustration-field {
  border: 1px dashed rgba(201, 169, 98, 0.35);
  border-radius: 10px;
  padding: 0.75rem;
}

.illustration-field legend {
  font-size: 0.92rem;
  padding: 0 0.35rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.page-head h1 {
  font-family: "Frank Ruhl Libre", serif;
  margin: 0;
}

.head-actions a {
  margin-inline-start: 0.75rem;
  font-size: 0.92rem;
}

.card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(139, 115, 85, 0.1);
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.stats-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.85rem;
}

.stats-section {
  margin-bottom: 1rem;
}

@media (max-width: 420px) {
  .stats-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-grid-3 .stat-card:last-child:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 50%;
    margin-inline: auto;
    width: 100%;
  }
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 0.85rem 0.5rem;
  text-align: center;
  border: 1px solid rgba(139, 115, 85, 0.14);
}

.stat-card strong {
  display: block;
  font-size: 1.5rem;
  font-family: "Frank Ruhl Libre", serif;
  color: var(--primary, #8b7355);
}

.stat-card span {
  font-size: 0.78rem;
  color: #666;
}

.stat-group-label {
  font-size: 0.72rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0.5rem 0 0.35rem;
  padding-inline-start: 0.15rem;
}

.stat-group:first-child .stat-group-label {
  margin-top: 0;
}

.pickup-bars {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  border: 1px solid rgba(139, 115, 85, 0.12);
}

.pickup-bars h3 {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.pickup-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}

.pickup-bar-track {
  grid-column: 1 / -1;
  height: 6px;
  background: rgba(139, 115, 85, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.pickup-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #8b7355), var(--accent, #c9a962));
  border-radius: 999px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inline-form { display: inline; }

.file-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.file-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.file-upload label.file-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px dashed rgba(139, 115, 85, 0.4);
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 0.88rem;
}

.file-name {
  font-size: 0.82rem;
  color: #666;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn {
  background: none;
  border: none;
  color: #6b5344;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.link-btn.danger { color: #a33; }

.flash {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.flash.ok { background: #d4edda; }
.flash.err { background: #f8d7da; }

.muted { color: #777; font-size: 0.9rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-grid .full { grid-column: 1 / -1; }
.form-grid .checks { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.field span {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.45rem;
  border: 1px solid rgba(139, 115, 85, 0.25);
  border-radius: 8px;
  font: inherit;
}

.check { font-size: 0.9rem; }

.danger-zone { border: 1px solid #f5c6cb; }

.btn-danger { background: #c0392b; color: #fff; }

.login-card {
  text-align: center;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 12px 40px rgba(61, 52, 44, 0.1);
}

.login-card h1 {
  font-family: "Frank Ruhl Libre", serif;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #8b7355, #c9a962);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-card .field input {
  background: rgba(255, 248, 240, 0.95);
  border: 1px solid rgba(201, 169, 98, 0.25);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* compact 3-up stats on phones: no orphan card */
@media (max-width: 420px) {
  .stats-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
  .stats-grid-3 .stat-card:last-child:nth-child(3) { grid-column: auto; max-width: none; margin-inline: 0; }
  .stats-grid-3 .stat-card { padding: 0.6rem 0.25rem; }
  .stats-grid-3 .stat-card .stat-num, .stats-grid-3 .stat-card strong { font-size: 1.35rem; }
}

/* Wide screens: use most of the viewport instead of a narrow centred column */
@media (min-width: 900px) {
  .admin-shell:not(.narrow) {
    max-width: min(100rem, 96vw);
    padding-inline: 1.5rem;
  }
  .stats-section {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 1rem;
  }
  .stat-group .stat-group-label { margin-top: 0; }
  .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  /* DOM order is side-then-table (phone order); on desktop the table takes the wide start column */
  .dash-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 1rem;
    align-items: start;
  }
  .dash-main { grid-column: 1; grid-row: 1; margin-bottom: 0; }
  .dash-side { grid-column: 2; grid-row: 1; position: sticky; top: 1rem; }
  .dash-side .row-actions { flex-direction: column; align-items: stretch; }
  .dash-side .pending-list { max-height: 40vh; overflow-y: auto; }
}
