/* Controls: buttons, tabs, toggles, choices, switches, checkboxes, chips and pills.
   One filled button per row; «cancel» is a word; no hover lift (owner, 2026-11-21: it flickers on the bottom row). */

/* buttons: filled petrol with a little depth by default */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--ctl); padding: 0 20px; border: 1px solid transparent; border-radius: var(--r-pill);
  background-color: var(--accent); background-image: var(--btn-depth); box-shadow: var(--sh-btn);
  color: var(--on-accent); font-size: var(--fs-2); font-weight: 500; white-space: nowrap;
  transition: transform .12s var(--ease-out), box-shadow .16s, filter .16s;
}
.btn:hover { background-color: var(--accent-2); box-shadow: var(--sh-btn-hover); }
.btn svg, .ic-inline { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* an icon inside a line of text (the closed day's ✓): the button icon's size and colour, on the text's line */
.ic-inline { display: inline-block; vertical-align: -3px; margin-inline-end: 4px; }
.btn.sm { height: var(--ctl-sm); padding: 0 15px; font-size: var(--fs-1); }
.btn.lg { height: var(--ctl-lg); padding: 0 28px; }
.btn.soft { background-color: var(--accent-soft); color: var(--accent-2); }
.btn.soft:hover { background-color: var(--soft-hover); }
/* the green «استلم» button that takes money (.money is the amount itself) */
.btn.pay { background-color: var(--money); color: var(--white); }
.btn.pay:hover { background-color: var(--money-ink); }

/* flat buttons: white with a line, a word, an icon, a warning */
.btn.ghost, .btn.link, .btn.icon, .btn.danger {
  background-image: none; box-shadow: none;
  transition: transform .1s var(--ease-out), background-color .14s, border-color .14s, box-shadow .16s;
}
.btn.ghost { background-color: var(--field); border-color: var(--btn-line); color: var(--accent-2); }
.btn.ghost:hover { background-color: var(--accent-soft); border-color: var(--accent); box-shadow: none; }
.btn.link { height: auto; padding: 2px 6px; border: 0; border-radius: var(--r-link); background-color: transparent; color: var(--accent); }
.btn.link:hover { background-color: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.btn.link.danger { color: var(--rx-ink); }
.btn.icon { width: var(--ctl-sm); height: var(--ctl-sm); padding: 0; flex: none; }
.btn.icon svg { width: 17px; height: 17px; }
.btn.danger { background-color: var(--field); border-color: var(--rx-line); color: var(--rx-ink); }
.btn.danger:hover { background-color: var(--rx-soft); border-color: var(--rx); box-shadow: none; }
.btn.danger.solid { background-color: var(--rx); border-color: var(--rx); color: var(--white); }
.btn.danger.solid:hover { background-color: var(--rx-ink); }
.btn.wa { background-color: var(--wa-soft); border-color: transparent; color: var(--wa); }
.btn.wa:hover { background-color: var(--wa-hover); background-image: none; } /* raised at rest, as the prototype */
.btn:not(.link):active { transform: scale(.975); filter: brightness(.97); }

/* ghost buttons in a page's own bars keep the raised look */
:is(.toolbar, .savebar, .next-acts, .phead, .pstrip, .crumb, .days) .btn.ghost:not(.icon) {
  background-image: var(--btn-depth); box-shadow: var(--sh-btn);
  transition: transform .12s var(--ease-out), box-shadow .16s, filter .16s;
}
:is(.toolbar, .savebar, .next-acts, .phead, .pstrip, .crumb, .days) .btn.ghost:not(.icon):hover { box-shadow: var(--sh-btn-hover); }

/* tabs: a rail with the chosen tab raised */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%; margin-bottom: 14px; padding: 3px; border-radius: var(--r-rail); background: var(--tabs-bg); }
.toolbar .tabs { margin-bottom: 0; }
.tabs button {
  height: var(--ctl-sm); padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent;
  color: var(--muted-2); font-size: var(--fs-1); font-weight: 400;
  transition: transform .1s var(--ease-out), background-color .14s, border-color .14s, box-shadow .16s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--white); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px var(--cover-a18); }
.tabs .n { display: inline-grid; place-items: center; margin-inline-start: 6px; color: var(--muted-2); font-weight: 400; }

/* toggles: one or more picks from a short list (days, filters) */
.togs { display: flex; flex-wrap: wrap; gap: 6px; }
.tog {
  height: var(--ctl-sm); padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--r-pill);
  background: var(--field); color: var(--ink); font-size: var(--fs-1);
  transition: transform .1s var(--ease-out), background-color .14s, border-color .14s, box-shadow .16s;
}
.tog:hover { border-color: var(--own, var(--accent)); }
.tog[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--white); }
.tog[aria-pressed="true"]::before { content: "✓"; margin-inline-end: 4px; }

