/* بوابة مشتركي منزال كلين: تكمّل clean-worker.css بما تحتاجه شاشات المشترك
   (اختيار الوحدات، الخط الزمني للطلب، بطاقات المستحقات) بنفس الألوان. */

.topbar .who {
  font: 700 13px/1 inherit; color: var(--primary);
  background: var(--surface-container); padding: 6px 10px; border-radius: 999px;
}
.topbar .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface-container); color: var(--primary); margin-inline-start: 8px;
}

/* ---------------------------------------------------------- شاشة الدخول */
.login-page { background: var(--surface); }
.login-card { text-align: center; padding: 26px 20px; }
.login-card .brand { width: 150px; max-width: 60%; margin: 0 auto 14px; display: block; }
.login-card h1 { font-size: 21px; margin: 0 0 4px; }
.login-card .sub { margin-bottom: 16px; }
.login-card .hint { margin-top: 14px; font-size: 12.5px; color: var(--outline); }
.login-card .field { text-align: start; }
.login-home { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--outline); text-decoration: none; }
.login-home:hover { color: var(--on-surface, inherit); }

/* ---------------------------------------------------------- اختيار متعدد */
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pick-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 380px) { .pick-grid.three { grid-template-columns: repeat(2, 1fr); } }

.pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick .box {
  display: flex; flex-direction: column; gap: 3px; height: 100%;
  padding: 11px 12px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--outline-variant); background: #fff; transition: border-color .15s, background .15s;
}
.pick .box.center { align-items: center; text-align: center; }
.pick .box b { font-size: 14px; }
.pick .box small { font-size: 11.5px; color: var(--outline); }
.pick input:checked + .box {
  border-color: var(--primary); background: var(--surface-low);
  box-shadow: 0 2px 10px rgba(0, 104, 117, .12);
}
.pick input:focus-visible + .box { outline: 2px solid var(--primary); outline-offset: 2px; }
.pick .bubble {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; background: var(--surface-low); color: var(--primary);
}
.pick .bubble.ok { background: var(--ok-50); color: var(--ok-700); }
.pick .bubble.warn { background: var(--warn-50); color: var(--warn-800); }

/* ---------------------------------------------------------- خط الطلب الزمني */
.req-card .stepper { list-style: none; margin: 12px 0 6px; padding: 0; display: grid; gap: 10px; }
.req-card .stepper li { display: flex; gap: 10px; align-items: flex-start; }
.req-card .stepper li > span {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--outline-variant); color: #fff;
}
.req-card .stepper li.done > span { background: var(--primary); }
.req-card .stepper b { display: block; font-size: 13.5px; }
.req-card .stepper small { color: var(--outline); font-size: 12px; }

.info-card .steps { margin: 6px 0 0; padding-inline-start: 18px; display: grid; gap: 6px; }
.info-card .steps li { font-size: 13px; color: var(--on-surface); }

/* ---------------------------------------------------------- وحداتي */
.guest-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.guest-btns { display: flex; gap: 8px; }
.btn.small { width: auto; padding: 0 14px; height: 38px; font-size: 13.5px; }
/* زرّا حالة الضيف: الحالة المختارة مملوءة والأخرى فارغة - تُقرأ بلمحة */
.guest-btns .btn {
  background: #fff; color: var(--on-surface); box-shadow: none;
  border: 1.5px solid var(--outline-variant);
}
.guest-btns .btn.guest-left.on { background: var(--ok-600); border-color: var(--ok-600); color: #fff; }
.guest-btns .btn.guest-present.on { background: var(--warn-600); border-color: var(--warn-600); color: #fff; }

/* ---------------------------------------------------------- المستحقات */
.period-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.period-form .field { flex: 1; min-width: 130px; margin: 0; }

.total-card { text-align: center; }
.total-card .label { color: var(--outline); font-size: 13px; }
.total-card .total { display: block; font-size: 34px; font-weight: 800; color: var(--primary); margin: 4px 0 12px; }
.total-card .total small { font-size: 15px; font-weight: 600; color: var(--outline); }

.bill-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--outline-variant);
}
.bill-row:last-of-type { border-bottom: 0; }
.bill-row .amount { font-weight: 800; color: var(--primary); font-size: 16px; }

/* حقول البوابة: نفس شكل حقول شاشة العامل لكل الأنواع (كلمة مرور، تاريخ، قائمة) */
.field input[type="password"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field select {
  width: 100%;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  padding: 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--on-surface);
}
.field select { appearance: none; background-image: none; }
.login-page .shell { display: flex; flex-direction: column; justify-content: center; }

/* علامة الاختيار: البطاقة المختارة تُعرف بلمحة، لا باللون وحده */
.pick .box { position: relative; }
.pick input:checked + .box::after {
  content: "✓";
  position: absolute; inset-inline-end: 8px; inset-block-start: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
}
.pick .box.center { padding-top: 14px; }

/* ثلاثة مؤشرات في صف واحد داخل بطاقة الإجمالي */
.total-card .kpi-row { grid-template-columns: repeat(3, 1fr); }
.total-card .kpi small { font-size: 11px; }


