:root {
  --paper-bg: #f8f3e9;
  --paper-edge: #eadfcb;
  --ink: #40322a;
  --ink-soft: #7a6a5d;
  --accent-red: #c0392b;
  --accent-green: #1e8449;
  --accent-gold: #b88730;
  --chip-bg: #f0e3cf;
  --chip-border: #d1bfa1;
  --chip-active-bg: #c0392b;
  --chip-active-text: #fff;
  --border-subtle: #e0d3be;
  --shadow-soft: 0 16px 35px rgba(0, 0, 0, 0.12);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, #fdf7ec, #f7f0e3),
    repeating-linear-gradient(
      -45deg,
      rgba(0, 0, 0, 0.012) 0,
      rgba(0, 0, 0, 0.012) 1px,
      transparent 1px,
      transparent 4px
    );
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  text-align: right;
}

.page {
  min-height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 22px 22px 18px;
  background:
    linear-gradient(to bottom, #fffaf0, #f5ebdd),
    url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 159h160' stroke='%23eadfcb' stroke-width='1'/%3E%3C/svg%3E");
  box-shadow: var(--shadow-soft);
  border: 1px solid #e5d8c4;
}

.hero-overlay {
  display: none;
}

.hero-content {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-start;
}

.flag-bar {
  position: absolute;
  inset-inline: 0;
  top: -10px;
  display: flex;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
}

.flag-strip {
  flex: 1;
}

.flag-green {
  background: #008c45;
}

.flag-white {
  background: #f4f5f0;
}

.flag-red {
  background: #cd212a;
}

.hero-heading h1 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: clamp(36px, 4.6vw, 48px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--ink-soft);
}

.hero-tagline::before,
.hero-tagline::after {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(270deg, transparent, rgba(64, 50, 42, 0.55));
}

.hero-subtitle {
  max-width: 420px;
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.hero-meta {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.meta-card {
  min-width: 160px;
  padding: 10px 12px 9px;
  border-radius: 14px;
  border: 1px solid #ddcdb4;
  background: #fbf4e7;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.meta-card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 4px;
  color: var(--ink-soft);
}

.meta-card p {
  margin: 0;
  font-size: 13px;
}

.meta-note {
  margin-top: 3px !important;
  font-size: 11px !important;
  color: var(--accent-green);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1.2fr);
  gap: 18px;
  align-items: flex-start;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid #d7c7ae;
  padding-bottom: 6px;
}

.section-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 24px;
  margin: 0 0 4px;
  letter-spacing: 0.08em;
}

.section-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border-radius: var(--radius-pill);
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--ink-soft);
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    transform 0.08s ease;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #c2b39a;
}

.chip-active {
  background: var(--chip-active-bg);
  border-color: #922b21;
  color: var(--chip-active-text);
  transform: translateY(-1px);
}

.chip-active::before {
  background: #fff;
}

.chip:hover {
  border-color: #bba88a;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f3f0ea 0, #f8f4ee 140px, #f0ece5 100%),
    radial-gradient(circle at top left, rgba(0, 0, 0, 0.04), transparent 60%);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  text-align: right;
}

.menu-section {
  background: var(--paper-bg);
  border-radius: var(--radius-lg);
  padding: 18px 20px 20px;
  border: 1px solid var(--paper-edge);
  box-shadow: var(--shadow-soft);
}

.menu-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px 40px;
}

.menu-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  border-bottom: 1px solid #e0d3be;
  padding-bottom: 10px;
}

.menu-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d8c5aa;
  background: #fffaf0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.menu-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.menu-item-name {
  font-weight: 600;
  font-size: 14px;
}

.menu-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.menu-badges {
  display: inline-flex;
  gap: 6px;
}

.badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.12em;
  border: 1px solid #d8c5aa;
  background: #f6ecdd;
}

.badge-featured {
  background: #c0392b;
  border-color: #922b21;
  color: #fff;
}

.badge-unavailable {
  background: #f2e6d4;
  border-style: dashed;
  color: #a48f78;
}

.menu-item-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.menu-item-price {
  font-weight: 600;
  color: var(--accent-gold);
}

.menu-item-category {
  font-size: 11px;
  color: var(--ink-soft);
}

.menu-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.menu-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.image-preview {
  margin-top: 6px;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: 1px solid #d8c5aa;
  background: #fffdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hidden {
  display: none !important;
}

