/* REDESIGN-2026 · S1 — الموقع والمشرف. أصناف `s1-*` بس، والألوان من `--ty-*` (tokens.css).
   شاشات المشرف: أهداف لمس 56–64px وخط 16–19px (SPEC §1.6). */

/* ---------------------------------------------------------------- M08 · شغل النهاردة */

.s1-home {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--ty-font-body);
  color: var(--ty-text);
}

.s1-home__head {
  display: flex;
  flex-direction: column;
}

.s1-home__project {
  font-size: 14px;
  color: var(--ty-text-2);
}

.s1-home__title {
  margin: 0;
  font-family: var(--ty-font-head);
  font-size: 26px;
  font-weight: 700;
}

.s1-home__blocker {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--ty-radius-s);
  background: var(--ty-warn-bg);
  color: var(--ty-warn-fg);
  font-size: 15px;
  font-weight: 600;
}

.s1-home__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.s1-home__btn {
  min-height: 136px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-l);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}

.s1-home__btn:focus-visible,
.s1-pick:focus-visible,
.s1-cta:focus-visible,
.s1-qty__btn:focus-visible,
.s1-screen__close:focus-visible,
.s1-link:focus-visible {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

.s1-home__icon {
  color: var(--ty-green);
}

.s1-home__icon--bad {
  color: var(--ty-bad-fg);
}

.s1-home__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.s1-home__label strong {
  font-size: 19px;
  overflow-wrap: anywhere;
}

.s1-home__label small {
  font-size: 14px;
  color: var(--ty-text-2);
  overflow-wrap: anywhere;
}

.s1-home__btn--primary {
  border-color: var(--ty-green);
  background: var(--ty-green);
  color: var(--ty-on-green);
}

.s1-home__btn--primary .s1-home__icon,
.s1-home__btn--primary .s1-home__label small {
  color: var(--ty-on-green);
}

.s1-home__btn--primary .s1-home__label small {
  opacity: 0.85;
}

@media (min-width: 900px) {
  .s1-home__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------------- شاشة كاملة (M09 / M10) */

.s1-screen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  background: var(--ty-bg);
  color: var(--ty-text);
  font-family: var(--ty-font-body);
  font-variant-numeric: tabular-nums;
}

.s1-screen__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--ty-line-soft);
}

.s1-screen__close {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ty-line);
  border-radius: 14px;
  background: var(--ty-surface);
  color: var(--ty-text);
  cursor: pointer;
}