/* ------------------------------------------------------------ التنبيهات */
/* التنبيه غير المقروء يُميَّز بحد جانبي لا بلون خلفية صارخ. */
.card.unread { border-inline-start: 3px solid var(--warn-600); }

/* ---------------------------------------------------------- سطر الحالة
   جملة واحدة أعلى بطاقة الطلب تقول للمشترك أين طلبه الآن، بلون يُقرأ قبل
   النص: رمادي ينتظر، أزرق موعد قادم، أخضر نابض جارٍ الآن، وأحمر تعذّر. */
.status-line {
  display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px;
  padding: 11px 13px; border-radius: 14px; border: 1.5px solid var(--outline-variant);
  background: var(--surface-low);
}
.status-line b { display: block; font-size: 14.5px; line-height: 1.45; }
.status-line small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--outline); }
.status-line .pulse { margin-top: 7px; }
.status-line.soon { border-color: rgba(0, 104, 117, .35); background: #e7f3f5; }
.status-line.soon b { color: #00525e; }
.status-line.live { border-color: var(--ok-600); background: var(--ok-50); color: var(--ok-700); }
.status-line.live b { color: var(--ok-700); }
.status-line.done { border-color: rgba(0, 104, 117, .25); background: var(--surface-low); }
.status-line.bad { border-color: rgba(186, 26, 26, .3); background: var(--error-container); }
.status-line.bad b, .status-line.bad small { color: #93000a; }
.req-card .moved-note { margin: 2px 0 0; font-size: 12.5px; }

/* ---------------------------------------------- شهر المشترك (التقويم)
   شبكة سبعة أعمدة تبدأ بالسبت. الخلية تحمل رقم اليوم ثم رموز الوحدات،
   ولونُ النقطة يقول الحالة: تمّ، مؤكَّد، أو بانتظار موعد. */
.month-nav { display: flex; gap: 8px; margin-bottom: 12px; }
.month-nav .btn { flex: 1; justify-content: center; font-size: 12.5px; padding: 9px 6px; }

.cal-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11.5px; font-weight: 600; color: var(--outline); margin-bottom: 10px;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal .dot, .cal-legend .dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none;
}
.dot.done { background: var(--ok-500); }
.dot.booked { background: var(--primary); }
.dot.waiting { background: #c78a00; }

table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.cal th {
  font-size: 10.5px; font-weight: 700; color: var(--outline);
  padding: 4px 2px; text-align: center;
}
table.cal td {
  border: 1px solid rgba(169, 238, 246, .5);
  vertical-align: top; padding: 4px 3px; height: 62px;
  font-size: 11px; background: #fff;
}
table.cal td.blank { background: transparent; border-color: transparent; }
table.cal td.is-past { background: var(--surface); }
table.cal td.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
table.cal .num { display: block; font-weight: 700; color: var(--outline); margin-bottom: 3px; }
table.cal td.is-today .num { color: var(--primary); }
table.cal .ev {
  display: flex; align-items: center; gap: 3px;
  font-weight: 600; color: var(--on-surface);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.6;
}
table.cal .ev.done { color: var(--ok-600); }
table.cal .ev.waiting { color: #8a6100; }

@media (min-width: 720px) {
  table.cal td { height: 86px; font-size: 12px; }
  .cal-legend { font-size: 12.5px; }
}

/* ------------------------------- رمز الوحدة وتعليماتها (شاشة وحداتي)
   مطويّة افتراضياً: تُكتب مرة واحدة، فلا تزاحم حالة الضيف كل يوم. */
.unit-notes { margin: 10px 0 2px; border-top: 1px solid rgba(169, 238, 246, .45); padding-top: 10px; }
.unit-notes > summary {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--primary); list-style: none;
}
.unit-notes > summary::-webkit-details-marker { display: none; }
.unit-notes > summary::after { content: "⌄"; margin-inline-start: auto; font-size: 15px; }
.unit-notes[open] > summary::after { content: "⌃"; }
.unit-notes form { margin-top: 10px; }
.unit-notes .field { margin-bottom: 10px; }
.unit-notes input, .unit-notes textarea { font-size: 14px; }
.unit-notes input[name="entry_code"] { font-weight: 700; letter-spacing: .08em; }

/* ------------------------------------------- تقييم التنظيف (طلباتي) */
.rate-row { padding: 10px 0; }
.rate-row + .rate-row { border-top: 1px solid rgba(169, 238, 246, .4); }
.rate-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.rate-who b { font-size: 15px; }
.rate-btns { display: flex; gap: 8px; }
.rate-btns .btn { flex: 1; justify-content: center; }
.btn.rate-good { background: var(--ok-50); color: var(--ok-600); border-color: var(--ok-200); }
.btn.rate-bad { background: #fff4f2; color: var(--error); border-color: #ffd9d3; }
.rate-note { margin-top: 10px; }
.rate-note label { display: block; font-size: 12px; font-weight: 600; color: var(--outline); margin-bottom: 5px; }
.rate-note textarea { width: 100%; margin-bottom: 8px; }
.rate-note .btn { width: 100%; justify-content: center; }
