@import url('template.css');

/* ========== Base / Reset ========== */
html,
body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto !important;
  touch-action: auto !important;
}

body {
  margin: 0;
  padding: 0;
  position: relative;
}

body.modal-open {
  overflow: hidden !important;
}

.page {
  display: block;
  padding-bottom: 1rem;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: block !important;
  overflow: visible !important;
  padding-bottom: 6rem;
}

main {
  display: block !important;
  min-height: auto !important;
  height: auto !important;
  overflow: visible !important;
  padding-top: 7.6rem !important;
  padding-bottom: 6rem;
  -webkit-overflow-scrolling: touch;
}

/* ========== Header ========== */
header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 1600;
  background: var(--bg-soft);
  padding: 0.65rem 0.75rem 0.2rem !important;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 52px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-left > div:last-child {
  min-width: 0;
}

.brand-left .logo-circle {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.brand-logo-image {
  object-fit: cover;
  display: block;
}

.brand-text-title,
.brand-text-sub {
  line-height: 1.15;
}

.brand-text-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-text-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.header-btn {
  flex: 0 0 auto;
  align-self: center;
}

/* ========== Tabs ========== */
.tab-row-wrap {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 1499;
  background: var(--bg-soft);
  padding: 3px 0.75rem;
  margin: 0;
  border-top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-row,
.tab-row-wrap .tab-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 0;
  padding: 0.08rem 0 0.18rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

#checkoutPage .tab-row-wrap {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 1499;
  background: var(--bg-soft);
  padding: 2px 0.75rem 4px;
  margin: 0;
  border-top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========== Menu / Sections ========== */
.menu-category-section {
  scroll-margin-top: 7.8rem;
  margin-bottom: 1.2rem;
}

.section-head {
  margin-bottom: 0.65rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-items {
  display: grid;
  gap: 0.72rem;
}

.menu-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.78rem 0.82rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.menu-item-body {
  margin-bottom: 0.62rem;
}

.menu-item.has-image .menu-item-body {
  display: grid !important;
  grid-template-columns: 56px minmax(0, 1fr) !important;
  grid-template-areas:
    "image head"
    "desc desc" !important;
  column-gap: 0.65rem !important;
  row-gap: 0.5rem !important;
  align-items: start !important;
}

.menu-item:not(.has-image) .menu-item-body {
  display: block !important;
}

.menu-media {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #151515;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.menu-item.has-image .menu-media {
  grid-area: image !important;
}

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

.menu-content {
  margin: 5px 0 0;
  flex: 1 1 auto;
  min-width: 0;
}

.menu-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.menu-item.has-image .menu-head {
  grid-area: head !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 0.65rem !important;
  min-width: 0 !important;
  margin-bottom: 0 !important;
}

.menu-text {
  min-width: 0;
  flex: 1 1 auto;
}

.menu-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.menu-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item.has-image .menu-desc {
  grid-area: desc !important;
  display: block !important;
  width: 100% !important;
  margin-top: 0 !important;
  padding-top: 0.1rem;
  line-height: 1.4;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
  overflow: visible !important;
}

.price {
  font-weight: 800;
  color: var(--yellow);
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 212, 0, 0.12);
  border: 1px solid rgba(255, 212, 0, 0.25);
  font-size: 0.68rem;
  color: var(--yellow);
  margin-top: 0.4rem;
}

.menu-item .btn {
  padding: 0.3rem 0.85rem;
}

/* ========== Footer Nav ========== */
.footer-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 0.6rem 0.75rem;
  z-index: 1500;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
}

.nav-link.active,
.nav-link:hover {
  color: var(--yellow);
}

.cart-pill {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.25rem;
  font-size: 0.68rem;
}

/* ========== Modal ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 2500;
}

.modal-backdrop.active {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 430px;
  max-height: 88vh;
  overflow: auto;
  background: var(--bg-soft);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  padding: 1rem 1rem 1.2rem;
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.choice-group {
  margin: 0.9rem 0;
}

.choice-title {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: capitalize;
  letter-spacing: 0.12em;
  margin-bottom: 0.45rem;
}

.choice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.75rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 0.45rem;
  background: var(--card);
}

.choice-row input {
  margin-right: 0.55rem;
}

.choice-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.85rem 0;
}

.qty-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: var(--yellow);
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

/* ========== Forms ========== */
textarea,
input[type="text"],
input[type="number"],
input[type="password"],
select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #181818;
  color: #fff;
}