.s1-screen__heading {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.s1-screen__path {
  font-size: 14px;
  color: var(--ty-text-2);
}

.s1-screen__title {
  margin: 0;
  font-family: var(--ty-font-head);
  font-size: 23px;
  font-weight: 700;
}

.s1-screen__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  box-sizing: border-box;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.s1-screen__foot {
  padding: 12px 20px 22px;
  border-top: 1px solid var(--ty-line);
  background: var(--ty-surface);
}

.s1-screen__foot .s1-cta {
  max-width: 600px;
  margin: 0 auto;
}

/* REVIEW-1107: ليه الزرار رمادي — سطر واحد فوقه («اكتب الكمية اللي وصلت.»). */
.s1-foot__why {
  max-width: 600px;
  margin: 0 auto 8px;
  color: var(--ty-text-2);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}
.s1-foot__why.is-hidden,
.s1-foot__why:empty {
  display: none;
}

.s1-step {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.s1-step__title {
  padding: 0;
  font-size: 17px;
  font-weight: 700;
}

legend.s1-step__title {
  margin-bottom: 10px;
}

.s1-step__empty {
  margin: 0;
  font-size: 15px;
  color: var(--ty-text-2);
}

.s1-pick {
  min-height: 72px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}

.s1-pick.is-on {
  border: 2px solid var(--ty-green);
  background: var(--ty-green-soft);
}

.s1-pick__dot {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 2px solid var(--ty-text-3);
  border-radius: 50%;
  background: var(--ty-surface);
}

.s1-pick.is-on .s1-pick__dot {
  border: 7px solid var(--ty-green);
}

.s1-pick__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.s1-pick__text strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.s1-pick__text small {
  font-size: 14px;
  color: var(--ty-text-2);
  overflow-wrap: anywhere;
}

.s1-free {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.s1-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

.s1-input {
  height: var(--ty-touch-field);
  width: 100%;
  box-sizing: border-box;
  padding: 0 16px;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-s);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  font-size: 17px;
  font-weight: 400;
}

.s1-input--area {
  height: auto;
  min-height: 96px;
  padding: 12px 16px;
  line-height: 1.6;
}

.s1-input::placeholder {
  color: var(--ty-text-3);
}

.s1-qty {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
}

.s1-qty__btn {
  height: 64px;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  font-size: 30px;
  font-weight: 700;
  cursor: pointer;
}

.s1-qty__btn--plus {
  border-color: var(--ty-green);
  background: var(--ty-green);
  color: var(--ty-on-green);
}
/* AUDIT-1022 · 12: «+» عند آخر الباقي في الأمر — مقفول وباين إنه مقفول، مش أخضر شغّال. */
.s1-qty__btn:disabled {
  border-color: var(--ty-line);
  background: var(--ty-surface-2);
  color: var(--ty-text-3);
  cursor: not-allowed;
}

.s1-qty__box {
  position: relative;
  height: 64px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
}

.s1-qty__box.is-over {
  border: 2px solid var(--ty-danger);
  background: var(--ty-bad-bg);
}

/* الحقل مالي الصندوق كله (هدف لمس 64)، والوحدة مرسومة فوقه تحت الرقم. */
.s1-qty__input {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 8px 20px;
  border-radius: inherit;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.s1-qty__input:focus {
  outline: none;
}

.s1-qty__box:focus-within {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

.s1-qty__unit {
  position: absolute;
  inset-inline: 0;
  bottom: 5px;
  text-align: center;
  pointer-events: none;
  font-size: 14px;
  color: var(--ty-text-2);
}

.s1-alert {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ty-bad-fg);
}

.s1-alert svg {
  flex-shrink: 0;
}

.s1-alert.is-hidden {
  display: none;
}

.s1-link {
  align-self: flex-start;
  min-height: var(--ty-touch);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ty-green);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.s1-rule {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--ty-radius-s);
  background: var(--ty-warn-bg);
  color: var(--ty-warn-fg);
  font-size: 14px;
  line-height: 1.6;
}

.s1-cta {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--ty-radius-m);
  background: var(--ty-green);
  color: var(--ty-on-green);
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

.s1-cta:disabled {
  background: var(--ty-disabled-bg);
  color: var(--ty-disabled-fg);
  cursor: not-allowed;
}

/* RV1107C: رابط بشكل الزرار (رسالة واتساب للمكتب). */
a.s1-cta {
  text-decoration: none;
}

.s1-cta--second {
  height: 60px;
  border: 1.5px solid var(--ty-line-strong);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-size: 17px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- M10 · اتسجل */

.s1-saved {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 72px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.s1-saved__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.s1-saved__mark {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ty-green);
  color: var(--ty-on-green);
}

.s1-saved__title {
  margin: 0;
  font-family: var(--ty-font-head);
  font-size: 28px;
  font-weight: 700;
}

.s1-saved__what {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ty-text-2);
  overflow-wrap: anywhere;
}

.s1-saved__offline,
.s1-saved__note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--ty-radius-m);
  background: var(--ty-warn-bg);
  color: var(--ty-warn-fg);
}

.s1-saved__offline svg {
  flex-shrink: 0;
}

