:root {
  --coral: #ff6f61;
  --coral-soft: rgba(255, 111, 97, 0.14);
  --navy: #1b2a4a;
  --muted: #5c6b80;
  --bg: #f7f5f4;
  --card: #fff;
  --border: rgba(27, 42, 74, 0.1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "SF Arabic", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--navy);
  direction: rtl;
  text-align: right;
}
body.ltr {
  direction: ltr;
  text-align: left;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 72px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.brand img { height: 64px; width: auto; object-fit: contain; }
.brand h1 { margin: 0; font-size: 22px; }
.brand small { color: var(--muted); display: block; }
.lang-switch { display: flex; gap: 6px; margin-inline-start: auto; }
.lang-switch button { min-width: 92px; }
body.ltr input:not([dir="ltr"]),
body.ltr select,
body.ltr textarea {
  text-align: left;
  direction: ltr;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
h2 { margin: 0 0 12px; font-size: 18px; }
label { display: block; font-weight: 700; margin: 10px 0 6px; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: var(--navy);
  background: #fff;
}
body:not(.ltr) input:not([dir="ltr"]),
body:not(.ltr) select,
body:not(.ltr) textarea {
  text-align: right;
  direction: rtl;
}
textarea { min-height: 80px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
button, .btn {
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: var(--coral);
  color: #fff;
}
button.ghost, .btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
}
button.ghost.on { border-color: var(--navy); color: var(--navy); }
button.navy { background: var(--navy); }
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--bg);
}
.tabs button { flex: 1 0 auto; min-width: 104px; background: #fff; color: var(--muted); border: 1px solid var(--border); }
.tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(27,42,74,.08); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar select { width: auto; min-width: 180px; flex: 1; }
.hidden, .role-hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.legal-foot { margin-top: 16px; text-align: center; }
.legal-foot a { color: var(--navy); font-weight: 700; }
.order {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}
.order.pending { border-color: var(--coral); background: var(--coral-soft); animation: pulse-border 1.4s ease-in-out 3; }
.orders-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.review { border-top: 1px solid var(--border); padding: 10px 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.menu-list .product { align-items: flex-start; }
.menu-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #eee; flex-shrink: 0; }
.media-preview { margin: 10px 0 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.media-preview img, .media-preview video {
  width: min(100%, 320px);
  max-height: 200px;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}
.vid-dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--coral); margin-inline-end: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 12px 0; }
.check input { width: auto; min-height: 0; }
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--navy);
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.alert-banner strong { color: #fff; }
.alert-banner button { background: #fff; color: var(--navy); }
body.new-order-flash { animation: flash-bg 1.6s ease; }
@keyframes flash-bg {
  0%, 100% { background: var(--bg); }
  25%, 75% { background: #ffe8e4; }
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 111, 97, 0); }
  50% { box-shadow: 0 0 0 6px rgba(255, 111, 97, 0.22); }
}
.video-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.video-row video { width: 120px; height: 72px; border-radius: 10px; background: #111; object-fit: cover; }
.err { color: #c62828; margin: 8px 0; }
.ok { color: #2e7d4f; }
.product { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
h3 { margin: 20px 0 10px; font-size: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.kpi { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: #fff; }
.kpi strong { display: block; font-size: 22px; }
.hours-row { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 8px; align-items: center; margin: 8px 0; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 800; }
.badge-open { background: #e8f5ec; color: #2e7d4f; }
.badge-closed { background: #fdecea; color: #c62828; }
.badge-busy { background: #fff4e5; color: #c98400; }
.invoice { border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin: 10px 0; }
.stock-on { color: #2e7d4f; font-weight: 700; }
.stock-off { color: #c62828; font-weight: 700; }
.was { text-decoration: line-through; color: var(--muted); font-weight: 600; margin-inline-start: 6px; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
#tablet {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 40;
  overflow: auto;
  padding: 16px 20px 40px;
}
.tablet-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.tablet-logo { height: 48px; width: auto; }
.tablet-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.tablet-order { font-size: 20px; padding: 20px; }
.tablet-order .row button { min-height: 52px; font-size: 16px; }
body.tablet-on { overflow: hidden; }
body.tablet-on .wrap { display: none; }
@media (min-width: 900px) {
  .orders-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .brand img { height: 48px; }
  .hours-row { grid-template-columns: 1fr 1fr; }
  .hours-row strong { grid-column: 1 / -1; }
}
@media print {
  .brand, .tabs, .row, #auth, button { display: none !important; }
  .card, .invoice { border: 0; box-shadow: none; }
}
