:root {
  --bg: #f4efe6;
  --surface: #fffaf1;
  --ink: #1f2421;
  --muted: #5f665f;
  --brand: #006d5b;
  --brand-2: #f08700;
  --line: #d9cfbe;
  --radius: 16px;
}

@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/MaterialSymbolsOutlined.woff2") format("woff2");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #fff8ec 0%, transparent 45%),
    radial-gradient(circle at 90% 5%, #ffe2bd 0%, transparent 35%),
    var(--bg);
  font-family: "Roboto", sans-serif;
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-family: "Inter Tight", sans-serif;
  font-weight: 400;
}

.wrap {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.topbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.04em;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.hero {
  padding: 5rem 0 3rem;
}

.kicker {
  letter-spacing: 0.22em;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 0.6rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.8rem);
  line-height: 1.08;
}

.lead {
  max-width: 62ch;
  color: var(--muted);
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.btn {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.68rem 1rem;
  font-weight: 800;
  border: 0;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-ghost {
  color: var(--ink);
  background: #ffffffa9;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.block {
  margin: 1.5rem auto 3rem;
  background: linear-gradient(120deg, #fffaf1, #f8f2e8);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 1.2rem;
}

.footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}

.footer .wrap {
  padding: 1rem 0;
}

.admin {
  padding: 2rem 0 3rem;
}

@media (max-width: 680px) {
  .topbar .wrap {
    flex-direction: column;
    gap: 0.7rem;
  }
}

input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font: inherit;
  background: #fff;
}

label {
  font-weight: 700;
}

button {
  cursor: pointer;
}
select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font: inherit;
  background: #fff;
}
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font: inherit;
  background: #fff;
  width: 100%;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.filters-grid > div {
  min-width: 0;
  overflow: hidden;
}

.filters-grid input,
.filters-grid select {
  width: 100%;
  max-width: 100%;
}

.full-row {
  grid-column: 1 / -1;
}

/* hero preview in admin album settings */
.hero-preview-container {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 160px;
  border: 1px solid #ccc;
  background: #000;
}
.hero-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,0,0,.75);
  cursor: ns-resize;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.data-table th,
.data-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.56rem 0.5rem;
  vertical-align: top;
  font-size: 0.92rem;
}

.data-table th {
  background: #f2e9d8;
  position: sticky;
  top: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.memory-main {
  padding-bottom: 3rem;
}

.recuerdo-page {
  --memory-bg: #0c1117;
  --memory-surface: #141b22;
  --memory-surface-2: #1a232d;
  --memory-line: #2a3542;
  --memory-text: #edf2f7;
  --memory-muted: #9eacbb;
  --memory-accent: #d58d2a;
  --memory-accent-2: #85d6b2;
}

.recuerdo-page body,
body.recuerdo-page {
  color: var(--memory-text);
  background:
    radial-gradient(circle at 10% 10%, #18232f 0%, transparent 30%),
    radial-gradient(circle at 90% 0%, #2b1f12 0%, transparent 24%),
    linear-gradient(180deg, #0a0f14, #0f151c 55%, #0b1015);
}

body.recuerdo-page .btn-ghost {
  background: #1b2530;
  color: var(--memory-text);
  border: 1px solid var(--memory-line);
}

body.recuerdo-page .btn-primary {
  background: linear-gradient(135deg, #c8801f, #9f6418);
  color: #fff;
}

body.recuerdo-page input,
body.recuerdo-page select,
body.recuerdo-page textarea {
  background: #0f161d;
  color: var(--memory-text);
  border: 1px solid var(--memory-line);
}

body.recuerdo-page input::placeholder,
body.recuerdo-page textarea::placeholder {
  color: #7f8c99;
}

.memory-hero {
  padding: 3rem 0 2rem;
}

.memory-hero-inner {
  display: block;
}

.memory-kicker {
  margin: 0 0 .6rem;
  letter-spacing: .22em;
  color: var(--memory-accent-2);
  font-weight: 800;
}

.memory-lead {
  max-width: 58ch;
  color: var(--memory-muted);
}

.memory-empty-card,
.memory-cart-card,
.memory-card {
  background: linear-gradient(180deg, rgba(23, 31, 40, .98), rgba(16, 22, 29, .98));
  border: 1px solid var(--memory-line);
  border-radius: 20px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}

.memory-logo-card {
  min-height: 0;
  width: fit-content;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  margin: 2rem 0;
  padding: 0;
}

.memory-logo-card img {
  max-width: 100%;
  height: auto;
  max-height: 100px;
  object-fit: contain;
  margin-bottom: .9rem;
}

.memory-logo-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--memory-text);
}

.memory-scope {
  margin: .45rem 0 0;
  color: var(--memory-muted);
  font-weight: 600;
}

.memory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 350px));
  gap: 1.25rem;
  justify-content: start;
}

