:root {
  --bg: #090806;
  --panel: #14110c;
  --panel-soft: #1f1a12;
  --gold: #d8b35f;
  --gold-bright: #f4d98b;
  --text: #fff7e6;
  --muted: #b9aa8a;
  --line: rgba(216, 179, 95, .22);
  --danger: #d75c5c;
  --success: #43c07a;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Cairo", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(216, 179, 95, .16), transparent 30rem),
    linear-gradient(135deg, #090806 0%, #15110a 55%, #060504 100%);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  background: rgba(9, 8, 6, .82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-bright);
  font-family: "Amiri", serif;
  font-size: 1.55rem;
  background: linear-gradient(145deg, rgba(216, 179, 95, .22), rgba(255,255,255,.04));
}
.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; color: var(--muted); font-size: .78rem; }
.top-nav, .side-nav { display: flex; align-items: center; gap: .8rem; }
.top-nav a, .side-nav a, .side-nav button, .primary-link, .ghost-button, .submit-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .75rem 1rem;
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.primary-link, .submit-button {
  border-color: transparent;
  color: #171006;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 12px 32px rgba(216, 179, 95, .18);
}

.hero-section {
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 2rem;
  padding: clamp(2rem, 6vw, 6rem) clamp(1rem, 4vw, 4rem);
}

.portal-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.portal-shell {
  width: min(1180px, 100%);
  padding: clamp(1rem, 4vw, 4rem);
}
.portal-hero {
  max-width: 760px;
  margin-bottom: 2rem;
}
.portal-brand {
  margin-bottom: 2rem;
}
.portal-hero h1 {
  font-family: "Amiri", serif;
  font-size: clamp(3rem, 8vw, 7rem);
}
.portal-hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.9;
}
.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.portal-card {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1.2rem, 3vw, 2rem);
  background:
    linear-gradient(145deg, rgba(216, 179, 95, .14), rgba(255,255,255,.035)),
    var(--panel);
  box-shadow: var(--shadow);
  transition: transform .25s ease, border-color .25s ease;
}
.portal-card:hover {
  transform: translateY(-6px);
  border-color: rgba(244, 217, 139, .65);
}
.portal-card span {
  color: var(--gold-bright);
  font-weight: 900;
}
.portal-card h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}
.portal-card p {
  color: var(--muted);
  line-height: 1.9;
}
.portal-card strong {
  color: #171006;
  width: fit-content;
  border-radius: 999px;
  padding: .8rem 1.1rem;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
}
.eyebrow {
  margin: 0 0 .6rem;
  color: var(--gold-bright);
  font-weight: 800;
  letter-spacing: 0;
}
h1, h2 { margin: 0; line-height: 1.25; }
.hero-copy h1 {
  max-width: 780px;
  font-family: "Amiri", serif;
  font-size: clamp(2.4rem, 7vw, 5.7rem);
}
.hero-copy p:not(.eyebrow) {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 1rem 0 1.6rem;
}
.hero-media { display: grid; place-items: center; }
.arch-card {
  width: min(100%, 420px);
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 48% 48% 8px 8px;
  background:
    linear-gradient(rgba(9,8,6,.18), rgba(9,8,6,.94)),
    url("https://images.unsplash.com/photo-1564769625905-50e93615e769?auto=format&fit=crop&w=900&q=80") center/cover;
  box-shadow: var(--shadow);
}
.arch-card span {
  color: var(--gold-bright);
  font-family: "Amiri", serif;
  font-size: clamp(2.5rem, 8vw, 5rem);
}
.arch-card strong { font-size: 1.5rem; }
.arch-card small { color: var(--muted); }

