/* Aldiwaniya customer book: the shop's navy, gold and sea blue, one column, phone first */
:root { --ink: #16305A; --gilt: #D29A2E; --gold-deep: #A06E14; --sea: #2A6FA8; --page: #F4F7FB; --card: #fff; --line: #DCE4EE;
  --text: #1F2937; --muted: #5B6676; --bad: #B42318; --ok: #1E7B4F; --r: 16px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--page); color: var(--text); font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 14px 80px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.bad { color: var(--bad); font-weight: 500; margin: 8px 0 0; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ink); color: #fff;
  border-bottom: 3px solid var(--gilt); }
.top .logo { width: 40px; height: 40px; object-fit: contain; }
.top .title { flex: 1; font-size: 18px; font-weight: 800; }

/* buttons */
button { cursor: pointer; border-radius: 999px; border: 1px solid transparent; min-height: 44px; padding: 0 18px; font-weight: 700; }
.main { background: var(--ink); color: #fff; }
.main:hover { background: #0f2444; }
.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.top .ghost { color: #fff; border-color: rgba(255,255,255,.45); }
.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.danger { background: #fff; color: var(--bad); border-color: #F1C1BC; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gilt); outline-offset: 2px; }

/* inputs */
label, .lbl { display: block; font-size: 14px; font-weight: 700; margin: 12px 0 6px; color: var(--ink); }
input:not([type=checkbox]) { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: #fff; color: var(--text); }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #FFF8EA; }
.switch input { width: 22px; height: 22px; accent-color: var(--ink); }

/* sign in */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.signin { max-width: 380px; margin: 40px auto; }
.signin h1 { margin: 0 0 6px; color: var(--ink); font-size: 24px; }
.signin .main { width: 100%; margin-top: 16px; }

/* tabs */
.tabs { display: flex; gap: 6px; background: #E7EDF5; padding: 5px; border-radius: 999px; margin-bottom: 14px; }
.tabs button { flex: 1; background: transparent; color: var(--muted); min-height: 40px; }
.tabs button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(22,48,90,.15); }

/* the list */
.bar { display: flex; gap: 8px; }
.bar input { flex: 1; }
.bar .main { white-space: nowrap; }
#count { margin: 10px 2px; }
.cust { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; display: grid;
  grid-template-columns: 1fr auto; gap: 6px 12px; border-inline-start: 5px solid var(--sea); }
.cust.student { border-inline-start-color: var(--gilt); }
.cust h3 { margin: 0; font-size: 18px; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 800; background: #FFF1D4; color: var(--gold-deep); border-radius: 999px; padding: 2px 10px; }
.cust .ph { direction: ltr; unicode-bidi: isolate; color: var(--muted); font-size: 15px; }
.facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.facts span { background: #EEF3F9; border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.facts b { color: var(--ink); }
.acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.acts a, .acts button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.acts svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plus { grid-row: 1 / span 2; grid-column: 2; width: 56px; height: 56px; min-height: 56px; padding: 0; border-radius: 50%; background: var(--gilt);
  color: #fff; font-size: 30px; line-height: 1; box-shadow: 0 3px 10px rgba(210,154,46,.4); }
.plus:hover { background: var(--gold-deep); }
.empty { text-align: center; padding: 36px 10px; color: var(--muted); }

/* dialogs */
dialog.sheet { width: min(560px, 100%); max-height: 92vh; border: 0; border-radius: 20px; padding: 18px; color: var(--text); }
dialog.sheet::backdrop { background: rgba(14,28,52,.55); }
dialog h2 { margin: 0 0 4px; color: var(--ink); font-size: 20px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.row .main { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu { display: grid; gap: 6px; margin-top: 10px; max-height: 42vh; overflow: auto; padding-inline-end: 2px; }
.dish { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.dish.on { border-color: var(--ink); background: #F1F5FB; }
.dish b { display: block; font-size: 15px; } .dish small { color: var(--muted); }
.step { display: flex; align-items: center; gap: 4px; }
.step button { width: 38px; min-height: 38px; padding: 0; background: #EEF3F9; color: var(--ink); font-size: 20px; }
.step output { min-width: 26px; text-align: center; font-weight: 800; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: #fff; color: var(--ink); border-color: var(--line); min-height: 40px; }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sum { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.sum div { display: flex; justify-content: space-between; padding: 2px 0; }
.sum .off { color: var(--ok); }
.sum .total { font-size: 18px; font-weight: 800; color: var(--ink); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }

/* numbers */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; border-top: 4px solid var(--sea); }
.tile:nth-child(2) { border-top-color: var(--gilt); } .tile:nth-child(3) { border-top-color: var(--ink); } .tile:nth-child(4) { border-top-color: var(--gold-deep); }
.tile small { display: block; color: var(--muted); font-size: 13px; }
.tile b { display: block; font-size: 24px; color: var(--ink); }
.tile span { font-size: 13px; color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 12px; }
.panel h3 { margin: 0 0 10px; color: var(--ink); font-size: 17px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
.hbar i { display: flex; height: 12px; border-radius: 999px; background: #E7EDF5; overflow: hidden; }
.hbar i em { display: block; height: 100%; background: var(--sea); border-radius: 999px; }
.hbar.gold i em { background: var(--gilt); }
.hbar b { color: var(--ink); white-space: nowrap; }
.months { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 10px; overflow-x: auto; }
.month { flex: 1 0 44px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 12px; }
.month em { display: block; width: 100%; max-width: 46px; background: var(--ink); border-radius: 8px 8px 3px 3px; min-height: 3px; }
.month.now em { background: var(--gilt); }
.month b { font-size: 11px; color: var(--ink); }
.ring { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 0; }
.ring b { background: #fff; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: var(--ink); }

#toast { position: fixed; bottom: 18px; inset-inline: 14px; max-width: 420px; margin: 0 auto; background: var(--ink); color: #fff; padding: 12px 16px;
  border-radius: 14px; text-align: center; z-index: 20; font-weight: 700; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

/* a customer's card opens their past orders */
.cust[data-card] { cursor: pointer; transition: box-shadow .15s; }
.cust[data-card]:hover { box-shadow: 0 4px 14px rgba(22,48,90,.12); }
.cust[data-card]:focus-visible { outline: 3px solid var(--gilt); outline-offset: 2px; }
.past { display: grid; gap: 10px; margin-top: 12px; max-height: 58vh; overflow: auto; }
.po { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; border-inline-start: 4px solid var(--sea); }
.po.gone { opacity: 1; border-inline-start-color: var(--bad); background: #FFF6F5; }
.po-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.po-head .po-total { margin-inline-start: auto; color: var(--ink); }
.tag.no { background: #FDE2DF; color: var(--bad); }
.po ul { list-style: none; margin: 8px 0 6px; padding: 0; }
.po li { display: flex; gap: 6px; padding: 2px 0; font-size: 15px; }
.po li b { margin-inline-start: auto; font-weight: 600; }
.po-foot { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.po-foot span { background: #EEF3F9; border-radius: 999px; padding: 2px 10px; }
.po-note { margin: 6px 0 0; }