.validation-note {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
}

.field-label {
  display: block;
}

.static-row {
  justify-content: flex-start;
}

/* ========== Checkout ========== */
.checkout-card {
  margin-bottom: 0.8rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.mini {
  font-size: 0.72rem;
  color: var(--muted);
}

.first-screen-card {
  margin-top: 5rem;
}

.start-buttons,
.checkout-actions,
.payment-method-list {
  display: grid;
  gap: 0.7rem;
}

#savedLocationText {
  background: #181818;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
}

#paymentMethodsCard {
  display: grid;
  gap: 0.55rem;
}

#paymentMethodsCard .field-label {
  margin-top: 0.1rem;
}

#paymentMethodsCard .grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

#paymentMethodsCard .choice-row {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

#paymentMethodsCard .choice-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

#checkoutPage .summary-row strong .price-stack {
  align-items: flex-end;
}

#resetOrderBtn {
  display: none;
}

/* ========== Admin ========== */
.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  background: #111;
  color: #fff;
}

.admin-sidebar {
  background: #11151d;
  border-right: 1px solid #283445;
  padding: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
}

.admin-sidebar a {
  display: block;
  color: #ddd;
  text-decoration: none;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  margin-bottom: 0.35rem;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
  background: #262626;
  color: #fff;
}

.admin-main {
  padding: 1.2rem;
}

.panel {
  background: #1a1a1a;
  border: 1px solid #2f2f2f;
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
}

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

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

.data-table th,
.data-table td {
  padding: 0.72rem;
  border-bottom: 1px solid #2a2a2a;
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}

.data-table th {
  color: #bbb;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-table th:last-child,
.data-table td:last-child {
  white-space: nowrap;
  width: 1%;
}

.table-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.table-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.table-actions form {
  display: inline-flex;
  margin: 0;
}

.table-actions form .btn {
  white-space: nowrap;
}

/* ========== Grids ========== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

/* Categories/admin two-column layout */
.admin-main .grid-2 {
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.75fr);
  align-items: start;
}

/* ========== Alerts ========== */
.flash {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  margin-bottom: 1rem;
}

.flash.success {
  background: #16381a;
  color: #c0f6c8;
}

.flash.error {
  background: #401818;
  color: #ffd4d4;
}

/* ========== Buttons ========== */
.btn,
.header-btn,
.nav-link,
.tab,
.icon-btn {
  -webkit-tap-highlight-color: transparent;
}

.btn-red,
.btn-yellow,
.header-btn,
.btn.btn-ghost,
.btn.btn-outline-yellow,
.menu-item .btn,
.modal-sheet .btn,
.admin-main .btn {
  background: transparent !important;
  color: var(--yellow) !important;
  border: 1px solid rgba(255, 212, 0, 0.8) !important;
  box-shadow: none !important;
}

.btn-red:hover,
.btn-yellow:hover,
.header-btn:hover,
.btn.btn-ghost:hover,
.btn.btn-outline-yellow:hover,
.menu-item .btn:hover,
.modal-sheet .btn:hover,
.admin-main .btn:hover {
  background: rgba(255, 212, 0, 0.08) !important;
}

.btn-sm {
  padding: 0.38rem 0.62rem;
  font-size: 0.75rem;
}

/* ========== Prices ========== */
.price-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.05;
}

.price-usd {
  font-weight: 800;
  color: var(--yellow);
}

.price-lbp,
.price-lbp-inline {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin: 1rem 0 2rem;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.7rem;
  border: 1px solid rgba(255, 212, 0, 0.8);
  border-radius: 12px;
  color: var(--yellow);
  text-decoration: none;
}

.pagination a.active,
.pagination a:hover {
  background: rgba(255, 212, 0, 0.08);
}

/* ========== Language / Arabic ========== */
.lang-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem;
}

.lang-en {
  font-size: inherit;
  color: #ffd400;
  line-height: 1.2;
}

.lang-sep {
  font-size: 0.72em;
  color: var(--muted);
}

