/* ============================================================
 * BEIT EL ZAYTOUN - Admin & Delivery portal styles
 * (loaded after style.css)
 * ============================================================ */
body.portal { background: #f4f1e8; }
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 248px; background: var(--olive-900); color: #d9d3bd; display: flex; flex-direction: column; z-index: 60; transform: translateX(-100%); transition: transform .25s; }
[dir="rtl"] .sidebar { transform: translateX(100%); }
body.sb-open .sidebar { transform: none; }
.sb-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; display: none; }
body.sb-open .sb-backdrop { display: block; }
.sb-brand { display: flex; gap: .6rem; align-items: center; padding: 1.1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-brand strong { display: block; color: #fff; font-family: 'Cormorant Garamond', serif; letter-spacing: .05em; font-size: 1.05rem; }
.sb-brand small { color: var(--gold-2); }
.sb-nav { flex: 1; overflow-y: auto; padding: .6rem; display: flex; flex-direction: column; gap: 2px; }
.sb-nav a { color: #d9d3bd; padding: .62rem .8rem; border-radius: 10px; display: flex; align-items: center; gap: .4rem; font-size: .95rem; }
.sb-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-nav a.active { background: var(--olive-600); color: #fff; }
.sb-foot { padding: 1rem; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.sb-foot a { color: var(--gold-2); font-size: .88rem; }
.sb-foot .btn-ghost { color: #d9d3bd; border-color: rgba(255,255,255,.25); }
.pill { background: var(--gold); color: #1a1404; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 0 .45rem; margin-inline-start: auto; min-width: 1.2rem; text-align: center; }
.pill:empty { display: none; }
.portal .burger { display: inline-block; }
@media (min-width: 1000px) {
  .sidebar { transform: none !important; }
  .portal-main { margin-inline-start: 248px; }
  .portal .burger { display: none; }
}
.topbar { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .8rem; padding: .7rem 1.2rem; }
.topbar h1 { font-size: 1.5rem; margin: 0; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.me { font-weight: 600; color: var(--olive-700); display: none; }
@media (min-width: 700px) { .me { display: inline; } }
.ok-text { color: var(--success); font-weight: 600; } .err-text { color: var(--danger); font-weight: 600; }
.portal-content { padding: 1.2rem; max-width: 1400px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat { background: #fff; border-radius: 14px; padding: 1rem 1.1rem; border: 1px solid var(--line); }
.stat span { display: block; color: var(--muted); font-size: .82rem; }
.stat strong { font-size: 1.45rem; color: var(--olive-800); font-family: var(--sans); }
.stat.attn { border-color: var(--gold); background: var(--gold-soft); }
.stat.good strong { color: var(--success); }
.panel { background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: 1.1rem; margin-bottom: 1.2rem; }
.panel h2 { font-size: 1.3rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.panel-head h2 { margin: 0; }
.two-col { display: grid; gap: 1.2rem; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col h3 { font-size: 1.1rem; margin: 1.1rem 0 .4rem; font-family: var(--sans); font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.filters input, .filters select, .inline-form input, .inline-form select, .hours-edit input { border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem; background: #fff; min-height: 42px; }
.filters input[type=search] { flex: 1 1 220px; }
.seg { display: flex; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: .45rem .8rem; border-radius: 9px; cursor: pointer; font-size: .88rem; color: var(--muted); }
.seg button.active, .seg button:hover { background: var(--olive-700); color: #fff; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form input[type=email], .inline-form input:not([type]) { flex: 1 1 200px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: start; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: .6rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .6rem; border-bottom: 1px solid #f0ead9; vertical-align: middle; }
.tbl .num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--cream); }
.tbl .actions { white-space: nowrap; text-align: end; }
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.danger { color: var(--danger) !important; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfc6b0; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--olive-600); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--olive-100); }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; margin: .3rem 1rem .3rem 0; }
.check input { width: 18px; height: 18px; accent-color: var(--olive-600); }
.check.big { font-weight: 600; font-size: 1.02rem; }
.modal-card.wide { max-width: 980px; }
.modal-body h2 { font-size: 1.6rem; }
.form-grid { display: grid; gap: 0 1rem; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; position: sticky; bottom: 0; background: var(--cream); padding: .7rem 0; }
.img-edit { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.img-edit img { width: 140px; height: 105px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.img-edit > div { flex: 1; min-width: 220px; }
.opt-row { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .5rem; background: #fff; align-items: center; }
.opt-row input, .opt-row select { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; min-width: 0; }
@media (min-width: 800px) { .opt-row { grid-template-columns: 1.4fr 1fr 1.2fr 1.2fr .7fr auto auto; } }
.action-bar { display: flex; gap: .6rem; margin: .8rem 0; flex-wrap: wrap; }
.mini-log { list-style: none; padding: 0; margin: .3rem 0; font-size: .88rem; }
.mini-log li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.hours-edit { display: grid; gap: .5rem; margin-bottom: .8rem; }
.hrow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.hrow strong { width: 110px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, #f4f1e8 35%); padding: 1rem 0; text-align: end; }
code { background: var(--cream-2); padding: .1rem .35rem; border-radius: 5px; font-size: .88em; }

/* Chart: single olive series, recessive grid */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #ece5d3; stroke-width: 1; }
.chart .baseline { stroke: #b9ae92; stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .bar { fill: var(--olive-500); }
.chart .bar-g.hover .bar { fill: var(--olive-700); }
.chart-tip { position: absolute; pointer-events: none; opacity: 0; background: var(--olive-900); color: #fff; padding: .35rem .6rem; border-radius: 8px; font-size: .82rem; white-space: nowrap; transition: opacity .12s; }

/* ---------- Delivery app ---------- */
body.driver-app { background: #f4f1e8; padding-bottom: env(safe-area-inset-bottom); }
.drv-top { position: sticky; top: 0; z-index: 30; background: var(--olive-900); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; gap: .5rem; }
.drv-brand { display: flex; align-items: center; gap: .55rem; }
.drv-brand strong { display: block; font-family: 'Cormorant Garamond', serif; letter-spacing: .05em; }
.drv-brand small { color: var(--gold-2); }
.drv-top .btn-lang { color: #fff; border-color: rgba(255,255,255,.35); }
.drv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: .8rem 1rem; background: var(--olive-800); }
.drv-stats div { background: rgba(255,255,255,.08); border-radius: 12px; padding: .6rem; text-align: center; color: #fff; }
.drv-stats strong { display: block; font-size: 1.1rem; }
.drv-stats span { font-size: .72rem; color: #d9d3bd; }
.drv-tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 58px; z-index: 25; }
.drv-tabs button { flex: 1; border: 0; background: none; padding: .9rem; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; display: flex; justify-content: center; gap: .3rem; align-items: center; }
.drv-tabs button.active { color: var(--olive-800); border-bottom-color: var(--gold); }
.drv-tabs .pill { margin: 0; }
.drv-main { padding: 1rem; max-width: 640px; margin: 0 auto; }
.drv-card { background: #fff; border-radius: 16px; padding: 1rem; margin-bottom: 1rem; border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .55rem; }
.drv-card.new { border: 2px solid var(--gold); }
.drv-card.compact { gap: .3rem; font-size: .92rem; }
.ordno { font-size: 1.15rem; }
.cust { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: 1.02rem; }
.addr { margin: 0; }
.drv-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.drv-btns .btn { padding: .5rem .3rem; font-size: .88rem; }
.cod-box { border-radius: 12px; padding: .7rem .9rem; font-size: 1.02rem; }
.cod-box.due { background: var(--gold-soft); color: #5c4300; }
.cod-box.due strong { font-size: 1.25rem; }
.cod-box.paid { background: #e3f0dc; color: var(--success); }
.drv-card details summary { cursor: pointer; font-weight: 600; color: var(--olive-700); }
.drv-card details ul { margin: .4rem 0 0; padding-inline-start: 1.2rem; }
.drv-actions { display: grid; gap: .5rem; }
.drv-actions .btn { min-height: 52px; font-size: 1.05rem; }
.big-amount { display: block; font-size: 2rem; font-weight: 700; color: var(--olive-800); margin: .4rem 0; }
.modal-body > .order-top:first-child { padding-inline-end: 48px; }
.drv-top .btn-lang, .drv-top .btn { white-space: nowrap; }
.drv-top > div:last-child { display: flex; gap: .4rem; }
@media (max-width: 420px) { .drv-brand strong { font-size: .92rem; white-space: nowrap; } .drv-brand img { width: 28px; } }
