/* ==========================================================================
   ميقات — واجهة الموظف
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 6px 18px -6px rgba(47, 140, 255, 0.7);
}
.brand b {
  display: block;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.3;
}
.top-actions {
  display: flex;
  gap: 8px;
}

.emp {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--safe-b) + 112px);
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.view-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  margin: 6px 2px 16px;
}

/* ---------- الترحيب ---------- */
.hero {
  padding: 6px 4px 14px;
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero h1 {
  font-size: 27px;
  line-height: 1.35;
  font-weight: 600;
}
.hero .date {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
}
.hero-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ---------- بطاقة البصمة ---------- */
.punch-card {
  position: relative;
  text-align: center;
  padding: 20px 16px 22px;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.punch-card::before {
  content: '';
  position: absolute;
  inset: -30% -10% auto;
  height: 70%;
  background: radial-gradient(closest-side, rgba(47, 140, 255, 0.28), transparent);
  pointer-events: none;
}
.clock,
.clock.num {
  display: block;
  position: relative;
  font-size: 46px;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.clock small {
  font-size: 16px;
  color: var(--muted);
  margin-inline-start: 6px;
}
.win-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
}
.win-pill.open {
  background: rgba(52, 211, 153, 0.13);
  color: var(--ok);
}
.win-pill.closed {
  background: rgba(251, 191, 36, 0.13);
  color: var(--warn);
}
.win-pill.off {
  background: var(--surface-2);
  color: var(--muted);
}

.punch-wrap {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 14px auto 4px;
  display: grid;
  place-items: center;
}
.rings i {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(77, 155, 255, 0.5);
  animation: ring 3.2s ease-out infinite;
}
.rings i:nth-child(2) {
  animation-delay: 1.05s;
}
.rings i:nth-child(3) {
  animation-delay: 2.1s;
}
.punch-wrap.busy .rings i,
.punch-wrap.ok .rings i,
.punch-wrap.bad .rings i {
  animation-play-state: paused;
  opacity: 0;
}
.ring-prog {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.ring-prog circle {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
}
.ring-prog .track {
  stroke: var(--line);
}
.ring-prog .bar {
  stroke: url(#pg);
  stroke-dasharray: 90 700;
  opacity: 0;
  transform-origin: center;
}
.punch-wrap.busy .ring-prog .bar {
  opacity: 1;
  animation: spin 1.1s linear infinite;
}
.punch {
  position: relative;
  z-index: 2;
  width: 164px;
  height: 164px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  color: #fff;
  display: grid;
  place-items: center;
  background: var(--grad);
  box-shadow:
    0 26px 60px -14px rgba(47, 140, 255, 0.85),
    0 0 0 8px rgba(77, 155, 255, 0.1),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -10px 24px rgba(20, 30, 120, 0.35);
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.3s,
    background 0.4s;
}
.punch .ic {
  filter: drop-shadow(0 4px 10px rgba(10, 30, 120, 0.5));
  transition: transform 0.3s var(--ease);
}
.punch:active {
  transform: scale(0.94);
}
.punch:hover .ic {
  transform: scale(1.06);
}
.punch[data-kind='out'] {
  background: linear-gradient(135deg, #a78bfa 0%, #6d6bff 50%, #3b5bff 100%);
}
.punch[disabled] {
  cursor: default;
}
.punch[data-state='busy'] {
  animation: floaty 2s ease-in-out infinite;
}
.punch[data-state='ok'] {
  background: linear-gradient(135deg, #34d399, #12b886);
  box-shadow:
    0 26px 60px -14px rgba(18, 184, 134, 0.85),
    0 0 0 8px rgba(52, 211, 153, 0.14),
    inset 0 3px 0 rgba(255, 255, 255, 0.4);
}
.punch[data-state='bad'] {
  background: linear-gradient(135deg, #fb7185, #e0405a);
  box-shadow:
    0 26px 60px -14px rgba(224, 64, 90, 0.8),
    0 0 0 8px rgba(251, 113, 133, 0.14);
  animation: shake 0.5s;
}
.punch .done {
  animation: pop 0.45s var(--ease) both;
}
.punch-label {
  position: relative;
  font-size: 16px;
  font-weight: 500;
  min-height: 30px;
}
.punch-sub {
  position: relative;
  font-size: 13px;
  color: var(--muted);
  min-height: 22px;
  margin-top: 2px;
}
.steps {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 6px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--faint);
  transition: color 0.3s;
}
.steps li::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-2);
  transition: all 0.3s;
}
.steps li:not(:last-child)::after {
  content: '';
  width: 26px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  margin-inline-start: 2px;
}
.steps li.on {
  color: var(--text);
}
.steps li.on::before {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(77, 155, 255, 0.25);
}
.steps li.done {
  color: var(--ok);
}
.steps li.done::before {
  background: var(--ok);
}
.steps li.err {
  color: var(--bad);
}
.steps li.err::before {
  background: var(--bad);
}

/* ---------- حركات اليوم ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}
.timeline li:not(:last-child)::after {
  content: '';
  position: absolute;
  inset-inline-start: 19px;
  top: 48px;
  bottom: -8px;
  width: 2px;
  background: var(--line);
}
.tl-ic {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tl-ic.in {
  background: rgba(52, 211, 153, 0.14);
  color: var(--ok);
}
.tl-ic.out {
  background: rgba(122, 162, 255, 0.16);
  color: var(--info);
}
.timeline b {
  font-weight: 500;
  display: block;
  line-height: 1.4;
}
.timeline small {
  color: var(--muted);
}
.timeline .t {
  margin-inline-start: auto;
  font-size: 17px;
  font-weight: 500;
}

/* ---------- معلومات الدوام ---------- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 14px;
}
.tile .ic {
  color: var(--brand);
  margin-bottom: 6px;
}
.tile small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.tile b {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.5;
}
.partners {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px auto 0;
  max-width: 100%;
  width: fit-content;
  background: #fff;
  border-radius: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.4);
}
.partners img {
  width: auto;
  max-width: 34%;
  object-fit: contain;
  flex: 0 1 auto;
  min-width: 0;
}
.partners i {
  width: 1px;
  align-self: stretch;
  background: #d8dfeb;
  flex: none;
}
.foot {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--faint);
}
.foot a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
}
.foot a:hover {
  background: var(--surface);
}

/* ---------- شريط التنقل السفلي ---------- */
.tabbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: 0 14px calc(var(--safe-b) + 12px);
  pointer-events: none;
}
.tabbar > div {
  pointer-events: auto;
  display: flex;
  gap: 4px;
  width: 100%;
  max-width: 420px;
  padding: 7px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  border: 0;
  background: none;
  border-radius: 18px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.tab.on {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(47, 140, 255, 0.9);
}
.tab:not(.on):active {
  transform: scale(0.93);
}

/* ---------- سجلّي ---------- */
.month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.month-bar b {
  font-size: 17px;
  font-weight: 600;
}
.sum-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.sum {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 4px;
  text-align: center;
}
.sum b {
  display: block;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
.sum span {
  font-size: 11.5px;
  color: var(--muted);
}
.sum.ok b {
  color: var(--ok);
}
.sum.warn b {
  color: var(--warn);
}
.sum.bad b {
  color: var(--bad);
}
.sum.info b {
  color: var(--info);
}
.day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.day {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
}
.day::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--faint);
}
.day.s-حاضر::before {
  background: var(--ok);
}
.day.s-متأخر::before {
  background: var(--warn);
}
.day.s-غائب::before {
  background: var(--bad);
}
.day.wk {
  opacity: 0.55;
}
.day .d {
  min-width: 74px;
}
.day .d b {
  display: block;
  font-weight: 500;
  font-size: 14px;
}
.day .d small {
  color: var(--muted);
  font-size: 12px;
}
.day .times {
  margin-inline-start: auto;
  text-align: end;
  font-size: 14px;
  line-height: 1.5;
}
.day .times small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- المساعدة والفحص ---------- */
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.check:first-of-type {
  border-top: 0;
}
.check .ci {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.check.ok .ci {
  background: rgba(52, 211, 153, 0.15);
  color: var(--ok);
}
.check.bad .ci {
  background: rgba(251, 113, 133, 0.15);
  color: var(--bad);
}
.check.warn .ci {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warn);
}
.check b {
  font-weight: 500;
  display: block;
  line-height: 1.4;
}
.check small {
  color: var(--muted);
  display: block;
  line-height: 1.5;
}
details.faq {
  border-top: 1px solid var(--line);
  padding: 2px 0;
}
details.faq:first-of-type {
  border-top: 0;
}
details.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 2px;
  font-weight: 500;
}
details.faq summary::-webkit-details-marker {
  display: none;
}
details.faq summary::after {
  content: '';
  width: 9px;
  height: 9px;
  border-inline-end: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.25s;
  margin-inline-end: 4px;
}
details.faq[open] summary::after {
  transform: rotate(-135deg);
}
details.faq p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
  padding: 0 2px 12px;
}

/* ---------- التفعيل ---------- */
.welcome {
  text-align: center;
  padding: 26px 6px 8px;
}
.welcome .logo {
  width: 104px;
  height: 104px;
  border-radius: 30px;
  box-shadow:
    0 22px 60px -14px rgba(47, 140, 255, 0.85),
    0 0 0 1px var(--line-2);
  animation: floaty 5s ease-in-out infinite;
}
.welcome h1 {
  font-size: 30px;
  margin: 18px 0 4px;
  font-weight: 700;
}
.welcome p {
  color: var(--muted);
  max-width: 340px;
  margin: 0 auto 6px;
}
.how {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}
.how div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
  text-align: start;
}
.how i {
  font-style: normal;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad-soft);
  border: 1px solid rgba(77, 155, 255, 0.35);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.notice.warn {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--warn);
}
.notice.bad {
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: var(--bad);
}
.notice.info {
  background: rgba(122, 162, 255, 0.1);
  border: 1px solid rgba(122, 162, 255, 0.3);
  color: var(--info);
}
.notice .ic {
  margin-top: 3px;
}