.lang-ar,
.ar-text {
  font-size: var(--ar-size, 1em);
  line-height: 1.35;
  direction: rtl;
  unicode-bidi: plaintext;
  font-family: Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", Arial, sans-serif;
}

.menu-title .lang-ar {
  --ar-size: 1em;
  color: #d8d8d8;
}

.section-title .lang-ar {
  --ar-size: 0.9em;
  color: #f1f1f1;
}

.choice-title .lang-ar {
  --ar-size: 0.95em;
  color: #d8d8d8;
}

.choice-row .lang-ar {
  --ar-size: 0.92em;
  color: #d8d8d8;
}

.modal-sheet .lang-ar {
  --ar-size: 0.92em;
}

.admin-mini-ar {
  direction: rtl;
  unicode-bidi: plaintext;
  font-family: Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", Arial, sans-serif;
  color: var(--muted);
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    height: auto;
    position: static;
  }

  .grid-2,
  .grid-3,
  .admin-main .grid-2 {
    grid-template-columns: 1fr;
  }

  .table-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 767px) {
  .app {
    border-radius: 0;
    max-width: 430px;
  }

  main {
    padding-top: 7.35rem !important;
  }

  .tab-row-wrap {
    top: 60px;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .tab {
    min-width: auto;
    padding: 0.45rem 1rem;
  }

  .menu-category-section {
    scroll-margin-top: 7.55rem;
  }

  .menu-item {
    padding: 0.7rem 0.72rem;
  }

  .menu-item-body {
    margin-bottom: 0.58rem;
  }

  .menu-item.has-image .menu-item-body {
    grid-template-columns: 50px minmax(0, 1fr) !important;
    column-gap: 0.58rem !important;
    row-gap: 0.45rem !important;
  }

  .menu-media {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 10px;
  }

  .menu-title {
    font-size: 0.96rem;
  }

  .menu-desc {
    font-size: 0.90rem;
    line-height: 1.35;
  }

  .site-footer {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    padding: 0.8rem 0 1.2rem;
    opacity: 0.8;
  }

  .site-footer a {
    color: var(--yellow);
    text-decoration: none;
  }

  .site-footer a:hover {
    text-decoration: underline;
  }

  .tab {
    flex: 0 0 auto !important;
  }

  #installAppBtn {
    display: block;
    margin: 30px auto 0;
    padding: 10px 50px;
  }
}

.sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  margin-left: 6px;
}