.s1-saved__offline div,
.s1-saved__note {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.s1-saved__offline strong {
  font-size: 16px;
}

.s1-saved__offline span,
.s1-saved__note span {
  font-size: 15px;
  line-height: 1.7;
}

.s1-saved__actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------------------------------------------------------------- تحت الست أزرار (GAPS-S1) */

.s1-home__all {
  align-self: flex-start;
  min-height: var(--ty-touch);
  padding: 0 16px;
  border: 1px solid var(--ty-line);
  border-radius: var(--ty-radius-s);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.s1-home__all:focus-visible {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

.s1-balance {
  padding: 16px;
  border: 1px solid var(--ty-line);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
}

.s1-balance h3 {
  margin: 0 0 8px;
  font-family: var(--ty-font-head);
  font-size: 17px;
}

.s1-balance ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.s1-balance li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--ty-line-soft);
  font-size: 15px;
}

.s1-balance li:last-child {
  border-bottom: 0;
}

.s1-balance li span {
  flex: 1 1 10rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.s1-balance li b {
  font-weight: 600;
  color: var(--ty-text-2);
}

/* V2 · 4: المشرف بيشوف الوحدة بس (الجرد الأعمى) — وحدة، مش رقم: من غير خط الرقم التقيل. */
.s1-balance li b.is-unit {
  color: var(--ty-text-3);
  font-size: 14px;
  font-weight: 400;
}

.s1-balance li em {
  font-style: normal;
  font-size: 14px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ty-warn-bg);
  color: var(--ty-warn-fg);
}

.s1-balance p {
  margin: 0;
  font-size: 15px;
  color: var(--ty-text-2);
}

/* ---------------------------------------------------------------- مناطق الشغل (M17 / M12 / M18) */

.s1-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.s1-chip {
  min-height: 52px;
  padding: 6px 10px;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-s);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.s1-chip.is-on {
  border: 2px solid var(--ty-green);
  background: var(--ty-green-soft);
  color: var(--ty-green-deep);
  font-weight: 700;
}

.s1-chip--add {
  border-style: dashed;
  color: var(--ty-green);
  font-weight: 700;
}

.s1-chip:focus-visible {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- M18 · حضور العمالة */

.s1-screen__pill {
  margin-inline-start: auto;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--ty-green-soft);
  color: var(--ty-green-deep);
  font-size: 14px;
  font-weight: 700;
}

.s1-crews {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.s1-crew {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
}

.s1-crew.is-on {
  border: 2px solid var(--ty-green);
}

.s1-crew__toggle {
  flex: 1 1 180px;
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ty-text);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}

.s1-crew__check {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ty-text-3);
  border-radius: 8px;
  color: var(--ty-on-green);
}

.s1-crew.is-on .s1-crew__check {
  border-color: var(--ty-green);
  background: var(--ty-green);
}

.s1-crew__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.s1-crew__text strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.s1-crew__text small {
  font-size: 14px;
  color: var(--ty-text-2);
}

.s1-crew__nums {
  display: flex;
  align-items: center;
  gap: 8px;
}

.s1-mini {
  display: grid;
  grid-template-columns: 48px 44px 48px;
  align-items: center;
  height: 52px;
  overflow: hidden;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-s);
  background: var(--ty-surface);
}

.s1-mini__btn {
  height: 100%;
  border: 0;
  background: var(--ty-surface-2);
  color: var(--ty-text);
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.s1-mini__btn--plus {
  background: var(--ty-green-soft);
  color: var(--ty-green);
}

.s1-mini__n {
  text-align: center;
  font-size: 17px;
}

.s1-crew__hours {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--ty-text-2);
}

.s1-crew__hours-input {
  width: 52px;
  height: 52px;
  box-sizing: border-box;
  padding: 0 4px;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-s);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.s1-crew__toggle:focus-visible,
.s1-mini__btn:focus-visible,
.s1-crew__hours-input:focus-visible {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- M19 · جرد */

.s1-screen__count {
  margin-inline-start: auto;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ty-text-2);
}

.s1-info {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ty-info-bg);
  color: var(--ty-info-fg);
  font-size: 14px;
  line-height: 1.7;
}

.s1-counts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.s1-count {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--ty-touch-field);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--ty-line);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  font-size: 16px;
  text-align: start;
}

button.s1-count {
  cursor: pointer;
}

.s1-count b {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.s1-count.is-open {
  flex-direction: column;
  align-items: stretch;
  padding: 16px;
  border: 2px solid var(--ty-green);
}

.s1-count__name {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 17px;
}

.s1-count__name span {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--ty-text-2);
}

.s1-count__actions {
  display: flex;
  gap: 8px;
}

.s1-count__done,
.s1-count__none {
  min-height: var(--ty-touch);
  border-radius: var(--ty-radius-s);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

.s1-count__done {
  flex: 1;
  border: 0;
  background: var(--ty-charcoal);
  color: var(--ty-on-charcoal);
  font-weight: 700;
}

.s1-count__none {
  padding: 0 14px;
  border: 1.5px solid var(--ty-line-strong);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-weight: 600;
}

.s1-count__check {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ty-green);
  color: var(--ty-on-green);
}