.memory-card {
  overflow: hidden;
  width: 100%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
}

.memory-card.is-selected {
  border-color: var(--memory-accent);
  box-shadow: 0 16px 42px rgba(197, 127, 25, .18);
}

.memory-card-media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #1a232d, #10171e);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.memory-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: .9rem;
  box-sizing: border-box;
  transition: opacity .3s ease-in-out, visibility .3s ease-in-out, transform .3s ease-in-out;
}

.memory-card-media img.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.memory-slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 12, 16, .72);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
}

.memory-slide-nav.is-prev {
  left: .65rem;
}

.memory-slide-nav.is-next {
  right: .65rem;
}

.memory-slide-dots {
  position: absolute;
  left: 50%;
  bottom: .7rem;
  transform: translateX(-50%);
  display: flex;
  gap: .4rem;
  z-index: 2;
}

.memory-slide-dot {
  width: .7rem;
  height: .7rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  cursor: pointer;
}

.memory-slide-dot.is-active {
  background: var(--memory-accent-2);
  border-color: var(--memory-accent-2);
}

.memory-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  flex: 1 1 auto;
}

.memory-card-body h2 {
  margin: 0 0 .45rem;
  font-size: 1.25rem;
  color: var(--memory-text);
}

.memory-card-body p {
  margin: 0;
  color: var(--memory-muted);
  flex: 1 1 auto;
}

.memory-card-body h3 {
  margin: 0;
  color: var(--memory-accent-2);
  font-size: 1.4rem;
}

.memory-card-actions {
  display: grid;
  gap: .8rem;
}

.memory-add-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(213, 169, 93, .35);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(42, 54, 67, .92), rgba(25, 35, 45, .98));
  color: var(--memory-text);
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .3s ease-in-out, background-color .3s ease-in-out, border-color .3s ease-in-out, box-shadow .3s ease-in-out, color .3s ease-in-out;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}

.memory-add-btn:hover {
  border-color: rgba(213, 169, 93, .65);
}

.memory-add-btn.is-selected {
  background: linear-gradient(135deg, rgba(209, 146, 50, .96), rgba(161, 108, 26, .96));
  color: #15110a;
  border-color: rgba(255, 220, 150, .72);
  box-shadow: 0 16px 30px rgba(177, 120, 31, .28);
}

.memory-add-btn.is-bump {
  transform: scale(1.1);
}

.memory-add-badge {
  min-width: 1.2rem;
  padding: .06rem .34rem;
  border-radius: 999px;
  background: rgba(10, 14, 18, .9);
  color: #fff;
  font-size: .76rem;
  line-height: 1.2;
}

.memory-add-btn.is-selected .memory-add-badge {
  background: rgba(255, 248, 231, .95);
  color: #5f3d00;
}

.memory-remove-btn {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--memory-muted);
  cursor: pointer;
  transition: background-color .3s ease-in-out, border-color .3s ease-in-out, color .3s ease-in-out, opacity .3s ease-in-out;
}