.icon-btn {
  border-radius: 999px;
  border: 1px solid #d2c2aa;
  background: #f6ecdd;
  color: var(--ink-soft);
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    transform 0.08s ease;
}

.icon-btn span {
  font-size: 12px;
}

.icon-btn:hover {
  border-color: #b69973;
  background: #f2e3cf;
  transform: translateY(-0.5px);
}

.icon-btn-danger {
  border-color: #c0392b;
  color: #922b21;
}

.icon-btn-danger:hover {
  background: #f8d7d1;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-link {
  border: none;
  background: transparent;
  color: var(--accent-green);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed rgba(30, 132, 73, 0.6);
}

.admin-link:hover {
  background: rgba(30, 132, 73, 0.06);
}

.admin-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.admin-modal-visible {
  display: flex;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.admin-modal-content {
  position: relative;
  max-width: 360px;
  width: 100%;
  background: var(--paper-bg);
  border-radius: 16px;
  border: 1px solid var(--paper-edge);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  padding: 16px 16px 14px;
  z-index: 41;
}

/* إخفاء عناصر الإدارة في وضع العميل */
body:not(.is-admin) .admin-only {
  display: none !important;
}

body:not(.is-admin) .menu-item-actions {
  display: none !important;
}


.glass {
  background: var(--paper-bg);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  border: 1px solid var(--paper-edge);
  box-shadow: var(--shadow-soft);
}

.panel-title {
  font-size: 15px;
  margin: 0 0 4px;
  font-weight: 600;
}

.panel-text {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.qr-section {
  text-align: right;
}

.qr-box {
  width: 150px;
  height: 150px;
  margin: 6px 0 4px;
  padding: 8px;
  border-radius: 14px;
  border: 1px dashed #cfbfa7;
  background: #fffaf0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-url {
  font-size: 11px;
  color: var(--ink-soft);
  word-break: break-all;
  margin: 0 0 8px;
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 6px 13px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    transform 0.08s ease,
    box-shadow 0.1s ease;
}

.btn-primary {
  background: var(--accent-green);
  border-color: #145a32;
  color: #fff;
  box-shadow: 0 8px 18px rgba(20, 90, 50, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(20, 90, 50, 0.4);
}

.btn-secondary {
  background: #f6ecdd;
  border-color: #d3c1a6;
  color: var(--ink-soft);
}

.btn-secondary:hover {
  border-color: #bfa98a;
}

.btn-ghost {
  background: transparent;
  border-color: #d3c1a6;
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: #f6ecdd;
}

.admin-section {
  margin-top: 2px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.admin-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #c6b398;
  background: #f6ecdd;
  color: var(--ink-soft);
}

.menu-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.upload-progress {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.upload-progress-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #efe4d1;
  border: 1px solid #d9c7ac;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-green);
  transition: width 0.18s ease;
}

.upload-progress-label {
  font-size: 11px;
  color: var(--ink-soft);
}

.form-error {
  font-size: 11px;
  color: #8b1e1e;
  background: #f8d7d1;
  border: 1px solid #e8b7ad;
  border-radius: 10px;
  padding: 6px 9px;
}

.upload-progress-indeterminate .upload-progress-fill {
  width: 40%;
  animation: upload-progress 1s ease-in-out infinite;
}

@keyframes upload-progress {
  0% {
    transform: translateX(-20%);
  }
  50% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(-20%);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.field-label {
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  background: #fffdf8;
  border-radius: 9px;
  border: 1px solid #d8c6ac;
  padding: 7px 9px;
  font-size: 12px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 1px rgba(30, 132, 73, 0.35);
}

.field textarea {
  resize: vertical;
  min-height: 50px;
  max-height: 120px;
}

.field-row {
  display: flex;
  gap: 8px;
}

.field-row .field {
  flex: 1;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-soft);
}

.checkbox input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent-green);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 0;
  font-size: 11px;
  color: var(--ink-soft);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand {
  font-family: "Playfair Display", "Times New Roman", serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent-red);
}

.footer-text {
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-content {
    flex-direction: column;
    gap: 16px;
  }

  .hero-meta {
    width: 100%;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 16px 10px 20px;
  }

  .hero {
    padding: 16px 14px 14px;
    border-radius: 18px;
  }

  .meta-card {
    min-width: 0;
    width: 100%;
  }

  .hero-meta {
    flex-direction: column;
  }

  .menu-section,
  .glass {
    padding: 14px 12px 12px;
    border-radius: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filters {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