.s1-count__value {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.s1-count.is-waiting {
  border-style: dashed;
  color: var(--ty-text-2);
}

.s1-count:focus-visible,
.s1-count__done:focus-visible,
.s1-count__none:focus-visible {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

/* الجرد: الوحدة في سطر الاسم، فالرقم يتوسّط الصندوق. */
.s1-count .s1-qty__input {
  padding-bottom: 0;
}

/* ---------------------------------------------------------------- M20 · بلّغ عن مشكلة */

.s1-kinds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.s1-kind {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}

.s1-kind svg {
  flex-shrink: 0;
}

.s1-kind span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.s1-kind b {
  font-size: 16px;
}

.s1-kind small {
  font-size: 14px;
}

.s1-kind.is-on {
  border: 2px solid var(--ty-green);
  background: var(--ty-green-soft);
  color: var(--ty-green-deep);
}

.s1-kind.is-on.s1-kind--safety {
  border-color: var(--ty-danger);
  background: var(--ty-bad-bg);
  color: var(--ty-bad-fg);
}

.s1-chips--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.s1-chip--high {
  color: var(--ty-bad-fg);
}

.s1-chip--medium.is-on {
  border-color: var(--ty-warn-fg);
  background: var(--ty-warn-bg);
  color: var(--ty-warn-fg);
}

.s1-chip--high.is-on {
  border-color: var(--ty-danger);
  background: var(--ty-bad-bg);
  color: var(--ty-bad-fg);
}

.s1-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.s1-photo {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  background: var(--ty-surface-2);
}

.s1-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.s1-photo__remove {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: var(--ty-touch);
  height: var(--ty-touch);
  border: 0;
  border-radius: 0 0 0 14px;
  background: var(--ty-charcoal);
  color: var(--ty-on-charcoal);
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}

.s1-photo--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--ty-text-3);
  background: var(--ty-surface);
  color: var(--ty-green);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* الحقل مالي الخانة وشفاف: الضغطة عليه مباشرة، ولوحة المفاتيح بتوصله. */
.s1-photo__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.s1-photo--add:focus-within,
.s1-kind:focus-visible,
.s1-photo__remove:focus-visible {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

.s1-cta--danger {
  background: var(--ty-danger);
  color: var(--ty-on-danger);
}

/* ---------------------------------------------------------------- M12 · تقرير اليوم */

.s1-photo__tag {
  position: absolute;
  bottom: 6px;
  inset-inline-start: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--ty-charcoal);
  color: var(--ty-on-charcoal);
  font-size: 14px;
  font-weight: 600;
}

.s1-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
  padding: 4px;
  border-radius: var(--ty-radius-s);
  background: var(--ty-mute-bg);
}

.s1-seg__btn {
  min-height: var(--ty-touch);
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ty-text-2);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.s1-seg__btn.is-on {
  background: var(--ty-surface);
  color: var(--ty-text);
  font-weight: 700;
}

.s1-link--file {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
}

.s1-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.s1-readout {
  min-height: 60px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px;
  border: 1.5px solid var(--ty-line);
  border-radius: 14px;
  background: var(--ty-surface-2);
  text-align: center;
}

