:root {
  --cream: #fff8ec;
  --paper: rgba(255, 252, 245, 0.88);
  --ink: #2c1808;
  --muted: #86674f;
  --orange: #ef7d1a;
  --red: #c9472f;
  --yellow: #f7c443;
  --green: #2f9e44;
  --green-soft: #dff6e3;
  --line: rgba(72, 39, 16, 0.12);
  --shadow: 0 24px 60px rgba(90, 41, 9, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(247, 196, 67, 0.45), transparent 34%),
    radial-gradient(circle at top right, rgba(239, 125, 26, 0.22), transparent 26%),
    linear-gradient(145deg, #fff4db 0%, #ffe8c0 48%, #ffd8b0 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 220px;
  height: 220px;
  border-radius: 32px;
  opacity: 0.18;
  transform: rotate(18deg);
}

body::before {
  left: -40px;
  top: 110px;
  background: linear-gradient(135deg, var(--red), var(--yellow));
}

body::after {
  right: -60px;
  bottom: 40px;
  background: linear-gradient(135deg, var(--green), var(--yellow));
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.nav-link {
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.nav-link.active {
  color: white;
  background: linear-gradient(135deg, var(--red), var(--orange));
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr minmax(180px, 240px);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-home {
  grid-template-columns: minmax(320px, 1fr);
  align-items: stretch;
}

.hero-copy,
.hero-badge,
.panel {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 28px;
  border-radius: 32px;
}

.hero-copy-home {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
  align-items: center;
  background:
    radial-gradient(circle at top left, rgba(247, 196, 67, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 243, 0.98), rgba(255, 246, 232, 0.9));
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--red);
}

h1,
h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  line-height: 0.96;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  max-width: 10ch;
}

.hero-copy-home h1 {
  max-width: 15ch;
  font-size: clamp(2.2rem, 4.3vw, 4rem);
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
}

.hero-text {
  margin: 18px 0 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 1rem;
}

.hero-copy-home .hero-text {
  max-width: 44ch;
}

.hero-badge-home {
  margin-top: 24px;
  width: 100%;
  max-width: 280px;
}

.hero-badge {
  border-radius: 28px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 232, 0.86)),
    linear-gradient(135deg, rgba(247, 196, 67, 0.2), rgba(239, 125, 26, 0.2));
}

.hero-badge span,
.hero-badge small {
  color: var(--muted);
}

.hero-badge strong {
  margin: 8px 0 6px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-family: "Bricolage Grotesque", sans-serif;
}

.hero-visual {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  min-height: 360px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  background: #f8ebd3;
}

.hero-visual-inline {
  width: 100%;
  max-width: 1600px;
  aspect-ratio: 4 / 1;
  min-height: 0;
  margin: 0 auto 10px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.96), rgba(255, 242, 220, 0.88));
}

.hero-poster {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 0;
  background: transparent;
}

.hero-metrics h1 {
  max-width: 12ch;
}

.hidden {
  display: none !important;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 360px) 1fr;
  gap: 24px;
  align-items: start;
}

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

.section-heading-inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.form-panel {
  grid-row: span 2;
  position: sticky;
  top: 20px;
}

.donation-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  font-size: 0.94rem;
}

.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.login-error {
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
}

input,
select,
.phone-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
}

input,
select {
  padding: 14px 16px;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(239, 125, 26, 0.28);
  border-color: rgba(239, 125, 26, 0.4);
}

.phone-field {
  display: grid;
  grid-template-columns: 70px 1fr;
  overflow: hidden;
}

.phone-prefix {
  display: grid;
  place-items: center;
  background: rgba(247, 196, 67, 0.18);
  color: var(--red);
  font-weight: 800;
  border-right: 1px solid var(--line);
}

.phone-field input {
  border: 0;
  border-radius: 0;
}

.primary-button {
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  font: inherit;
  font-weight: 800;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 16px 26px rgba(201, 71, 47, 0.25);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 32px rgba(201, 71, 47, 0.32);
}

.secondary-button {
  border: 1px solid rgba(201, 71, 47, 0.16);
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  color: var(--red);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.82);
  transition: transform 180ms ease, background 180ms ease;
}

.secondary-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 247, 242, 0.96);
}

.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 22px;
  max-height: 920px;
  overflow: auto;
  padding-right: 6px;
}

.item-card {
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr) auto;
  gap: 16px;
  align-items: center;
  transition: transform 180ms ease, background 180ms ease;
}

.item-card:hover {
  transform: translateY(-2px);
}

.item-card.completed {
  background: linear-gradient(180deg, rgba(223, 246, 227, 0.95), rgba(235, 255, 238, 0.95));
  border-color: rgba(47, 158, 68, 0.28);
}

.item-card.completed .status-pill {
  background: var(--green);
  color: white;
}

.item-card.completed .item-action {
  background: linear-gradient(135deg, #2f9e44, #59c56d);
  color: white;
}

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

.card-top h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.05rem;
}