@media (max-width: 360px) {
  .punch-wrap {
    width: 224px;
    height: 224px;
  }
  .punch {
    width: 146px;
    height: 146px;
  }
  .clock {
    font-size: 40px;
  }
  .hero h1 {
    font-size: 24px;
  }
}

/* ---------- الطلبات (1.0.3) ---------- */
.req-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.req-card {
  display: flex;
  gap: 13px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.req-ic {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--grad-soft);
  color: var(--brand);
}
.req-ic.approved {
  background: rgba(52, 211, 153, 0.14);
  color: var(--ok);
}
.req-ic.rejected {
  background: rgba(251, 113, 133, 0.14);
  color: var(--bad);
}
.req-ic.cancelled {
  background: var(--surface-2);
  color: var(--faint);
}
.req-ic.pending {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warn);
}
.req-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.req-top b {
  font-weight: 600;
}
.req-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 2px;
}
.pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: start;
  padding: 16px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.pick:hover,
.pick:active {
  border-color: rgba(77, 155, 255, 0.6);
  background: var(--grad-soft);
  transform: translateY(-2px);
}
.pick .ic {
  color: var(--brand);
}
.pick b {
  font-size: 16px;
  font-weight: 600;
}
.pick small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.seg.stretch {
  display: flex;
  width: 100%;
}
.seg.stretch button {
  flex: 1;
  padding: 10px 4px;
  font-size: 13px;
}
.day.s-إجازة::before,
.day.s-مأمورية::before {
  background: var(--info);
}
.day.s-عطلة::before {
  background: var(--faint);
}
.day.s-عطلة {
  opacity: 0.7;
}
.sum-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.stat-chip b {
  color: var(--text);
  font-size: 16px;
}
a.notice {
  color: var(--warn);
}

/* ---------- 1.0.5: ورديتي ---------- */
.shift-now {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 12px;
}
.sdot {
  width: 12px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
}
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.wk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  min-width: 0;
  text-align: center;
}
.wk b {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.wk small {
  font-size: 10.5px;
  color: var(--muted);
}
.wk.off {
  opacity: 0.6;
}
.wk.today {
  border-color: rgba(77, 155, 255, 0.7);
  background: var(--grad-soft);
}