.s1-readout__n {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.s1-readout__none {
  font-size: 14px;
  font-weight: 400;
  color: var(--ty-text-2);
}

.s1-readout__btn {
  width: 100%;
  min-height: var(--ty-touch);
  border: 0;
  border-radius: 10px;
  background: var(--ty-green-soft);
  color: var(--ty-green-deep);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.s1-mini--wide {
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  height: 60px;
  border-radius: 14px;
}

.s1-mini--wide .s1-mini__n {
  font-size: 22px;
}

.s1-switch {
  min-height: var(--ty-touch-field);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border: 1.5px solid var(--ty-line-strong);
  border-radius: 14px;
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.s1-switch.is-on {
  border: 2px solid var(--ty-warn-fg);
  background: var(--ty-warn-bg);
  color: var(--ty-warn-fg);
}

.s1-seg__btn:focus-visible,
.s1-readout__btn:focus-visible,
.s1-switch:focus-visible,
.s1-link--file:focus-within {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

/* ================================================================ شاشات الويب (W05 · W13 · W14 · W15 · W16 · M11) */

.s1-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--ty-font-body);
  color: var(--ty-text);
  font-variant-numeric: tabular-nums;
}

.s1-page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.s1-page__heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.s1-page__path {
  font-size: 14px;
  color: var(--ty-text-2);
}

.s1-page__title {
  margin: 0;
  font-family: var(--ty-font-head);
  font-size: 26px;
  font-weight: 700;
}

.s1-page__lede {
  margin: 0;
  max-width: 68ch;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ty-text-2);
}

.s1-page__actions,
.s1-page__menu,
.s1-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.s1-page__menu {
  padding: 12px;
  border: 1px solid var(--ty-line);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
}

.s1-page__empty {
  margin: 0;
  padding: 20px 4px;
  font-size: 15px;
  color: var(--ty-text-2);
}

/* V2 · 10: تبويبات المخزن الأربعة كانت بتنزل سطرين على 360 (101px). سطر واحد بيتسحب، وطرفه بيبهت لما
   فيه باقي (`ty-scroll-fade` في ui.css). */
.s1-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--ty-line);
  scrollbar-width: none;
}

.s1-tabs .s1-tab {
  flex-shrink: 0;
  white-space: nowrap;
}

/* صندوق التمرير بيقص الحلقة اللي برّه الزر: حلقة التركيز جوّاه. */
.s1-tabs .s1-tab:focus-visible {
  outline-offset: -3px;
}

.s1-tab {
  min-height: var(--ty-touch);
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ty-text-2);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.s1-tab.is-on {
  border-bottom-color: var(--ty-green);
  color: var(--ty-text);
  font-weight: 700;
}

.s1-tabs--pills {
  gap: 8px;
  border-bottom: 0;
}

.s1-tabs--pills .s1-tab {
  border: 1.5px solid var(--ty-line-strong);
  border-radius: 999px;
  background: var(--ty-surface);
}

.s1-tabs--pills .s1-tab.is-on {
  border-color: var(--ty-charcoal);
  background: var(--ty-charcoal);
  color: var(--ty-on-charcoal);
}

/* PHONE-FIT (أنس 2026-10-24: «عايز الكلام كله باين في الشاشة في التليفون، ما اقعدش اجي يمين وشمال»):
   على التليفون التبويبات بتنزل سطر تاني بدل الصف اللي بيتسحب — قراره الأحدث بدل V2 · 10. */
@media (max-width: 640px) {
  .s1-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  /* REVIEW-1103: «الجرد» كان قاعد لوحده في السطر التاني (زرار 59px في آخر الشاشة). كل تبويب بيكبر لحد ما
     السطر يتملي، فالسطرين صفّين تبويبات كاملين، وكلها لسه باينة من غير سحب (قرار PHONE-FIT فوق). */
  .s1-tabs:not(.s1-tabs--pills) .s1-tab {
    flex-grow: 1;
    text-align: center;
  }
  .s1-tabs .s1-tab {
    flex-shrink: 1;
    padding: 0 12px;
  }
}

.s1-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--ty-line);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
}

.s1-card__title {
  margin: 0;
  font-family: var(--ty-font-head);
  font-size: 18px;
}

.s1-card__sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ty-text-2);
}

.s1-table__scroll {
  overflow-x: auto;
}

.s1-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.s1-table th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--ty-line);
  color: var(--ty-text-2);
  font-size: 14px;
  font-weight: 600;
  text-align: start;
  white-space: nowrap;
}

.s1-table td {
  padding: 12px;
  border-bottom: 1px solid var(--ty-line-soft);
  vertical-align: middle;
  text-align: start;
}

.s1-table tr:last-child td {
  border-bottom: 0;
}

.s1-table__sub {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--ty-text-2);
}

.s1-old {
  border: 1px dashed var(--ty-line-strong);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
}

.s1-old__summary {
  min-height: var(--ty-touch);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ty-green);
  cursor: pointer;
}

.s1-old__body {
  padding: 4px 16px 16px;
}