/* =========================================================
   SpeedNet-style light admin overrides
========================================================= */
body.admin-theme {
  background: #f6f7fb;
  color: #0f172a;
}
body.admin-theme .admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: #f6f7fb;
  color: #0f172a;
}
body.admin-theme .admin-sidebar {
  background: #ffffff;
  border-right: 1px solid #e6e8ef;
  padding: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
body.admin-theme .admin-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.admin-theme .admin-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #eef2ff;
  color: #1d4ed8;
  border: 1px solid #dbe3ff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
body.admin-theme .admin-brand-title {
  font-weight: 800;
  letter-spacing: .2px;
  color: #0f172a;
}
body.admin-theme .admin-brand-sub,
body.admin-theme .admin-user-label,
body.admin-theme .admin-crumb,
body.admin-theme .mini,
body.admin-theme .field-label {
  color: #64748b;
}
body.admin-theme .admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.admin-theme .admin-sidebar a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #0f172a;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 0;
  border: 1px solid transparent;
}
body.admin-theme .admin-sidebar a.active,
body.admin-theme .admin-sidebar a:hover {
  background: #eef2ff;
  border-color: #dbe3ff;
  color: #1d4ed8;
}
body.admin-theme .admin-sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}
body.admin-theme .admin-user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
}
body.admin-theme .admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #eef2ff;
  color: #1d4ed8;
  display: grid;
  place-items: center;
  font-weight: 800;
}
body.admin-theme .admin-logout-link {
  justify-content: center;
  background: #ffffff;
}
body.admin-theme .sidebar-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.admin-theme .admin-main {
  padding: 18px 20px 26px;
  background: #f6f7fb;
}
body.admin-theme .admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
body.admin-theme .admin-topbar-left,
body.admin-theme .admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.admin-theme .admin-topbar h2,
body.admin-theme h1 {
  margin: 0;
  color: #0f172a;
  letter-spacing: 0;
  text-transform: none;
}
body.admin-theme h1 {
  margin-bottom: 1rem;
  font-size: 1.7rem;
}
body.admin-theme .admin-search-shell input {
  width: 220px;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid #e6e8ef;
  border-radius: 12px;
  padding: 10px 12px;
}
body.admin-theme .admin-welcome-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e6e8ef;
  border-radius: 12px;
  color: #64748b;
}
body.admin-theme .admin-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
}
body.admin-theme .admin-menu-toggle {
  display: none;
  border: 1px solid #e6e8ef;
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
body.admin-theme .panel {
  background: #ffffff;
  border: 1px solid #e6e8ef;
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 24px rgba(15,23,42,.04);
}
body.admin-theme .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
body.admin-theme .data-table th,
body.admin-theme .data-table td {
  padding: 0.82rem;
  border-bottom: 1px solid #eef2f7;
  color: #0f172a;
}
body.admin-theme .data-table th {
  color: #64748b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
body.admin-theme .data-table tbody tr:hover {
  background: #fbfdff;
}
body.admin-theme .flash {
  padding: .85rem .95rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
body.admin-theme .flash.success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
body.admin-theme .flash.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
body.admin-theme input,
body.admin-theme select,
body.admin-theme textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid #dbe1ea;
  color: #0f172a;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
body.admin-theme input:focus,
body.admin-theme select:focus,
body.admin-theme textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
body.admin-theme .btn,
body.admin-theme .header-btn,
body.admin-theme .btn-red,
body.admin-theme .btn-yellow,
body.admin-theme .btn.btn-ghost,
body.admin-theme .btn.btn-outline-yellow,
body.admin-theme .menu-item .btn,
body.admin-theme .modal-sheet .btn,
body.admin-theme .admin-main .btn,
body.admin-theme .btn-like {
  background: #2563eb !important;
  color: #fff !important;
  border: 1px solid #2563eb !important;
  box-shadow: none !important;
  border-radius: 12px !important;
  padding: .62rem .9rem !important;
  text-decoration: none !important;
}
body.admin-theme .btn:hover,
body.admin-theme .header-btn:hover,
body.admin-theme .btn-red:hover,
body.admin-theme .btn-yellow:hover,
body.admin-theme .btn.btn-ghost:hover,
body.admin-theme .btn.btn-outline-yellow:hover,
body.admin-theme .menu-item .btn:hover,
body.admin-theme .modal-sheet .btn:hover,
body.admin-theme .admin-main .btn:hover,
body.admin-theme .btn-like:hover {
  filter: brightness(1.04);
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}
body.admin-theme .btn-sm {
  padding: .45rem .75rem !important;
  font-size: .78rem;
}
body.admin-theme .table-actions {
  display: flex;
  gap: .45rem;
  align-items: center;
  flex-wrap: wrap;
}
body.admin-theme .grid-3,
body.admin-theme .grid-2,
body.admin-theme .admin-main .grid-2 {
  gap: 1rem;
}
body.admin-theme .pagination a {
  border: 1px solid #dbe3ff;
  color: #1d4ed8;
  background: #fff;
}
body.admin-theme .pagination a.active,
body.admin-theme .pagination a:hover {
  background: #eef2ff;
}
body.admin-theme .lang-en { color: #1d4ed8; }
body.admin-theme .admin-mini-ar,
body.admin-theme .lang-ar,
body.admin-theme .text-muted { color: #64748b; }
body.admin-theme.admin-login-page,
body.admin-login-page {
  background: #f6f7fb;
}
body.admin-login-page .app {
  max-width: none;
  min-height: 100vh;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding-bottom: 0;
}
body.admin-login-page .card {
  background: #fff;
  border: 1px solid #e6e8ef;
  box-shadow: 0 20px 45px rgba(15,23,42,.08);
  border-radius: 22px;
}
body.admin-login-page h1 {
  color: #0f172a;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: .4rem;
}
body.admin-login-page .login-subtitle {
  color: #64748b;
  margin-bottom: 1rem;
}
body.admin-login-page .admin-login-btn {
  background: #2563eb !important;
  color: #fff !important;
  border: 1px solid #2563eb !important;
}
@media (max-width: 980px) {
  body.admin-theme .admin-shell {
    grid-template-columns: 1fr;
  }
  body.admin-theme .admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  body.admin-theme .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 88vw);
    z-index: 1100;
    transform: translateX(-104%);
    transition: transform .18s ease;
    box-shadow: 0 18px 36px rgba(15,23,42,.16);
  }
  body.admin-theme .admin-sidebar.open {
    transform: translateX(0);
  }
  body.admin-theme .admin-main {
    padding: 14px;
  }
  body.admin-theme .admin-topbar,
  body.admin-theme .admin-topbar-right {
    flex-wrap: wrap;
  }
  body.admin-theme .admin-search-shell input {
    width: 160px;
  }
  body.admin-theme .grid-3,
  body.admin-theme .grid-2,
  body.admin-theme .admin-main .grid-2 {
    grid-template-columns: 1fr;
  }
}


/* ===== Menu Admin Phase 1 light refinements ===== */
body.admin-theme {
  background: #f3f6fb;
  color: #0f172a;
}
body.admin-theme .admin-shell {
  background: #f3f6fb;
  color: #0f172a;
  grid-template-columns: 240px minmax(0, 1fr);
}
body.admin-theme .admin-sidebar {
  background: rgba(255,255,255,.92);
  border-right: 1px solid #dbe3f0;
  backdrop-filter: blur(10px);
}
body.admin-theme .admin-sidebar a {
  color: #1e293b;
}
body.admin-theme .admin-sidebar a.active,
body.admin-theme .admin-sidebar a:hover {
  background: #dbeafe;
  color: #1d4ed8;
}
body.admin-theme .admin-main {
  padding: 1.2rem;
}
body.admin-theme .panel {
  background: #fff;
  border: 1px solid #dbe3f0;
  box-shadow: 0 14px 28px rgba(37,99,235,.06);
  color: #0f172a;
}
body.admin-theme textarea,
body.admin-theme input[type="text"],
body.admin-theme input[type="number"],
body.admin-theme input[type="password"],
body.admin-theme input[type="search"],
body.admin-theme input[type="date"],
body.admin-theme select {
  background: #fff;
  border: 1px solid #dbe3f0;
  color: #0f172a;
}
body.admin-theme .mini { color: #64748b; }
body.admin-theme .data-table th,
body.admin-theme .data-table td {
  border-bottom: 1px solid #edf2f7;
}
body.admin-theme .data-table th { color: #64748b; }
body.admin-theme .btn,
body.admin-theme .admin-main .btn {
  background: #fff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
}
body.admin-theme .btn:hover,
body.admin-theme .admin-main .btn:hover {
  background: #eff6ff !important;
}
.filters-grid {
  display: grid;
  grid-template-columns: 2fr repeat(5, minmax(0, 1fr)) auto;
  gap: .75rem;
  align-items: end;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
}
.stat-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid #dbeafe;
}
.stat-card .stat-label {
  font-size: .78rem;
  color: #64748b;
  margin-bottom: .35rem;
}
.stat-card strong {
  font-size: 1.15rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .3rem .65rem;
  font-size: .74rem;
  font-weight: 800;
}
.pill-mode { background: #eff6ff; color: #1d4ed8; }
.pill-soft { background: #f1f5f9; color: #334155; }
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .34rem .7rem;
  font-size: .74rem;
  font-weight: 800;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1d4ed8; }
.status-preparing { background: #e0f2fe; color: #0369a1; }
.status-done { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }
.table-actions--wrap { flex-wrap: wrap; }
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.order-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.order-view-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr) !important;
}
.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
@media (max-width: 1100px) {
  .filters-grid,
  .stats-grid,
  .order-view-grid,
  .form-grid-2 {
    grid-template-columns: 1fr !important;
  }
}


/* ===== Final admin cleanup / stable layout ===== */
body.admin-theme {
  background: #f3f6fb;
  color: #0f172a;
}
body.admin-theme .admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background: #f3f6fb;
}
body.admin-theme .admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 16px;
  gap: 16px;
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid #dbe3f0;
  box-shadow: none;
  backdrop-filter: none;
}
body.admin-theme .admin-brand-wrap {
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
}
body.admin-theme .admin-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  background: #eef2ff;
  border: 1px solid #dbe3ff;
  color: #1d4ed8;
  font-weight: 800;
}
body.admin-theme .admin-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.admin-theme .admin-brand-title {
  font-size: 1.1rem;
  line-height: 1.2;
}
body.admin-theme .admin-nav {
  gap: 6px;
}
body.admin-theme .admin-sidebar a,
body.admin-theme .admin-logout-link {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}
body.admin-theme .admin-sidebar a span:first-child {
  min-width: 0;
}
body.admin-theme .admin-sidebar-footer {
  padding-top: 8px;
}
body.admin-theme .admin-main {
  min-width: 0;
  padding: 18px 22px 26px;
}
body.admin-theme .admin-topbar {
  margin-bottom: 10px;
  padding-bottom: 4px;
}
body.admin-theme .admin-topbar-left,
body.admin-theme .admin-topbar-right {
  min-width: 0;
}
body.admin-theme .admin-crumb {
  font-size: .95rem;
  font-weight: 500;
}
body.admin-theme h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
body.admin-theme .admin-main > .panel:first-of-type,
body.admin-theme .admin-main > .stats-grid:first-of-type,
body.admin-theme .admin-main > .order-toolbar:first-of-type,
body.admin-theme .admin-main > .cashier-app:first-of-type {
  margin-top: 0;
}
body.admin-theme .admin-search-shell input {
  width: 180px;
}
body.admin-theme .panel {
  border-radius: 20px;
  padding: 1rem;
}
body.admin-theme .data-table {
  width: 100%;
}
body.admin-theme .table-wrap {
  overflow-x: auto;
}
body.admin-theme .data-table td,
body.admin-theme .data-table th {
  vertical-align: top;
}
body.admin-theme .data-table td:last-child,
body.admin-theme .data-table th:last-child {
  white-space: nowrap;
  width: 1%;
}
body.admin-theme .data-table td:last-child .table-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .4rem;
}
body.admin-theme .data-table td:last-child .btn,
body.admin-theme .data-table td:last-child button,
body.admin-theme .data-table td:last-child a {
  white-space: nowrap;
}
body.admin-theme .btn,
body.admin-theme .admin-main .btn,
body.admin-theme .header-btn,
body.admin-theme .btn-like {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .56rem .85rem !important;
  border-radius: 11px !important;
  white-space: nowrap;
}
body.admin-theme .btn-sm {
  min-height: 32px;
  padding: .38rem .7rem !important;
}
body.admin-theme .filters-grid {
  grid-template-columns: 2fr repeat(5, minmax(0, 1fr)) auto;
}
body.admin-theme .stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
body.admin-theme .grid-2,
body.admin-theme .admin-main .grid-2 {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
body.admin-theme .admin-page-items .grid-2,
body.admin-theme .admin-page-addons .grid-2,
body.admin-theme .admin-page-customers .grid-2 {
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
}
body.admin-theme .mini,
body.admin-theme .text-muted,
body.admin-theme .field-label {
  line-height: 1.4;
}
body.admin-theme .truncate-2 {
  -webkit-line-clamp: 2;
}
@media (max-width: 1100px) {
  body.admin-theme .filters-grid,
  body.admin-theme .stats-grid,
  body.admin-theme .grid-2,
  body.admin-theme .admin-main .grid-2 {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 980px) {
  body.admin-theme .admin-shell {
    grid-template-columns: 1fr;
  }
  body.admin-theme .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 88vw);
    transform: translateX(-104%);
    transition: transform .18s ease;
    z-index: 1200;
    box-shadow: 0 18px 36px rgba(15,23,42,.16);
  }
  body.admin-theme .admin-sidebar.open {
    transform: translateX(0);
  }
  body.admin-theme .admin-main {
    padding: 14px;
  }
  body.admin-theme .admin-topbar,
  body.admin-theme .admin-topbar-right {
    flex-wrap: wrap;
  }
  body.admin-theme .admin-search-shell input {
    width: 150px;
  }
}
