/* =====================================================================
   حاضر | HADER — نظام التصميم
   كحلي أساسي، أزرق للإشارة والتفاعل، أسطح باردة هادئة.
   ===================================================================== */
:root {
  --navy-950: #071830;
  --navy-900: #0E2A52;
  --navy-800: #16396A;
  --navy-700: #24508A;
  --blue-500: #2F7BF5;
  --blue-400: #3D8BFF;
  --blue-50:  #EAF2FF;
  --ink:      #14243B;
  --muted:    #5A6A80;
  --faint:    #8A97A8;
  --line:     #DCE3EC;
  --line-soft:#E9EEF4;
  --surface:  #F3F6FA;
  --paper:    #FFFFFF;
  --ok:       #12805C;
  --ok-bg:    #E5F5EE;
  --warn:     #9A5B00;
  --warn-bg:  #FFF3DD;
  --bad:      #B8322A;
  --bad-bg:   #FDECEA;

  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "DejaVu Sans", sans-serif;
  --fs-xs: .8125rem;   /* 13 */
  --fs-sm: .875rem;    /* 14 */
  --fs-md: 1rem;       /* 16 */
  --fs-lg: 1.1875rem;  /* 19 */
  --fs-xl: 1.5rem;     /* 24 */
  --fs-2xl: 2rem;      /* 32 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --focus: 0 0 0 3px rgba(47, 123, 245, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
}
img { max-width: 100%; display: block; }
a { color: var(--blue-500); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 1rem; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: 0 1.1rem;
  font: inherit; font-size: var(--fs-sm); font-weight: 600;
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-800); }
.btn-accent { background: var(--blue-500); color: #fff; }
.btn-accent:hover { background: #1F6BE6; }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--faint); }
.btn-danger { background: var(--paper); color: var(--bad); border-color: #EBC4C0; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:disabled { background: var(--line); color: var(--faint); cursor: not-allowed; }
.btn-lg { min-height: 52px; font-size: var(--fs-md); }
.btn-link { background: none; border: 0; padding: 0; color: var(--blue-500); font: inherit; cursor: pointer; }

/* ---------- النماذج ---------- */
.field { margin-bottom: 1.1rem; }
.field label, .label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: .35rem; }
.hint { font-size: var(--fs-xs); color: var(--muted); margin: .3rem 0 0; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: .55rem .8rem;
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue-500); box-shadow: var(--focus); }
.input.is-invalid { border-color: var(--bad); }
.input-ltr { direction: ltr; text-align: left; }
.field-error { color: var(--bad); font-size: var(--fs-xs); margin: .35rem 0 0; }
.input-affix { display: flex; align-items: stretch; direction: ltr; }
.input-affix .affix {
  display: flex; align-items: center; padding: 0 .75rem; font-size: var(--fs-sm); color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-inline-end: 0; border-radius: var(--r-md) 0 0 var(--r-md);
}
.input-affix .input { border-radius: 0 var(--r-md) var(--r-md) 0; text-align: left; }
.field label.check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; font-weight: 400; font-size: var(--fs-md); }
.check input { width: 20px; height: 20px; margin-top: .2rem; accent-color: var(--blue-500); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- التنبيهات ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--r-md); margin-bottom: 1.25rem; font-size: var(--fs-sm); border: 1px solid; }
.alert-success { background: var(--ok-bg); border-color: #B9E3D1; color: #0B5A41; }
.alert-error { background: var(--bad-bg); border-color: #F3C9C5; color: #8A231D; }
.alert-info { background: var(--blue-50); border-color: #C8DBFB; color: var(--navy-800); }

/* ---------- الشارات ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .6rem; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: var(--line-soft); color: var(--muted); }

/* =====================================================================
   صفحات الدخول: لوح كحلي بقرص ساعة، والنموذج بجانبه
   ===================================================================== */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 5fr) 7fr;
}
.auth-panel {
  position: relative; overflow: hidden;
  background: var(--navy-900); color: #fff;
  padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-dial {
  position: absolute; inset-inline-end: -46%; top: 50%; transform: translateY(-50%);
  width: 105%; max-width: 640px; aspect-ratio: 1; pointer-events: none;
}
.auth-brand { position: relative; display: flex; align-items: center; gap: .85rem; }
.auth-brand img { width: 52px; height: 52px; border-radius: 12px; background: #fff; object-fit: contain; }
.auth-brand .mark { width: 52px; height: 52px; }
.auth-brand strong { font-size: var(--fs-lg); display: block; line-height: 1.25; }
.auth-brand span { font-size: var(--fs-sm); color: #AFC3DE; }
.auth-panel-foot { position: relative; font-size: var(--fs-sm); color: #AFC3DE; max-width: 34ch; }
.auth-panel-foot b { display: block; font-size: var(--fs-2xl); color: #fff; font-weight: 700; line-height: 1.2; margin-bottom: .5rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--paper); }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: var(--fs-xl); margin-bottom: .25rem; }
.auth-form > p.muted { margin-bottom: 1.75rem; }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 1.5rem;
}
.segmented input { position: absolute; opacity: 0; }
.segmented label {
  display: flex; align-items: center; justify-content: center; min-height: 40px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted); border-radius: 7px; cursor: pointer;
}
.segmented input:checked + label { background: var(--paper); color: var(--navy-900); box-shadow: 0 1px 2px rgba(14, 42, 82, .12), 0 0 0 1px var(--line); }
.segmented input:focus-visible + label { box-shadow: var(--focus); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-panel { padding: 1.5rem 1.25rem 1.75rem; min-height: 0; }
  .auth-dial { width: 260px; inset-inline-end: -170px; top: 50%; opacity: .5; }
  .auth-panel-foot { display: none; }
  .auth-main { align-items: flex-start; padding-top: 2rem; }
}

/* =====================================================================
   لوحات الإدارة: شريط جانبي كحلي يمينًا، ومحتوى على سطح فاتح
   ===================================================================== */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--navy-900); color: #DCE6F4;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-head { display: flex; align-items: center; gap: .7rem; padding: 1.25rem 1.25rem 1rem; }
.sidebar-head img, .sidebar-head .mark { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.sidebar-head img.org-logo { background: #fff; object-fit: contain; padding: 3px; }
.sidebar-head strong { display: block; color: #fff; font-size: var(--fs-md); line-height: 1.3; }
.sidebar-head span { font-size: var(--fs-xs); color: #93A9C8; }
.nav { list-style: none; margin: .5rem 0 0; padding: 0 .75rem; flex: 1; }
.nav a, .nav .soon {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; margin-bottom: 2px;
  border-radius: var(--r-md); color: #DCE6F4; font-size: var(--fs-sm); font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--navy-800); color: #fff; box-shadow: inset -3px 0 0 var(--blue-400); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .soon { color: #6F87A8; cursor: default; }
.nav .soon em { font-style: normal; font-size: 11px; margin-inline-start: auto; color: #6F87A8; }
.nav-group { font-size: 11px; color: #6F87A8; padding: 1rem .75rem .35rem; }
.sidebar-foot { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: var(--fs-sm); }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.sidebar-foot .role { color: #93A9C8; font-size: var(--fs-xs); margin-bottom: .6rem; }
.sidebar-foot form { display: inline; }
.sidebar-foot .btn-link { color: #A9C4EE; font-size: var(--fs-sm); }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.5rem 2.25rem 0;
}
.topbar h1 { margin: 0; }
.topbar .crumbs { font-size: var(--fs-sm); color: var(--muted); margin-bottom: .15rem; }
.content { padding: 1.5rem 2.25rem 3rem; max-width: 1180px; }
.menu-toggle { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 272px; z-index: 30; transform: translateX(100%); transition: transform .2s ease; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(7, 24, 48, .45); z-index: 20; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 1rem 1.1rem 0; }
  .content { padding: 1rem 1.1rem 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- الأقسام ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 1.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: var(--fs-md); }
.panel-body { padding: 1.4rem; }
.panel-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--line-soft); display: flex; gap: .75rem; justify-content: flex-start; }
.section-split { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; padding: 1.6rem 1.4rem; border-bottom: 1px solid var(--line-soft); }
.section-split:last-of-type { border-bottom: 0; }
.section-split h2 { font-size: var(--fs-md); margin-bottom: .25rem; }
.section-split .muted { font-size: var(--fs-sm); }
@media (max-width: 860px) { .section-split { grid-template-columns: 1fr; gap: 1rem; } }

/* شريط الأرقام: صف واحد مقسوم بخطوط، وليس بطاقات منفصلة */
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 1.5rem; }
.ledger > div { padding: 1.1rem 1.4rem; border-inline-start: 1px solid var(--line-soft); }
.ledger > div:first-child { border-inline-start: 0; }
.ledger dt { font-size: var(--fs-sm); color: var(--muted); }
.ledger dd { margin: .15rem 0 0; font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--navy-900); }
.ledger dd small { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
@media (max-width: 640px) {
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger > div:nth-child(2n+1) { border-inline-start: 0; }
  .ledger > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}

/* ---------- الجداول ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: start; font-weight: 600; color: var(--muted); padding: .7rem 1.4rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFD; }
.table td { padding: .85rem 1.4rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td a.row-title { color: var(--ink); font-weight: 600; }
.empty { padding: 2.5rem 1.4rem; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: .25rem; }

.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .input { max-width: 280px; }
.toolbar select.input { max-width: 180px; }

/* قائمة خطوات التجهيز */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: .85rem; padding: .85rem 1.4rem; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.steps li:last-child { border-bottom: 0; }
.steps .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.steps li.done .tick { background: var(--ok); border-color: var(--ok); }
.steps li.done .tick::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translateY(-1px); }
.steps li.done span.t { color: var(--muted); }
.steps .later { margin-inline-start: auto; font-size: var(--fs-xs); color: var(--faint); }
.steps a { margin-inline-start: auto; font-weight: 600; }

/* بطاقة بيانات الدخول المؤقتة: تظهر مرة واحدة */
.credentials { border: 1px dashed var(--blue-500); background: var(--blue-50); border-radius: var(--r-lg); padding: 1.1rem 1.4rem; margin-bottom: 1.5rem; }
.credentials dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: .75rem 0 0; font-size: var(--fs-sm); }
.credentials dt { color: var(--muted); }
.credentials dd { margin: 0; font-weight: 600; }
.credentials code { font-size: 1.05rem; letter-spacing: .04em; background: #fff; padding: .1rem .5rem; border-radius: var(--r-sm); border: 1px solid #C8DBFB; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.logo-preview { width: 112px; height: 112px; border: 1px solid var(--line); border-radius: var(--r-lg); display: grid; place-items: center; background: var(--surface); overflow: hidden; }
.logo-preview img { max-width: 88%; max-height: 88%; object-fit: contain; }
.logo-row { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }

.danger-zone { border-color: #F0CFCB; }

/* =====================================================================
   واجهة الموظف: عمود واحد للجوال
   ===================================================================== */
.emp { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.emp-head { background: var(--navy-900); color: #fff; padding: 1.1rem 1.25rem 4.5rem; position: relative; overflow: hidden; }
.emp-head .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: relative; }
.emp-head .org { display: flex; align-items: center; gap: .6rem; font-size: var(--fs-sm); color: #C5D4EA; }
.emp-head .org img, .emp-head .org .mark { width: 34px; height: 34px; border-radius: 9px; background: #fff; object-fit: contain; }
.emp-head .hello { margin-top: 1.5rem; position: relative; }
.emp-head .hello h1 { font-size: var(--fs-xl); color: #fff; margin: 0; }
.emp-head .hello p { margin: .2rem 0 0; color: #AFC3DE; font-size: var(--fs-sm); }
.emp-head .btn-link { color: #A9C4EE; font-size: var(--fs-sm); }
.emp-body { padding: 0 1rem 2rem; margin-top: -3rem; position: relative; flex: 1; }
.clock-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem 1.25rem; text-align: center; box-shadow: 0 10px 30px -18px rgba(14, 42, 82, .35); }
.clock-card .time { font-size: 3rem; font-weight: 700; color: var(--navy-900); line-height: 1.1; font-variant-numeric: tabular-nums; direction: ltr; }
.clock-card .date { color: var(--muted); font-size: var(--fs-sm); margin-top: .25rem; }
.clock-card .status { margin: 1.25rem 0; }
.emp-list { margin-top: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.emp-list > div { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.emp-list > div:last-child { border-bottom: 0; }

/* ---------- الصفحة العامة والأخطاء ---------- */
.plain-center { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.25rem; text-align: center; }
.plain-center .box { max-width: 460px; }
.plain-center .code { font-size: 4rem; font-weight: 700; color: var(--navy-900); line-height: 1; margin-bottom: .75rem; font-variant-numeric: tabular-nums; }
.plain-center img.mark { width: 64px; height: 64px; margin: 0 auto 1.25rem; }

fieldset.segmented { margin: 0 0 1.5rem; min-width: 0; }
.mt { margin-top: 1.25rem; }
.topbar-actions { display: flex; gap: .75rem; align-items: center; }

/* ---------- المرحلة 2 ---------- */
fieldset.field { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: .35rem; }
.segmented-3 { grid-template-columns: repeat(3, 1fr); }
.ledger dd.ledger-text { font-size: var(--fs-lg); padding-top: .35rem; }
.history { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.history li { padding: .6rem 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.history-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.table tr.is-today td { background: var(--blue-50); }
.topbar-actions.wrap { flex-wrap: wrap; align-content: flex-start; }
.pre { white-space: pre-line; margin: 0; }

/* شبكة أيام الأسبوع في جدول الدوام */
.week-grid { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.week-grid th { text-align: start; color: var(--muted); font-weight: 600; padding: .5rem .5rem; border-bottom: 1px solid var(--line); }
.week-grid td { padding: .45rem .5rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.week-grid tr:last-child td { border-bottom: 0; }
.week-grid .day { display: flex; align-items: center; gap: .6rem; font-weight: 600; white-space: nowrap; }
.week-grid .day input { width: 20px; height: 20px; accent-color: var(--blue-500); }
.week-grid .input { min-height: 40px; padding: .35rem .6rem; max-width: 150px; }
.week-grid tr.is-off .input { opacity: .4; }
.week-grid .field-error { margin: 0; }

/* عرض الفترة: سبعة أيام في صف */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line-soft); }
.week-strip > div { padding: .8rem .6rem; border-inline-start: 1px solid var(--line-soft); text-align: center; font-size: var(--fs-xs); }
.week-strip > div:first-child { border-inline-start: 0; }
.week-strip .d { color: var(--muted); font-weight: 600; margin-bottom: .3rem; }
.week-strip .t { font-weight: 600; color: var(--navy-900); font-size: var(--fs-sm); line-height: 1.45; }
.week-strip .off { color: var(--faint); }
.week-strip .night { display: block; color: var(--warn); font-size: 11px; margin-top: .2rem; }
.period-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.4rem; }
.period-head h3 { margin: 0; }
.period { border-top: 1px solid var(--line-soft); }
.period.is-current { background: linear-gradient(to left, var(--blue-50), transparent 40%); }
@media (max-width: 760px) {
  .week-strip { grid-template-columns: repeat(4, 1fr); }
  .week-strip > div:nth-child(4n+1) { border-inline-start: 0; }
  .week-strip > div:nth-child(n+5) { border-top: 1px solid var(--line-soft); }
}
.emp-section { font-size: var(--fs-md); margin: 1.5rem .25rem .6rem; color: var(--navy-900); }

/* ---------- المرحلة 3 ---------- */
.mt-s { margin-top: .4rem; }
.geo-status:empty { display: none; }
.missed { text-align: start; border-top: 1px solid var(--line-soft); padding-top: 1rem; }
.missed-title { font-weight: 700; color: var(--warn); margin-bottom: .25rem; }
.done-day { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.done-day > div { padding: .75rem .5rem; display: flex; flex-direction: column; gap: .1rem; border-inline-start: 1px solid var(--line-soft); }
.done-day > div:first-child { border-inline-start: 0; }
.done-day strong { font-size: var(--fs-lg); color: var(--navy-900); }
.month-nav { display: flex; align-items: center; justify-content: space-between; padding: 1rem; }
.emp-list > .att-row { align-items: flex-start; }
.att-side { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }

/* لوحة الحضور اليومية */
.date-nav { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.date-nav .input { max-width: 180px; }
.cell-sub { display: block; font-size: var(--fs-xs); color: var(--muted); }
.flag { color: var(--warn); font-weight: 600; }
.map-link { font-size: var(--fs-xs); }
.review-card { border-top: 1px solid var(--line-soft); padding: 1.1rem 1.4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.review-card:first-of-type { border-top: 0; }
@media (max-width: 860px) { .review-card { grid-template-columns: 1fr; } }
.quote { background: var(--surface); border-radius: var(--r-md); padding: .6rem .8rem; font-size: var(--fs-sm); margin: .5rem 0 0; }

/* ---------- المرحلة 4 ---------- */
.nav-badge { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 .45rem; border-radius: 999px; background: var(--blue-400); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.emp-body { padding-bottom: 5.5rem; }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper); border-top: 1px solid var(--line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); z-index: 10; }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .3rem 0; color: var(--muted); font-size: 11.5px; font-weight: 600; border-radius: var(--r-sm); }
.tabbar a:hover { text-decoration: none; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--navy-900); }
.tabbar a[aria-current="page"] svg { color: var(--blue-500); }
.tab-badge { position: absolute; top: 0; inset-inline-start: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 .3rem; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; }
.big-balance { display: flex; align-items: baseline; justify-content: center; gap: .4rem; }
.big-balance b { font-size: 3rem; color: var(--navy-900); line-height: 1.1; font-variant-numeric: tabular-nums; }
.req-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.req-row form { display: inline; }
.notif { display: flex; gap: .8rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.notif:last-child { border-bottom: 0; }
.notif:hover { text-decoration: none; background: var(--surface); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: .55rem; flex: none; }
.notif.unread .dot { background: var(--blue-500); }
.notif strong { display: block; font-size: var(--fs-sm); }
.notif p { margin: .1rem 0 0; font-size: var(--fs-sm); color: var(--muted); }
.notif time { font-size: var(--fs-xs); color: var(--faint); }
.decision { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.decision .input { max-width: 260px; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.type-grid input { position: absolute; opacity: 0; }
.type-grid label { border: 1px solid var(--line); border-radius: var(--r-md); padding: .7rem .8rem; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; text-align: center; }
.type-grid input:checked + label { border-color: var(--blue-500); background: var(--blue-50); color: var(--navy-900); box-shadow: 0 0 0 1px var(--blue-500); }
.type-grid input:focus-visible + label { box-shadow: var(--focus); }
[data-show-for].is-hidden { display: none; }
.form-start { text-align: start; border-top: 0; padding-top: 0; }
.emp-list-flat { padding: 0; }
.emp-list > .notif { display: flex; justify-content: flex-start; align-items: flex-start; }

/* ---------- المرحلة 5 ---------- */
.report-hub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.report-hub .panel { margin: 0; }
@media (max-width: 1100px) { .report-hub { grid-template-columns: 1fr; } }
.table-report td, .table-report th { padding-inline: .9rem; }

/* التقويم */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { font-size: var(--fs-xs); color: var(--muted); text-align: center; padding: .3rem 0; font-weight: 600; }
.cal-cell { position: relative; min-height: 76px; border-radius: 8px; padding: .35rem .4rem; background: var(--surface); display: flex; flex-direction: column; gap: .1rem; text-align: start; border: 1px solid transparent; }
.cal-blank { background: transparent; }
.cal-n { font-weight: 700; font-size: var(--fs-sm); color: var(--ink); }
.cal-s { font-size: 11px; font-weight: 600; line-height: 1.3; }
.cal-t { font-size: 10.5px; color: var(--muted); direction: ltr; text-align: right; }
.cal-present { background: var(--ok-bg); } .cal-present .cal-s { color: var(--ok); }
.cal-late { background: var(--warn-bg); } .cal-late .cal-s { color: var(--warn); }
.cal-absent { background: var(--bad-bg); } .cal-absent .cal-s { color: var(--bad); }
.cal-leave, .cal-excused, .cal-day_off { background: var(--blue-50); } .cal-leave .cal-s, .cal-excused .cal-s, .cal-day_off .cal-s { color: var(--navy-700); }
.cal-rest, .cal-no_schedule, .cal-not_employed { background: #F7F8FA; } .cal-rest .cal-s { color: var(--faint); }
.cal-upcoming, .cal-not_yet { background: var(--paper); border-color: var(--line); } .cal-upcoming .cal-s, .cal-not_yet .cal-s { color: var(--muted); }
.cal-cell.is-today { border: 2px solid var(--blue-500); }
.cal-dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 0; margin: .9rem 0 0; font-size: var(--fs-xs); color: var(--muted); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: .35rem; vertical-align: -2px; }
.cal-card { padding: 1rem .75rem; }
.cal-card .cal-cell { min-height: 58px; padding: .25rem; }
.cal-card .cal-t { display: none; }
.cal-summary { margin: 1rem 0 0; }
.seg-links { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 1rem; position: relative; }
.seg-links a { text-align: center; padding: .5rem; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); }
.seg-links a:hover { text-decoration: none; }
.seg-links a.is-active { background: var(--navy-900); color: #fff; }
.table.team td, .table.team th { padding: .6rem .7rem; text-align: center; }
.table.team td:first-child, .table.team th:first-child { text-align: start; }
.team-cell { display: table-cell; }
.team-cell .badge { margin-top: .25rem; }
.table.team th.is-today, .table.team td.is-today { background: var(--blue-50); }
.team-cell span.num { display: block; }

/* =====================================================================
   الموقع العام: صفحة الدليل /hader
   صفحة قراءة طويلة: عمود نص واحد بعرض مريح، وشريط زمني ليوم الموظف هو العنصر المميز.
   ===================================================================== */
a.auth-brand, a.auth-brand:hover { color: inherit; text-decoration: none; }
.auth-alt { display: flex; gap: 1.25rem; margin-top: 1.25rem; }

.site-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

.site-bar { position: sticky; top: 0; z-index: 20; background: var(--navy-950); }
.site-bar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.site-logo { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: var(--fs-lg); }
.site-logo:hover { text-decoration: none; }
.site-login { display: flex; gap: .5rem; }
.site-btn-light { background: #fff; color: var(--navy-900); }
.site-btn-light:hover { background: var(--blue-50); }
.site-btn-line { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.site-btn-line:hover { border-color: #fff; }

.site-hero { position: relative; overflow: hidden; background: var(--navy-900); color: #fff; padding: 4.5rem 0 5rem; }
.site-hero .auth-dial { inset-inline-end: -4%; width: 560px; max-width: none; }
.site-hero-in { position: relative; }
.site-hero h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); line-height: 1.2; max-width: 16ch; margin-bottom: 1.25rem; letter-spacing: -.01em; }
.site-lead { font-size: var(--fs-lg); line-height: 1.8; color: #C9D7EA; max-width: 52ch; margin: 0 0 2rem; }
.site-hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* حركة واحدة عند فتح الصفحة: قوس بداية الدوام يُرسم على القرص */
.site-hero .auth-dial path { stroke-dasharray: 200; stroke-dashoffset: 200; animation: site-arc 1.4s .3s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes site-arc { to { stroke-dashoffset: 0; } }

.site-toc { position: sticky; top: 64px; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-toc .site-wrap { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.site-toc .site-wrap::-webkit-scrollbar { display: none; }
.site-toc a { flex: none; padding: .9rem .75rem; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; border-bottom: 2px solid transparent; }
.site-toc a:hover { color: var(--navy-900); text-decoration: none; border-bottom-color: var(--blue-500); }

.site-main { background: var(--paper); }
.site-sec { padding: 4rem 0; scroll-margin-top: 112px; }
.site-sec-tint { background: var(--surface); }
.site-sec h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .4rem; }
.site-intro { color: var(--muted); font-size: var(--fs-lg); margin: 0 0 2rem; max-width: 60ch; }
.site-text, .site-note, .site-example { max-width: 68ch; line-height: 1.9; }
.site-note { color: var(--muted); font-size: var(--fs-sm); margin: 1rem 0 2.5rem; }
.site-example { margin: 2rem 0 0; padding: 1rem 1.25rem; background: var(--blue-50); border-inline-start: 3px solid var(--blue-500); border-radius: 0 var(--r-md) var(--r-md) 0; }
.site-code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .92em; background: var(--line-soft); padding: 0 .35rem; border-radius: 4px; }
.site-hero .site-code { background: rgba(255, 255, 255, .1); }

/* خطوات البدء: تسلسل حقيقي، لذلك مرقّمة */
.site-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 1.75rem; max-width: 760px; }
.site-steps li { counter-increment: step; position: relative; padding-inline-start: 3.5rem; }
.site-steps li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: -.1rem;
  width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy-900); color: #fff; font-weight: 700;
}
.site-steps h3 { font-size: var(--fs-lg); margin-bottom: .25rem; }
.site-steps p { margin: 0; color: var(--muted); line-height: 1.85; max-width: 62ch; }

/* الشريط الزمني ليوم الموظف */
.site-rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.site-rail::before { content: ""; position: absolute; top: 2.55rem; inset-inline-start: 8px; inset-inline-end: calc(20% - 8px); height: 4px; border-radius: 2px;
  background: linear-gradient(to left, var(--line) 0 25%, var(--blue-500) 25% 75%, var(--line) 75%); }
.site-rail li { position: relative; padding-inline-end: 1rem; display: flex; flex-direction: column; gap: .2rem; }
.site-rail time { font-weight: 700; font-size: var(--fs-md); color: var(--navy-900); direction: rtl; height: 1.9rem; }
.site-rail li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 4px solid var(--line); margin: .3rem 0 .9rem; position: relative; }
.site-rail .rail-start::before, .site-rail .rail-end::before { border-color: var(--blue-500); }
.site-rail .rail-mid::before { border-color: var(--blue-500); background: var(--blue-500); width: 10px; height: 10px; border-width: 0; margin: .55rem 3px 1.025rem; }
.site-rail .rail-close::before { border-color: var(--warn); }
.site-rail strong { font-size: var(--fs-md); }
.site-rail span { color: var(--muted); font-size: var(--fs-sm); line-height: 1.7; }
.site-rail li { order: 0; }
.site-rail time { order: -1; }

/* حقائق: مصطلح وشرحه */
.site-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; }
.site-facts > div { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.site-facts dt { font-weight: 700; margin-bottom: .35rem; color: var(--navy-900); }
.site-facts dd { margin: 0; color: var(--muted); line-height: 1.85; }
.site-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .75rem; }
.site-legend .cal-cell { min-height: 0; padding: .3rem .6rem; }
.site-legend .cal-s { font-size: var(--fs-xs); }

.site-kinds { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.site-kinds li { padding: .55rem 1rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-weight: 600; color: var(--navy-900); }

.site-checks { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; max-width: 70ch; }
.site-checks li { position: relative; padding-inline-start: 2rem; line-height: 1.85; }
.site-checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45rem; width: 1.1rem; height: .6rem;
  border-inline-start: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg) scaleX(-1); }

.site-faq { max-width: 760px; border-top: 1px solid var(--line); }
.site-faq details { border-bottom: 1px solid var(--line); }
.site-faq summary { cursor: pointer; padding: 1.1rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.site-faq summary::-webkit-details-marker { display: none; }
.site-faq summary::after { content: "+"; color: var(--blue-500); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.site-faq details[open] summary::after { transform: rotate(45deg); }
.site-faq summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.site-faq details p { margin: 0 0 1.25rem; color: var(--muted); line-height: 1.85; max-width: 64ch; }

.site-foot { background: var(--navy-950); color: #C9D7EA; padding-top: 3rem; }
.site-foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding-bottom: 2.5rem; }
.site-foot strong { color: #fff; font-size: var(--fs-xl); display: block; margin-bottom: .25rem; }
.site-foot p { margin: 0; }
.site-foot-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.site-foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; padding-bottom: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: var(--fs-sm); }
.site-foot-nav { display: flex; gap: 1.25rem; }
.site-foot a:not(.btn) { color: #fff; }

.site-bar .btn:focus-visible, .site-hero .btn:focus-visible, .site-foot .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 860px) {
  .site-hero { padding: 3rem 0 3.5rem; }
  .site-hero .auth-dial { width: 340px; inset-inline-end: -170px; top: 26%; opacity: .45; }
  .site-facts { grid-template-columns: 1fr; }
  .site-rail { grid-template-columns: 1fr; gap: 0; padding-inline-start: 1.75rem; }
  .site-rail::before { top: .6rem; bottom: .6rem; inset-inline-start: 6px; inset-inline-end: auto; width: 4px; height: auto;
    background: linear-gradient(to bottom, var(--line) 0 20%, var(--blue-500) 20% 62%, var(--line) 62%); }
  .site-rail li { padding: 0 0 1.5rem; }
  .site-rail li::before { position: absolute; inset-inline-start: calc(-1.75rem); top: .15rem; margin: 0; }
  .site-rail .rail-mid::before { inset-inline-start: calc(-1.75rem + 3px); top: .45rem; margin: 0; }
  .site-rail time { height: auto; }
  .site-sec { padding: 3rem 0; }
}
@media (max-width: 520px) {
  .site-logo span { display: none; }
  .site-login .btn { padding-inline: .8rem; font-size: var(--fs-sm); min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-hero .auth-dial path { animation: none; stroke-dashoffset: 0; }
  .site-faq summary::after { transition: none; }
}