.s1-entries {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* MENU-FOLD: «أكتر» في صفحة الموقع — نفس المسافة بين البطاقات وهو مفتوح. */
.s1-entries > .nav-more-block > .s1-entry {
  width: 100%;
  margin-top: 10px;
}

.s1-entry {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--ty-line);
  border-radius: var(--ty-radius-m);
  background: var(--ty-surface);
  color: var(--ty-text);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}

/* ORGANIZE-1101: أيقونة الشاشة في أول الصف — نفس الطقم اللي في القائمة والدليل. */
.s1-entry__ico {
  display: flex;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--ty-green);
}
.s1-entry__ico svg {
  width: 24px;
  height: 24px;
}
.s1-entry__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.s1-entry__text strong {
  font-size: 17px;
}

.s1-entry__text small {
  font-size: 14px;
  color: var(--ty-text-2);
}

.s1-entry__go {
  font-size: 22px;
  color: var(--ty-text-3);
}

.s1-tab:focus-visible,
.s1-entry:focus-visible,
.s1-old__summary:focus-visible {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .s1-page__title {
    font-size: 23px;
  }

  .s1-card {
    padding: 12px;
  }

  .s1-page__actions .ty-btn {
    flex: 1 1 auto;
  }
}

/* عنوان الصف اللي بيفتح صفحة السجل. */
.s1-rowlink {
  min-height: var(--ty-touch);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ty-green-deep);
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.s1-rowlink:focus-visible {
  outline: 3px solid var(--ty-green);
  outline-offset: 2px;
}

.s1-rowlink {
  min-width: var(--ty-touch);
}

.s1-table td:first-child {
  min-width: 132px;
}

/* M0.4f: باقي الخانات (كمية + وحدة، حالة، تاريخ) ما تتكسرش كلمة في كل سطر لما الاسم يطوّل — الجدول بيتمرّر أفقيًا في .s1-table__scroll. */
.s1-table td:not(:first-child) {
  white-space: nowrap;
}

/* SERVER-CARDS B · ج17: مصغّر دليل الملاحظة في صفحة السجل. */
.s1-evidence {
  display: inline-block;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--ty-surface-2);
}

.s1-evidence img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------------------------------------------------------------- WAVE-2 · QHS-01 · الاستلام ونقطة التوقف */

/* الزرار السابع في رئيسية المشرف («بلّغ عن مشكلة») بياخد السطر كله — 7 أزرار في عمودين. */
.s1-home__btn--wide {
  grid-column: 1 / -1;
  min-height: 96px;
}

/* «مستني استلام — ماتكملش»: نقطة توقف لسه ما اتستلمتش. */
.s1-hold {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--ty-radius-s);
  border-inline-start: 4px solid var(--ty-danger);
  background: var(--ty-bad-bg);
  color: var(--ty-bad-fg);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.s1-hold span {
  font-weight: 400;
}

/* «ارفض» و«استلم» جنب بعض في أسفل شاشة الفحص. */
.s1-screen__foot--two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* P4-ل · رصيد المخزن على التليفون: كل صنف بطاقة — الاسم في سطر والأرقام تحته كل رقم باسمه، فمفيش عمود برّه الشاشة. */
@media (max-width: 640px) {
  .s1-table--stack thead {
    display: none;
  }
  .s1-table--stack,
  .s1-table--stack tbody {
    display: block;
    width: 100%;
  }
  .s1-table--stack tr {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 12px;
    border-bottom: 1px solid var(--ty-line-soft);
  }
  .s1-table--stack tr:last-child {
    border-bottom: 0;
  }
  .s1-table--stack td,
  .s1-table--stack td:not(:first-child) {
    padding: 0;
    border: 0;
    min-width: 0;
    white-space: normal;
    font-size: 14px;
    color: var(--ty-text-2);
  }
  .s1-table--stack td:first-child {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 15px;
    color: var(--ty-text);
  }
  /* REVIEW-1103: عمود من غير عنوان (زرار «اطبع» في تقرير اليوم) ما يتكتبش قدّامه «: » لوحدها. */
  .s1-table--stack td[data-label]:not([data-label=""]):not(:first-child)::before {
    content: attr(data-label) ": ";
    color: var(--ty-text-3);
    font-size: 14px;
  }
}