.section-heading { padding: 1rem clamp(1rem, 4vw, 4rem); }
.section-heading h2 { font-size: clamp(1.9rem, 4vw, 3.2rem); }
.reels-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  padding: 1rem clamp(1rem, 4vw, 4rem) 6rem;
}
.product-reel {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050403;
  box-shadow: var(--shadow);
  animation: rise .6s ease both;
}
.product-reel img, .product-reel video, .product-gallery {
  width: 100%;
  height: 100%;
  min-height: 620px;
  display: block;
}
.product-reel img, .product-reel video { object-fit: cover; }
.product-gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.product-gallery img {
  flex: 0 0 100%;
  scroll-snap-align: center;
}
.product-reel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 35%, rgba(0,0,0,.85));
  pointer-events: none;
}
.product-info {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.2rem;
}
.product-info h3 { margin: 0 0 .4rem; font-size: 1.35rem; }
.price { color: var(--gold-bright); font-weight: 900; }
.tier-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .55rem;
}
.tier-list span {
  border: 1px solid rgba(244, 217, 139, .35);
  border-radius: 999px;
  padding: .35rem .65rem;
  color: var(--gold-bright);
  background: rgba(216, 179, 95, .12);
  font-size: .88rem;
  font-weight: 800;
}
.product-info p { color: #eadfca; line-height: 1.8; }
.order-button { width: 100%; margin-top: .8rem; }

.floating-whatsapp {
  position: fixed;
  z-index: 15;
  left: 1rem;
  bottom: 1rem;
  border: 0;
  border-radius: 999px;
  padding: .95rem 1.2rem;
  color: white;
  background: #1ebc59;
  box-shadow: 0 16px 40px rgba(30, 188, 89, .35);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0,0,0,.72);
  overflow: hidden;
}
.modal.is-open { display: grid; }
.modal-panel, .login-card, .admin-card {
  width: min(100%, 760px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(20,17,12,.96);
  box-shadow: var(--shadow);
}
.modal-panel {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--gold) rgba(255,255,255,.08);
}
.modal-panel .submit-button {
  position: sticky;
  bottom: 0;
  z-index: 3;
}
.close-modal { float: left; }
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255,255,255,.06);
  font-size: 1.4rem;
}
.form-grid, .product-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
label { color: var(--muted); font-weight: 700; }
input, textarea, select {
  width: 100%;
  margin-top: .45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem 1rem;
  color: var(--text);
  background: rgba(255,255,255,.055);
  outline: none;
}
textarea { resize: vertical; }
label:has(textarea), .wide, .submit-button, .ghost-button, .form-message { grid-column: 1 / -1; }
.form-message { margin: 0; color: var(--gold-bright); }
.order-total {
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .9rem 1rem;
  color: var(--gold-bright);
  background: rgba(216, 179, 95, .08);
  font-weight: 900;
}
.loading-state, .empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.admin-shell { min-height: 100vh; }
.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.2rem;
  border-left: 1px solid var(--line);
  background: rgba(9, 8, 6, .85);
}
.side-nav {
  align-items: stretch;
  flex-direction: column;
  margin-top: 2rem;
}
.side-nav button { text-align: right; }
.side-nav a.is-active {
  border-color: rgba(244, 217, 139, .65);
  color: var(--gold-bright);
  background: rgba(216, 179, 95, .12);
}
.dashboard-content { padding: clamp(1rem, 3vw, 2rem); }
.dashboard-page { display: none; }
.dashboard-page.is-active { display: block; }
.dashboard-header, .card-heading, .filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.stats-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.2rem;
  background: rgba(255,255,255,.045);
}
.stats-grid span { display: block; color: var(--gold-bright); font-size: 1.55rem; font-weight: 900; }
.stats-grid small { color: var(--muted); }
.admin-card { width: 100%; margin-bottom: 1rem; }
.admin-list {
  display: grid;
  gap: .8rem;
  margin-top: 1rem;
}
.admin-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .8rem;
  background: rgba(255,255,255,.035);
}
.admin-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.item-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.item-actions button, .status-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .7rem;
  color: var(--text);
  background: rgba(255,255,255,.055);
}
.delete-button { color: #ffd2d2 !important; border-color: rgba(215,92,92,.5) !important; }
.filters input { margin: 0; }
.orders-table-wrap { overflow-x: auto; }
.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}
.orders-table th, .orders-table td {
  padding: .85rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: right;
}
.orders-table th { color: var(--gold-bright); }

.reveal { animation: rise .7s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .hero-section, .dashboard { grid-template-columns: 1fr; }
  .hero-section { min-height: auto; }
  .admin-sidebar {
    position: static;
    height: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-header, .dashboard-header, .card-heading, .filters {
    align-items: stretch;
    flex-direction: column;
  }
  .top-nav { width: 100%; justify-content: space-between; }
  .form-grid, .product-form, .stats-grid { grid-template-columns: 1fr; }
  .product-reel, .product-reel img, .product-reel video { min-height: 78vh; }
  .admin-item { grid-template-columns: 56px 1fr; }
  .admin-item img { width: 56px; height: 56px; }
  .item-actions { grid-column: 1 / -1; }
  .modal {
    align-items: stretch;
    padding: .6rem;
  }
  .modal-panel {
    max-height: calc(100vh - 1.2rem);
    width: 100%;
  }
}

[hidden] {
  display: none !important;
}