.memory-remove-btn:not(:disabled):hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .22);
  color: var(--memory-text);
}

.memory-remove-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.memory-cart-card,
.memory-empty-card {
  padding: 1rem;
  position: static;
}

.memory-cart-head h2 {
  margin: 0;
}

.memory-cart-head p {
  margin: .2rem 0 1rem;
  color: var(--memory-muted);
}

.memory-cart-items {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: .65rem;
}

.memory-cart-row,
.memory-cart-empty {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: center;
  border-bottom: 1px solid var(--memory-line);
  padding-bottom: .55rem;
}

.memory-cart-empty {
  color: var(--memory-muted);
}

.memory-cart-info {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  flex: 1 1 auto;
}

.memory-cart-thumb {
  width: 35px;
  height: 35px;
  object-fit: contain;
  border-radius: 8px;
  background: #0f161d;
  border: 1px solid rgba(255, 255, 255, .08);
  flex: 0 0 35px;
}

.memory-cart-text {
  display: grid;
  gap: .1rem;
  min-width: 0;
}

.memory-cart-name,
.memory-cart-price {
  font-size: .95rem;
}

.memory-cart-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memory-cart-meta {
  font-size: .82rem;
  color: var(--memory-muted);
}

.memory-cart-total {
  border-bottom: 0;
  padding-top: .45rem;
  font-size: 1.08rem;
}

.memory-cart-total strong {
  color: var(--memory-accent-2);
  font-size: 1.14rem;
}

body.recuerdo-page .school-order-panel h2,
body.recuerdo-page .memory-empty-card h2,
body.recuerdo-page .memory-cart-head h2,
body.recuerdo-page .memory-cart-name,
body.recuerdo-page .memory-cart-price,
body.recuerdo-page .memory-cart-total,
body.recuerdo-page label,
body.recuerdo-page .school-lookup-status,
body.recuerdo-page .school-order-form,
body.recuerdo-page .school-order-form p,
body.recuerdo-page .school-order-form span {
  color: var(--memory-text);
}

.receipt-page {
  --memory-bg: #0c1117;
  --memory-surface: #141b22;
  --memory-surface-2: #1a232d;
  --memory-line: #2a3542;
  --memory-text: #edf2f7;
  --memory-muted: #9eacbb;
  --memory-accent: #d58d2a;
  --memory-accent-2: #85d6b2;
}

