:root {
  --bg: #f5efe5;
  --surface: #fffaf1;
  --surface-strong: #ffffff;
  --ink: #16130f;
  --muted: #766d62;
  --line: #ded2c1;
  --brand: #16130f;
  --brand-dark: #000000;
  --accent: #9a6b35;
  --danger: #9f1d1d;
  --success: #426b39;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-y: auto;
}
html[dir="rtl"] body {
  font-family: "IBM Plex Sans Arabic", "Tahoma", "Arial", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.narrow { max-width: 860px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(222, 215, 205, 0.8);
  background: rgba(245, 239, 229, 0.94);
  backdrop-filter: blur(18px);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand-mark { overflow: hidden; width: 44px; height: 44px; border-radius: 8px; background: #050505; flex: 0 0 auto; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text small { color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 18px; color: var(--muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--ink); }
.language-switcher select {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  font-size: 0.9rem;
}
.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button.warm { background: var(--accent); color: #fffaf1; }
.button.light { background: #fffaf1; color: var(--ink); }
.button.ghost { border-color: rgba(255, 250, 241, 0.55); background: rgba(255, 250, 241, 0.1); color: #fffaf1; }
.button.danger { background: var(--danger); color: #fffaf1; }
.button.full { width: 100%; }
.hero { position: relative; overflow: hidden; padding: 0; background: #0b0907; }
.hero-track {
  display: flex;
  direction: ltr;
  width: 100%;
  transform: translateX(0);
  transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.hero-slide {
  position: relative;
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  min-height: calc(100vh - 72px);
  overflow: hidden;
  background: #0b0907;
}
html[dir="rtl"] .hero-slide {
  direction: rtl;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(9, 8, 6, 0.88) 0%, rgba(9, 8, 6, 0.64) 48%, rgba(9, 8, 6, 0.24) 100%),
    linear-gradient(0deg, rgba(9, 8, 6, 0.62) 0%, rgba(9, 8, 6, 0.08) 58%);
}
html[dir="rtl"] .hero-overlay {
  background:
    linear-gradient(270deg, rgba(9, 8, 6, 0.88) 0%, rgba(9, 8, 6, 0.64) 48%, rgba(9, 8, 6, 0.24) 100%),
    linear-gradient(0deg, rgba(9, 8, 6, 0.62) 0%, rgba(9, 8, 6, 0.08) 58%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 86px clamp(54px, 7vw, 104px);
}
.hero-copy { max-width: 760px; color: #fffaf1; }
.hero-copy .eyebrow, .hero-copy .lead, .hero-copy p, .hero-copy .money-row { color: rgba(255, 250, 241, 0.86); }
.hero-copy h1 { color: #fffaf1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-progress-wrap { max-width: 560px; margin-top: 18px; }
.hero-progress { background: rgba(255, 250, 241, 0.25); }
.hero-progress span { background: #fffaf1; }
.hero-money { color: rgba(255, 250, 241, 0.82); }
.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 250, 241, 0.42);
  border-radius: 999px;
  background: rgba(9, 8, 6, 0.52);
  color: #fffaf1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.hero-arrow:hover {
  border-color: rgba(255, 250, 241, 0.72);
  background: rgba(255, 250, 241, 0.16);
}
.hero-arrow:active {
  transform: translateY(-50%) scale(0.96);
}
.hero-arrow svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-arrow-left { left: clamp(18px, 2.4vw, 38px); }
.hero-arrow-right { right: clamp(18px, 2.4vw, 38px); }
html[dir="rtl"] .hero-arrow-left { right: clamp(18px, 2.4vw, 38px); left: auto; }
html[dir="rtl"] .hero-arrow-right { left: clamp(18px, 2.4vw, 38px); right: auto; }
html[dir="rtl"] .hero-arrow-left svg,
html[dir="rtl"] .hero-arrow-right svg {
  transform: scaleX(-1);
}
.slider-controls { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.floating-controls {
  position: absolute;
  left: 50%;
  bottom: 42px;
  z-index: 4;
  width: max-content;
  margin: 0;
  transform: translateX(-50%);
}
.slider-dot { width: 34px; height: 6px; border: 0; border-radius: 999px; background: rgba(255, 250, 241, 0.38); cursor: pointer; }
.slider-dot.active { background: #fffaf1; }
.eyebrow { margin: 0 0 12px; color: var(--brand); font-size: 0.82rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
h1, h2, h3 { margin: 0; letter-spacing: 0; line-height: 1.08; }
h1 { max-width: 780px; font-size: clamp(2.4rem, 5.4vw, 5.3rem); }
h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
h3 { font-size: 1.15rem; }
p { color: var(--muted); line-height: 1.7; }
.rich-text {
  white-space: pre-line;
}
.lead { max-width: 700px; font-size: 1.1rem; }
.section { padding: 56px 0; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.content-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.help-arrives-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 42px;
  align-items: center;
}
.help-arrives-copy .button {
  margin-top: 10px;
}
.help-arrives-image {
  overflow: hidden;
  border: 1px solid rgba(154, 107, 53, 0.18);
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  background: #e6ded4;
  box-shadow: 0 18px 42px rgba(22, 19, 15, 0.1);
}
.help-arrives-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.card-media { aspect-ratio: 16 / 10; background: #e6ded4; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 0 10px; background: #efe2cf; color: var(--brand-dark); font-size: 0.78rem; font-weight: 800; }
.pill.urgent { background: #f4d3cf; color: var(--danger); }
.pill.completed { background: #dfe9d5; color: var(--success); }
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: #e5d8c6; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.money-row { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0 18px; color: var(--muted); font-size: 0.92rem; }
.stack-actions { display: grid; gap: 10px; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0 auto;
}
.stat {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px solid rgba(154, 107, 53, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf1 0%, #f7ead8 100%);
  padding: 26px 18px;
  text-align: center;
  box-shadow: 0 16px 34px rgba(22, 19, 15, 0.06);
}
.stat strong {
  display: block;
  color: var(--brand-dark);
  font-size: clamp(2.5rem, 4vw, 4.25rem);
  line-height: 0.95;
}
.stat span {
  display: block;
  max-width: 220px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 190px 190px; gap: 12px; margin-bottom: 24px; }
.field, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--ink); font: inherit; padding: 0 12px; }
textarea { min-height: 132px; padding: 12px; }
.page-title { padding: 56px 0 28px; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.detail-image { overflow: hidden; border-radius: 8px; margin: 24px 0; }
.detail-image img { width: 100%; max-height: 480px; object-fit: cover; }
.side-panel { position: sticky; top: 96px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 20px; }
.despensa-hero {
  background:
    linear-gradient(120deg, rgba(255, 250, 241, 0.96), rgba(245, 239, 229, 0.84)),
    url("https://images.unsplash.com/photo-1593113598332-cd288d649433?auto=format&fit=crop&w=1400&q=80") center/cover;
}
.despensa-hero .lead {
  max-width: 760px;
}
.despensa-panel {
  background: rgba(255, 250, 241, 0.92);
  box-shadow: 0 18px 42px rgba(22, 19, 15, 0.08);
}
.despensa-story {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.despensa-story .rich-text {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.85;
}
.feature-card {
  min-height: 230px;
}
.feature-card h3 {
  font-size: 1.45rem;
}
.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.admin-sidebar { border-right: 1px solid var(--line); background: var(--surface); padding: 22px; }
.admin-sidebar a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--muted);
  font-weight: 700;
}
.admin-sidebar a:hover { background: #efe2cf; color: var(--brand-dark); }
.admin-badge {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fffaf1;
  font-size: 0.78rem;
  font-weight: 900;
}
.admin-logout { margin-top: 18px; }
.admin-logout button {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.admin-logout button:hover { background: #efe2cf; color: var(--brand-dark); }
.admin-main { padding: 28px; }
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 14px; text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.table-actions { margin-top: 0; }
.table-actions form { margin: 0; }
.apapachar-form { display: grid; gap: 22px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); line-height: 1.55; }
.checkbox-row input { margin-top: 5px; }
.form-status { border-radius: 8px; padding: 12px 14px; font-weight: 700; }
.form-status.success { background: #dfe9d5; color: var(--success); }
.form-status.error { background: #f4d3cf; color: var(--danger); }
.option-group {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 16px;
}
.option-group legend {
  padding: 0 8px;
}
.option-group .checkbox-row {
  margin: 0;
}
.option-group input {
  accent-color: var(--accent);
}
.application-list {
  display: grid;
  gap: 18px;
}
.application-card h2 {
  font-size: 1.45rem;
}
.application-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.application-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.72);
  padding: 14px;
}
.application-field.wide {
  grid-column: 1 / -1;
}
.application-field .eyebrow {
  margin-bottom: 6px;
}
.application-field ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.site-footer {
  border-top: 1px solid var(--line);
  background: #17130f;
  color: rgba(255, 250, 241, 0.72);
  padding: 54px 0 24px;
}
.site-footer p {
  color: rgba(255, 250, 241, 0.72);
}
.site-footer h3 {
  color: #fffaf1;
  font-size: 1rem;
  margin-bottom: 16px;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(160px, 0.7fr));
  gap: 34px;
}
.footer-brand {
  color: #fffaf1;
  margin-bottom: 16px;
}
.footer-brand .brand-text small {
  color: rgba(255, 250, 241, 0.62);
}
.footer-about p {
  max-width: 420px;
}
.footer-links,
.footer-contact {
  display: grid;
  gap: 11px;
  font-style: normal;
}
.footer-links a,
.footer-contact a,
.footer-contact span {
  color: rgba(255, 250, 241, 0.72);
  line-height: 1.45;
}
.footer-links a:hover,
.footer-contact a:hover,
.footer-social a:hover {
  color: #fffaf1;
}
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 250, 241, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(255, 250, 241, 0.82);
  font-weight: 700;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 250, 241, 0.14);
  margin-top: 38px;
  padding-top: 20px;
  color: rgba(255, 250, 241, 0.58);
  font-size: 0.92rem;
}
.mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; }
.empty-state { margin-top: 18px; font-weight: 700; }
.auth-section { min-height: calc(100vh - 72px); display: grid; align-items: center; }
.auth-wrap { display: flex; justify-content: center; }
.auth-card { width: min(560px, 100%); display: grid; gap: 18px; }
.family-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  isolation: isolate;
}
.family-shell,
.family-shell * {
  pointer-events: auto;
}
.family-shell::before,
.family-shell::after {
  display: none;
  content: none;
}
.family-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.account-strip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin-top: 16px;
  padding: 10px 12px;
  color: var(--muted);
}
.account-strip strong {
  color: var(--ink);
}
.help-text {
  margin: -8px 0 0;
  font-size: 0.92rem;
}
.file-field {
  padding-top: 10px;
}
.request-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.request-form {
  display: grid;
  gap: 18px;
}
.request-review-grid,
.containerless-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.request-review-grid-simple {
  grid-template-columns: 0.7fr 1.3fr;
}
.request-message {
  white-space: pre-wrap;
}
.attachment-preview {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  background: #e6ded4;
  aspect-ratio: 16 / 10;
}
.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.request-done-form {
  max-width: 760px;
}
.containerless-actions {
  margin: 0;
}

@media (max-width: 900px) {
  .detail, .admin-shell, .help-arrives-grid, .footer-grid, .despensa-story { grid-template-columns: 1fr; }
  .admin-page-header { flex-direction: column; }
  .hero-slide { min-height: calc(100vh - 106px); }
  .hero-content { padding: 86px 52px 64px; }
  .hero-copy { max-width: 100%; }
  .stats, .grid, .request-list, .request-review-grid, .containerless-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .application-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters, .form-grid { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .help-arrives-image { max-height: 380px; }
  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    overflow-x: auto;
    align-items: center;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
  }
  .admin-sidebar .eyebrow {
    flex: 0 0 auto;
    margin: 0 8px 0 0;
    white-space: nowrap;
  }
  .admin-sidebar a {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }
  .admin-logout {
    flex: 0 0 auto;
    margin-top: 0;
  }
  .admin-logout button {
    min-width: 92px;
  }
  .admin-main {
    padding: 22px 16px;
  }
  .table {
    min-width: 760px;
  }
}

@media (max-width: 620px) {
  .nav { align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .nav-links { justify-content: flex-start; }
  .stats, .grid, .request-list, .request-review-grid, .containerless-actions { grid-template-columns: 1fr; }
  .application-grid { grid-template-columns: 1fr; }
  .family-topbar { flex-direction: column; }
  .hero-slide { min-height: 720px; }
  .hero-overlay { background: linear-gradient(0deg, rgba(9, 8, 6, 0.86) 0%, rgba(9, 8, 6, 0.7) 55%, rgba(9, 8, 6, 0.42) 100%); }
  .hero-content { padding: 82px 18px 92px; }
  .hero-copy { max-width: 100%; }
  .hero-arrow { top: auto; bottom: 20px; transform: none; }
  .hero-arrow:active { transform: scale(0.96); }
  .hero-arrow-left { left: 16px; }
  .hero-arrow-right { right: 16px; }
  html[dir="rtl"] .hero-arrow-left { right: 16px; left: auto; }
  html[dir="rtl"] .hero-arrow-right { left: 16px; right: auto; }
  html[dir="rtl"] .hero-overlay { background: linear-gradient(0deg, rgba(9, 8, 6, 0.86) 0%, rgba(9, 8, 6, 0.7) 55%, rgba(9, 8, 6, 0.42) 100%); }
  .section-header { align-items: flex-start; flex-direction: column; }
  .admin-main h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }
  .admin-page-header .button,
  .form-actions .button,
  .table-actions .button,
  .table-actions form,
  .table-actions button {
    width: 100%;
  }
  .table-actions {
    min-width: 130px;
  }
  .admin-sidebar {
    padding: 10px;
  }
  .admin-sidebar a {
    padding: 10px 12px;
  }
  .admin-badge {
    min-width: 22px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-track {
    transition: none;
  }
}