/* choice: exactly one of a few (gender, slot length) */
.choice {
  display: inline-flex; flex-wrap: wrap; gap: 2px; width: max-content; max-width: 100%; min-height: var(--ctl);
  padding: 3px; overflow: hidden; border: 1px solid var(--choice-line); border-radius: var(--r-rail); background: var(--field);
}
.choice button {
  height: 32px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; font-size: var(--fs-2);
  transition: transform .1s var(--ease-out), background-color .14s, border-color .14s, box-shadow .16s;
}
.choice button:hover:not([aria-pressed="true"]) { background: var(--accent-soft); }
.choice button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 500; }

/* switch: on/off beside a field («لا يملك هاتفاً», «مستعجل») */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-2); cursor: pointer; }
.switch input {
  appearance: none; position: relative; flex: none; width: 38px; height: 22px; margin: 0; padding: 0;
  border: 1px solid var(--field-line); border-radius: var(--r-1); background: var(--switch-off); cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.switch input::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: var(--r-dot);
  background: var(--white); box-shadow: var(--sh-1); transition: inset-inline-start .15s;
}
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { inset-inline-start: 18px; }

/* checkbox with its sentence */
.check { display: flex; align-items: center; gap: 9px; font-size: var(--fs-2); line-height: 1.5; cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--accent); }
.f .check input { background-color: var(--white); } /* a checkbox inside a form field: on the field's white */

/* chips (who it belongs to) and pills (a row's state) */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: var(--r-pill);
  background: var(--own-soft); color: var(--own-ink); font-size: var(--fs-1); font-weight: 500; line-height: 1.6; white-space: nowrap;
}
.chip.dot::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-dot); background: var(--own); }
.sh-head .chip.auto { min-width: 0; padding: 0; background: none; color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: var(--fs-1); font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.pill:is(.waiting, .inside, .booked, .done, .away, .left) { padding: 0; border: 0; background: none; line-height: 1.6; }
.pill.waiting { color: var(--amber); }
.pill.inside { color: var(--accent-2); }
.pill:is(.booked, .away, .left) { color: var(--muted); }
.pill.done { color: var(--money-ink); }
.pill.left { text-decoration: line-through; }
.pill:is(.waiting, .inside)::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-dot); background: currentColor; }
.pill.away::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-dot); box-shadow: inset 0 0 0 1.5px currentColor; }
.pill.done::before { content: "✓"; }
.pill.red { background: var(--rx-soft); color: var(--rx-ink); }
.pill.new { background: var(--own-pat-soft); color: var(--own-pat-ink); }
.pill.urgent { background: var(--rx); color: var(--white); }
.vok { color: var(--money-ink); font-weight: 500; white-space: nowrap; }

/* the visit's mark in a row: written / draft */
.mk { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-1); white-space: nowrap; }
.mk i { width: 11px; height: 11px; border-radius: var(--r-dot); box-shadow: inset 0 0 0 1.5px var(--btn-line); }
.mk.draft { color: var(--amber); }
.mk.draft i { box-shadow: inset 0 0 0 1.5px var(--amber); background: linear-gradient(90deg, var(--amber) 50%, transparent 50%); }
.mk.done { color: var(--money-ink); }
.mk.done i { background: var(--money); box-shadow: none; }

/* a finger needs room on a touch screen */
@media (pointer: coarse) {
  .btn.sm { min-height: 40px; }
  .btn.icon { min-width: 40px; min-height: 40px; }
  .btn.link { min-height: 40px; padding-block: 6px; }
  .tabs button, .tog, .choice button { min-height: 42px; }
  .check, .switch { min-height: 44px; }
  .check input { width: 22px; height: 22px; }
}