body.receipt-page {
  color: var(--memory-text);
  background:
    radial-gradient(circle at 10% 10%, #18232f 0%, transparent 30%),
    radial-gradient(circle at 90% 0%, #2b1f12 0%, transparent 24%),
    linear-gradient(180deg, #0a0f14, #0f151c 55%, #0b1015);
}

body.receipt-page .btn-ghost {
  background: #1b2530;
  color: var(--memory-text);
  border: 1px solid var(--memory-line);
}

body.receipt-page .btn-primary {
  background: linear-gradient(135deg, #c8801f, #9f6418);
  color: #fff;
}

body.receipt-page input,
body.receipt-page select,
body.receipt-page textarea {
  background: #0f161d;
  color: var(--memory-text);
  border: 1px solid var(--memory-line);
}

body.receipt-page input::placeholder,
body.receipt-page textarea::placeholder {
  color: #7f8c99;
}

.receipt-main {
  padding: 3rem 0 4rem;
}

.receipt-shell {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
}

.receipt-panel {
  background: linear-gradient(180deg, rgba(23, 31, 40, .98), rgba(16, 22, 29, .98));
  border: 1px solid var(--memory-line);
  border-radius: 20px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
  padding: 1.25rem;
}

.receipt-panel h2,
.receipt-panel h3,
.receipt-panel strong,
.receipt-panel label {
  color: var(--memory-text);
}

.receipt-panel p,
.receipt-panel li,
.receipt-panel dd,
.receipt-panel dt {
  color: var(--memory-muted);
}

.receipt-summary-list {
  margin: 0;
  display: grid;
  gap: .75rem;
}

.receipt-summary-list div {
  padding-top: .75rem;
  border-top: 1px solid var(--memory-line);
}

.receipt-summary-list div:first-child {
  padding-top: 0;
  border-top: 0;
}

.receipt-summary-list dt {
  margin: 0 0 .2rem;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.receipt-summary-list dd {
  margin: 0;
}

.receipt-item-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .75rem;
}

.receipt-item-list li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--memory-line);
}

.receipt-total {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.1rem;
  color: var(--memory-text);
}

.receipt-bank {
  margin: 0;
  display: grid;
  gap: .4rem;
}

.receipt-form {
  display: grid;
  gap: 1rem;
}

.receipt-file-meta {
  margin: -.3rem 0 0;
  font-size: .9rem;
}

@media (max-width: 920px) {
  .memory-hero-inner,
  .memory-layout {
    grid-template-columns: 1fr;
  }

  .memory-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .receipt-shell {
    grid-template-columns: 1fr;
  }
}

.badge.ok {
  color: #0b6b3a;
  background: #daf3e3;
}

.badge.warn {
  color: #8b3d00;
  background: #ffe8cf;
}

.btn.disabled {
  opacity: 0.6;
  pointer-events: none;
}
.btn-sm {
  padding: 0.34rem 0.66rem;
  font-size: 0.82rem;
}

.order-row td {
  background: #fffdf8;
}

.order-detail-row > td {
  background: #f9f3e7;
  padding: 0.8rem;
}

.order-detail-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.detail-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.detail-card p {
  margin: 0.32rem 0;
  font-size: 0.9rem;
}

.mini-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

body.admin-theme {
  /* override colour palette for admin pages */
  --bg: #121212;
  --surface: #1e1e1e;
  --ink: #e0e0e0;
  --muted: #999;
  --brand: #79bfa1; /* slightly lighter brand for contrast */
  --brand-2: #f5a623;
  --line: #333;
  color-scheme: dark;

  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #1a1a1a 0%, transparent 45%),
    radial-gradient(circle at 90% 5%, #111 0%, transparent 35%),
    var(--bg);
}

/* form elements & inputs should use surface background in dark mode */
body.admin-theme input,
body.admin-theme select,
body.admin-theme textarea {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

body.admin-theme .btn-ghost {
  color: var(--ink);
  background: #ffffff1a;
}

body.admin-theme .btn-primary {
  background: var(--brand);
  color: #000;
}

body.admin-theme .card,
body.admin-theme .data-table th,
body.admin-theme .data-table td,
body.admin-theme label {
  color: var(--ink);
}

/* ensure header cells are contrasted in dark mode */
body.admin-theme .data-table th {
  background: var(--surface);
}

/* table rows use explicit light backgrounds in base theme, override for dark admin */
body.admin-theme .order-row td {
  background: #181818;
}

body.admin-theme .order-detail-row > td {
  background: #141414;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: #000000b3;
}

.admin-modal-card {
  position: relative;
  z-index: 1;
  width: min(760px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  line-height: 1;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-trigger-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.file-picker-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.file-picker-btn {
  background: #d7d7d7;
  color: #1f2421;
}

.file-picker-btn:hover,
.file-picker-btn:focus-visible {
  background: #c8c8c8;
}

.hero-thumb-wrap {
  position: relative;
  width: 56px;
  height: 56px;
}

.hero-thumb-image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ddd;
  display: block;
}

.hero-main-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero-main-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.hero-main-check-ui {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid #111;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 0 0 1px #00000033;
  position: relative;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.hero-main-check-ui::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
}

.hero-main-check input:checked + .hero-main-check-ui {
  background: rgba(0, 0, 0, 0.72);
  border-color: #000;
  box-shadow: 0 0 0 2px #ffffffa6;
}

.hero-main-check input:checked + .hero-main-check-ui::after {
  opacity: 1;
}