.item-unit {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill {
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(247, 196, 67, 0.22);
  color: var(--red);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quantity-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.quantity-row strong {
  color: var(--ink);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(134, 103, 79, 0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  transition: width 220ms ease;
}

.item-card.completed .progress-fill {
  background: linear-gradient(90deg, #31b24e, #7ddc8e);
}

.item-action {
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--red);
  background: rgba(247, 196, 67, 0.24);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.item-card-footer {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.item-card-footer small {
  color: var(--muted);
  text-align: right;
}

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

.table-wrap {
  margin-top: 22px;
  overflow-x: auto;
}

.item-type-form {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.7fr auto;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.item-type-form.hidden {
  display: none;
}

.item-type-form .secondary-button {
  align-self: end;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.admin-note {
  margin-top: 20px;
  display: grid;
  gap: 14px;
  color: var(--muted);
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(201, 71, 47, 0.16);
  color: var(--red);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.admin-login-shell {
  display: grid;
  gap: 24px;
}

.admin-login-panel {
  max-width: 520px;
}

.table-input {
  width: 100%;
  min-width: 110px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  color: var(--ink);
}

.compact-button {
  padding: 10px 12px;
  border-radius: 12px;
}

.materials-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.material-editor-card {
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.material-editor-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.material-editor-top h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.05rem;
}

.material-editor-field {
  font-size: 0.9rem;
}

.search-field {
  margin-top: 18px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.category-tab {
  border: 1px solid rgba(201, 71, 47, 0.14);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

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

.category-tab.active {
  background: linear-gradient(135deg, var(--red), var(--orange));
  color: white;
}

.metrics-layout {
  display: grid;
  gap: 24px;
}

.public-items-grid {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.public-item-card {
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.public-item-card.completed {
  background: linear-gradient(180deg, rgba(223, 246, 227, 0.95), rgba(235, 255, 238, 0.95));
  border-color: rgba(47, 158, 68, 0.28);
}

.public-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.public-item-top h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.15rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.summary-card {
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.summary-card span,
.summary-card small {
  color: var(--muted);
}

.summary-card strong {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-family: "Bricolage Grotesque", sans-serif;
}

.metrics-items-list,
.ranking-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
  color: var(--muted);
  font-weight: 700;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 999px;
}

.donated-dot {
  background: linear-gradient(90deg, var(--orange), var(--yellow));
}

.remaining-dot {
  background: rgba(134, 103, 79, 0.18);
}

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

.chart-row {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.chart-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.chart-row-top h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.15rem;
}

.chart-row-top strong {
  font-size: 0.96rem;
}

.chart-track {
  display: flex;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(134, 103, 79, 0.1);
}

.chart-donated,
.chart-remaining {
  height: 100%;
}

.chart-donated {
  background: linear-gradient(90deg, var(--orange), var(--yellow));
}

.chart-remaining {
  background: rgba(134, 103, 79, 0.18);
}

.chart-row.is-done .chart-donated {
  background: linear-gradient(90deg, #31b24e, #7ddc8e);
}

.chart-row small {
  color: var(--muted);
}

.metric-row,
.ranking-card {
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.metric-row .item-unit,
.ranking-card .item-unit {
  margin-top: 6px;
}

.metric-row-top,
.ranking-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.metric-row h3,
.ranking-card h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.35rem;
}

.metric-numbers,
.ranking-card p,
.ranking-card span {
  color: var(--muted);
}

.metric-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 14px 0 12px;
}

.metric-numbers strong,
.ranking-card strong {
  color: var(--ink);
}

.metric-label {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(247, 196, 67, 0.18);
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-label.is-done {
  color: white;
  background: var(--green);
}

.ranking-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ranking-card {
  display: grid;
  gap: 10px;
}

.ranking-card.is-done {
  background: linear-gradient(180deg, rgba(223, 246, 227, 0.95), rgba(235, 255, 238, 0.95));
  border-color: rgba(47, 158, 68, 0.28);
}

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

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

th {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

td {
  font-size: 0.95rem;
}

.empty-state {
  color: var(--muted);
  padding: 18px 0 6px;
}

@media (max-width: 960px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-home {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 300px;
  }

  .hero-visual-inline {
    aspect-ratio: 16 / 6;
  }

  .form-panel {
    grid-row: auto;
    position: static;
  }

  .item-card {
    grid-template-columns: 1fr;
  }

  .item-card-footer {
    justify-items: start;
  }

  .item-card-footer small {
    text-align: left;
  }
}

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

  .hero-copy,
  .hero-badge,
  .panel {
    border-radius: 22px;
  }

  .hero-copy-home {
    padding: 24px;
  }

  .hero-visual {
    border-radius: 22px;
    min-height: 220px;
  }

  .hero-visual-inline {
    max-width: 100%;
    margin-bottom: 18px;
    aspect-ratio: 16 / 8;
    min-height: auto;
  }

  .panel {
    padding: 18px;
  }

  .phone-field {
    grid-template-columns: 62px 1fr;
  }

  .metric-row-top,
  .ranking-top,
  .quantity-row,
  .chart-row-top,
  .public-item-top {
    flex-direction: column;
  }

  .section-heading-inline,
  .item-type-form {
    grid-template-columns: 1fr;
  }

  .section-heading-inline {
    align-items: stretch;
  }

  .items-grid {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}
