/* ==========================================================
   فريق بشرى — نظام التصميم
   عاجي هادئ، مريمي، لافندر، خوخي. عناوين بخط النسخ، وواجهة بـ IBM Plex Sans Arabic.
   ========================================================== */

:root {
  --ivory: #F8F7F2;
  --card: #FFFFFF;
  --sage: #74977F;
  --sage-soft: #DCE8DE;
  --sage-ink: #3F5E49;        /* نص مريمي على خلفية فاتحة: تباين ≥ 4.5 */
  --on-sage: #10251A;         /* نص الأزرار على المريمي: تباين ≈ 5.2 */
  --lavender: #E9E3F3;
  --lavender-ink: #54477A;
  --peach: #F7E6DC;
  --peach-ink: #8A4B2C;
  --ink: #262B28;
  --ink-2: #545B56;
  --ink-3: #6E746F;
  --line: #E6E3D8;
  --line-strong: #D5D1C3;
  --danger: #A43D3D;
  --danger-soft: #F6E1DF;
  --warn: #8A5A12;
  --warn-soft: #F8EBD3;

  --accent: var(--sage);
  --accent-soft: var(--sage-soft);
  --accent-ink: var(--sage-ink);
  --on-accent: var(--on-sage);
  --bg: var(--ivory);
  --surface: var(--card);
  --surface-2: #FBFAF6;

  --font-ui: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --font-display: 'Noto Naskh Arabic', 'IBM Plex Sans Arabic', 'Times New Roman', serif;

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;

  --accent-2: #E39E78;
  --accent-3: #9C8CC4;
  --chart-1: #74977F; --chart-2: #E39E78; --chart-3: #9C8CC4; --chart-4: #C9B27A;
  --logo-main: #74977F; --logo-dot: #E39E78;
  --hero-wash: #E7EFE8; --panel-tint: #F6F8F4; --shadow-tint: rgba(116, 151, 127, .22);
  --shadow-1: 0 1px 2px rgba(40, 50, 44, .05), 0 6px 18px -10px var(--shadow-tint);
  --shadow-2: 0 2px 4px rgba(40, 50, 44, .05), 0 18px 40px -22px var(--shadow-tint);

  --gap: 1.25rem;
  --pad: 1.5rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}


[data-mode="dark"] {
  --danger-soft: #4A2626;
  --danger: #F1A8A8;
  --warn-soft: #463717;
  --warn: #F0CF8E;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 12px 30px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

[data-density="compact"] { --gap: .75rem; --pad: 1rem; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; display: block; }
svg { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--surface); padding: .5rem 1rem; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
.noscript { padding: 2rem; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- تحميل أولي ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1rem; color: var(--ink-2); }
.boot-mark { width: 44px; height: 44px; border-radius: 14px; background: var(--sage-soft); position: relative; overflow: hidden; }
.boot-mark::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* ---------- عناصر أساسية ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.1rem;
  border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: var(--on-accent); }
[data-mode="dark"] .btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-sm { min-height: 36px; padding: .3rem .8rem; font-size: .875rem; }
.btn-icon { width: 44px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }

.field { display: grid; gap: .35rem; }
.field > span, .label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.field small, .hint { color: var(--ink-3); font-size: .82rem; line-height: 1.6; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: .6rem .9rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.7; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: grid; gap: var(--gap); }
.stack-sm { display: grid; gap: .6rem; }
.stack > *, .stack-sm > *, .sections > *, .panel { min-width: 0; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .1rem .6rem; border-radius: var(--r-pill);
  font-size: .78rem; font-weight: 600; line-height: 1.8;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.badge-lav { background: var(--lavender); color: var(--lavender-ink); border-color: transparent; }
.badge-peach { background: var(--peach); color: var(--peach-ink); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-new { background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* ---------- حالات الدوام: لون + رمز + نص ---------- */
.st { display: inline-flex; align-items: center; gap: .35rem; border-radius: var(--r-pill); padding: .1rem .65rem; font-weight: 600; font-size: .85rem; line-height: 1.9; white-space: nowrap; }
.st-sym { font-size: .8em; }
.st-work { background: var(--sage-soft); color: var(--sage-ink); }
.st-off { background: var(--peach); color: var(--peach-ink); }
.st-leave { background: var(--lavender); color: var(--lavender-ink); }
.st-unset { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-strong); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- البطاقات واللوحات ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--pad);
  box-shadow: var(--shadow-1);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel-title { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 700; }
.panel-title svg { width: 22px; height: 22px; color: var(--accent-ink); }
.panel-sub { color: var(--ink-3); font-size: .88rem; }

.empty {
  display: grid; justify-items: center; text-align: center; gap: .5rem;
  padding: 2rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--r-md);
  color: var(--ink-2); background: var(--surface-2);
}
.empty svg { width: 30px; height: 30px; color: var(--ink-3); }
.empty strong { color: var(--ink); }
.notice { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: .9rem; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: .2rem; }
.notice-lav { background: var(--lavender); border-color: transparent; color: var(--lavender-ink); }
.notice-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.notice-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }

/* ---------- شريط علوي ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  padding-top: calc(.7rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-dept { font-size: .8rem; color: var(--ink-3); }
.logo { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.brand-logo { width: 100%; height: 100%; display: block; }
.brand-logo .logo-main { fill: var(--logo-main); transition: fill .25s ease; }
.brand-logo .logo-dot { fill: var(--logo-dot); transition: fill .25s ease; }
.topbar-actions { display: flex; gap: .4rem; flex-wrap: nowrap; }
@media (max-width: 560px) {
  .topbar-actions .btn-label { display: none; }
  .topbar-actions .btn { width: 44px; padding: 0; }
  .brand-dept { display: none; }
}

.page { width: min(1180px, 100%); margin: 0 auto; padding: clamp(1rem, 4vw, 2.5rem); padding-bottom: 4rem; }

/* ==========================================================
   شاشة اختيار الاسم — بطاقات أسماء كبطاقات الضيافة
   ========================================================== */
.picker { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.picker-head { text-align: center; padding: clamp(2.5rem, 8vw, 5rem) 1.25rem 1.5rem; display: grid; justify-items: center; gap: .9rem; }
.picker-head .logo { width: clamp(96px, 18vw, 132px); height: clamp(96px, 18vw, 132px); }
.picker-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.1rem, 6vw, 3.4rem); letter-spacing: 0; line-height: 1.25; }
.picker-sub { color: var(--ink-2); max-width: 46ch; }
.picker-date { color: var(--ink-3); font-size: .9rem; }
.picker-search { position: relative; width: min(440px, 100%); margin-top: .5rem; }
.picker-search svg { position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%); width: 20px; color: var(--ink-3); pointer-events: none; }
.picker-search .input { padding-inline-start: 2.8rem; min-height: 54px; border-radius: var(--r-pill); font-size: 1.05rem; background: var(--surface); box-shadow: var(--shadow-1); }

.names {
  width: min(1100px, 100%); margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2rem) 3rem;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-content: start;
}
.name-card {
  position: relative; text-align: center; cursor: pointer;
  display: grid; justify-items: center; gap: .55rem;
  padding: 1.5rem 1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
/* خط الطيّ: إحساس بطاقة الاسم على طاولة الضيافة */
.name-card::before { content: ''; position: absolute; inset-inline: 18%; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent-soft); transition: background .18s; }
.name-card:hover, .name-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.name-card:hover::before, .name-card:focus-visible::before { background: var(--accent); }
.name-card .nm { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; line-height: 1.4; }
.name-card .tt { font-size: .85rem; color: var(--ink-3); min-height: 1.4em; }
.name-card.supervisor { background: linear-gradient(180deg, var(--lavender), var(--surface) 70%); }
.name-card.supervisor .lock { position: absolute; top: .8rem; inset-inline-end: .8rem; color: var(--lavender-ink); }
.name-card.supervisor .lock svg { width: 18px; height: 18px; }
.picker-foot { text-align: center; padding: 1.5rem 1rem 2rem; color: var(--ink-3); font-size: .82rem; max-width: 60ch; margin: 0 auto; }
.names-enter > * { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.avatar {
  --size: 52px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: calc(var(--size) * .42);
  background: var(--sage-soft); color: var(--sage-ink);
}
.avatar.c-lavender { background: var(--lavender); color: var(--lavender-ink); }
.avatar.c-peach { background: var(--peach); color: var(--peach-ink); }
.avatar.c-sand { background: #EFE8D8; color: #5F4F2E; }
.avatar.c-sky { background: #DDE8EE; color: #36586A; }
.avatar.c-rose { background: #F3E0E4; color: #7A3A4A; }
[data-mode="dark"] .avatar.c-sand { background: #403826; color: #E8D9B4; }
[data-mode="dark"] .avatar.c-sky { background: #263842; color: #BCD6E3; }
[data-mode="dark"] .avatar.c-rose { background: #45282F; color: #F1C3CE; }
.avatar-sm { --size: 34px; }
.avatar-lg { --size: 64px; }

/* ==========================================================
   صفحة الموظف
   ========================================================== */
.hero {
  display: grid; gap: 1.25rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  margin-bottom: var(--gap);
}
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.greet { padding: clamp(1.25rem, 3vw, 2rem) 0; display: grid; gap: .5rem; align-content: center; }
.greet h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 5vw, 2.9rem); font-weight: 700; }
.greet .dates { color: var(--ink-2); display: flex; gap: .4rem 1rem; flex-wrap: wrap; }
.greet .msg-alert { justify-self: start; margin-top: .5rem; }

.today {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2);
  display: grid; gap: .9rem;
}
.today::after { content: ''; position: absolute; inset-inline-end: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: var(--accent-soft); opacity: .7; pointer-events: none; }
.today > * { position: relative; z-index: 1; }
.today-label { color: var(--ink-3); font-size: .88rem; font-weight: 600; }
.today-main { font-family: var(--font-display); font-size: clamp(1.7rem, 4.5vw, 2.3rem); font-weight: 700; line-height: 1.3; }
.today-time { font-size: 1.05rem; color: var(--ink-2); font-weight: 500; direction: rtl; }
.today-rest svg { width: 20px; height: 20px; color: var(--accent-ink); }
.today-rest { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }

.ribbon { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; }
.ribbon-day { display: grid; justify-items: center; gap: .15rem; padding: .5rem .2rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.ribbon-day.is-today { border-color: var(--accent); background: var(--accent-soft); }
.ribbon-day .wd { font-size: .72rem; color: var(--ink-3); }
.ribbon-day .dn { font-weight: 700; font-size: 1rem; }
.ribbon-day .rs { font-size: .72rem; font-weight: 600; line-height: 1.5; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ribbon-day .rs.work { color: var(--sage-ink); }
.ribbon-day .rs.off { color: var(--peach-ink); }
.ribbon-day .rs.leave { color: var(--lavender-ink); }
.ribbon-day .rs.unset { color: var(--ink-3); }

.sections { display: grid; gap: var(--gap); }

.tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.tab { border: 0; background: transparent; min-height: 38px; padding: .3rem 1rem; border-radius: var(--r-pill); font-weight: 600; cursor: pointer; color: var(--ink-2); }
.tab[aria-selected="true"], .tab[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* جدولي: قائمة أيام */
.days { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.day-row {
  display: grid; grid-template-columns: 3.2rem 1fr auto; align-items: center; gap: .75rem;
  padding: .65rem .9rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line);
}
.day-row.is-today { border-color: var(--accent); background: var(--accent-soft); }
.day-row.is-past { opacity: .62; }
.day-num { display: grid; justify-items: center; line-height: 1.2; }
.day-num b { font-size: 1.25rem; }
.day-num small { font-size: .72rem; color: var(--ink-3); }
.day-info { min-width: 0; display: grid; }
.day-info .time { font-size: .9rem; color: var(--ink-2); }
.day-info .note { font-size: .8rem; color: var(--ink-3); overflow-wrap: anywhere; }
.counts { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* جدول الفريق */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); max-height: 70vh; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .85rem; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); padding: 0; text-align: center; }
table.grid thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-weight: 600; padding: .4rem .2rem; min-width: 44px; }
table.grid thead th .wd { display: block; font-size: .68rem; color: var(--ink-3); font-weight: 500; }
table.grid th.sticky-name, table.grid td.sticky-name { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); text-align: start; padding: .4rem .75rem; min-width: 150px; max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
table.grid thead th.sticky-name { z-index: 3; background: var(--surface-2); }
table.grid th.is-today { background: var(--accent-soft); }
.cell { display: grid; place-items: center; min-height: 40px; min-width: 44px; padding: .15rem; font-weight: 600; font-size: .78rem; line-height: 1.2; }
.cell.work { background: color-mix(in srgb, var(--sage-soft) 80%, transparent); color: var(--sage-ink); }
.cell.off { background: color-mix(in srgb, var(--peach) 85%, transparent); color: var(--peach-ink); }
.cell.leave { background: color-mix(in srgb, var(--lavender) 90%, transparent); color: var(--lavender-ink); }
.cell.unset { color: var(--ink-3); }
.cell .sym { font-size: .65rem; opacity: .85; }
.cell .nt { font-size: .62rem; }

/* عرض يومي بالبطاقات (افتراضي على الجوال) */
.day-strip { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x proximity; }
.day-chip { flex: none; scroll-snap-align: center; display: grid; justify-items: center; min-width: 52px; padding: .4rem .3rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.day-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.day-chip small { font-size: .7rem; }
.people { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.person { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.person .who { flex: 1; min-width: 0; display: grid; }
.person .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .who small { color: var(--ink-3); }

/* الأخبار */
.news-list { display: grid; gap: .75rem; }
.news-item { padding: 1rem 1.15rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); display: grid; gap: .4rem; }
.news-item.pinned { background: var(--lavender); border-color: transparent; }
.news-item.pinned .muted { color: var(--lavender-ink); }
.news-item h3 { font-size: 1.05rem; }
.news-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); }

/* الرسائل */
.msg { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.msg.is-new { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.msg-head { width: 100%; display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; background: none; border: 0; cursor: pointer; text-align: start; }
.msg-head .t { flex: 1; min-width: 0; font-weight: 600; }
.msg-head .d { font-size: .8rem; color: var(--ink-3); white-space: nowrap; }
.msg-head svg { width: 18px; height: 18px; transition: transform .2s; color: var(--ink-3); }
.msg-head[aria-expanded="true"] svg { transform: rotate(180deg); }
.msg-body { padding: 0 1rem 1rem; color: var(--ink-2); }

/* التقارير */
.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); margin-bottom: 1rem; }
.kpi { padding: .9rem 1rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: .15rem; }
.kpi .k-label { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.kpi .k-value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
.kpi .k-how { font-size: .74rem; color: var(--ink-3); }
.kpi.na .k-value { color: var(--ink-3); font-size: 1rem; text-align: start; direction: rtl; }
table.data { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.data th, table.data td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
table.data th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; z-index: 1; }
table.data td.num { font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
table.data tr.me td { background: var(--accent-soft); }
.rcards { display: none; gap: .6rem; }
.rcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: .8rem 1rem; background: var(--surface-2); }
.rcard dl { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; margin: .5rem 0 0; font-size: .88rem; }
.rcard dt { color: var(--ink-3); }
.rcard dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
@media (max-width: 640px) {
  .rcards { display: grid; }
  .rtable { display: none; }
}

/* تقويم الرغبات */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; max-width: 440px; }
.cal .wh { text-align: center; font-size: .75rem; color: var(--ink-3); font-weight: 600; padding-bottom: .2rem; }
.cal button { aspect-ratio: 1 / 1; min-height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; display: grid; place-items: center; line-height: 1.1; }
.cal button[aria-pressed="true"] { background: var(--peach); border-color: var(--peach-ink); color: var(--peach-ink); }
.cal button[aria-pressed="true"]::after { content: 'راحة'; font-size: .6rem; font-weight: 600; }
.cal button:disabled { opacity: .35; cursor: not-allowed; }
.hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.req-item { display: grid; gap: .3rem; padding: .85rem 1rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }

/* ==========================================================
   لوحة المشرفة
   ========================================================== */
.admin { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 66px); }
.side { border-inline-end: 1px solid var(--line); padding: 1.25rem .9rem; position: sticky; top: 66px; height: calc(100vh - 66px); overflow-y: auto; background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
.side nav { display: grid; gap: .2rem; }
.nav-link { display: flex; align-items: center; gap: .7rem; min-height: 44px; padding: .45rem .8rem; border-radius: var(--r-md); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.nav-link svg { width: 20px; height: 20px; flex: none; }
.nav-link:hover { background: var(--accent-soft); color: var(--accent-ink); }
.nav-link[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.nav-link .count { margin-inline-start: auto; }
.admin-main { padding: clamp(1rem, 3vw, 2rem); min-width: 0; }
.admin-title { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 700; margin-bottom: .25rem; }
.admin-lead { color: var(--ink-2); margin-bottom: 1.5rem; max-width: 70ch; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: sticky; top: 62px; z-index: 15; height: auto; padding: .5rem .75rem; border-inline-end: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
  .side nav { display: flex; overflow-x: auto; gap: .35rem; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { display: none; }
  .nav-link { flex: none; min-height: 40px; padding: .35rem .8rem; }
  .side .side-note { display: none; }
}
.side-note { margin-top: 1.5rem; padding: .8rem; font-size: .8rem; color: var(--ink-3); border-top: 1px solid var(--line); }

.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin-bottom: 1.5rem; }
.stat { padding: 1.1rem 1.2rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: grid; gap: .2rem; }
.stat .s-label { color: var(--ink-3); font-size: .85rem; font-weight: 600; }
.stat .s-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; line-height: 1.35; }
.stat .s-foot { font-size: .8rem; color: var(--ink-3); }
.stat.lav { background: var(--lavender); border-color: transparent; }
.stat.peach { background: var(--peach); border-color: transparent; }
.stat.sage { background: var(--sage-soft); border-color: transparent; }

.list { display: grid; gap: .6rem; }
.item { display: flex; gap: .9rem; align-items: center; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); flex-wrap: wrap; }
.item.dim { opacity: .7; }
.item .grow { flex: 1; min-width: 180px; display: grid; gap: .1rem; }
.item .grow b { font-size: 1rem; }
.item .grow small { color: var(--ink-3); }

/* محرر الجدول */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }
.editor-grid .cell { width: 100%; border: 0; cursor: pointer; background: transparent; }
.editor-grid td { position: relative; }
.editor-grid .cell.work { background: color-mix(in srgb, var(--sage-soft) 80%, transparent); }
.editor-grid .cell.off { background: color-mix(in srgb, var(--peach) 85%, transparent); }
.editor-grid .cell.leave { background: color-mix(in srgb, var(--lavender) 90%, transparent); }
.editor-grid .cell[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: -3px; box-shadow: inset 0 0 0 40px color-mix(in srgb, var(--accent) 22%, transparent); }
.editor-grid .cell.changed::before { content: ''; position: absolute; top: 3px; inset-inline-end: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.editor-grid .cell.req::after { content: 'ر'; position: absolute; bottom: 1px; inset-inline-start: 3px; font-size: .55rem; color: var(--peach-ink); }
.editor-grid .head-btn { width: 100%; border: 0; background: transparent; cursor: pointer; padding: .35rem .2rem; font-weight: 600; }
.editor-grid .head-btn:hover { background: var(--accent-soft); }
.name-btn { border: 0; background: transparent; cursor: pointer; font-weight: 600; text-align: start; width: 100%; padding: 0; }
.apply-bar {
  position: sticky; bottom: 0; z-index: 10; margin-top: 1rem;
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: end;
  padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
}
.apply-bar .field { min-width: 140px; }
.warn-list { display: grid; gap: .35rem; max-height: 320px; overflow: auto; padding-inline-end: .25rem; }
.warn-item { display: flex; gap: .5rem; align-items: flex-start; font-size: .88rem; padding: .45rem .6rem; border-radius: var(--r-sm); background: var(--surface-2); }
.warn-item.error { background: var(--danger-soft); color: var(--danger); }
.warn-item.warning { background: var(--warn-soft); color: var(--warn); }
details.panel > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: .5rem; justify-content: space-between; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel[open] > summary { margin-bottom: 1rem; }

/* معالج التقارير */
.steps { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: .45rem; padding: .3rem .85rem .3rem .45rem; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); font-size: .88rem; color: var(--ink-3); font-weight: 600; }
.steps li .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-size: .8rem; }
.steps li[aria-current="step"] { color: var(--ink); border-color: var(--accent); }
.steps li[aria-current="step"] .n, .steps li.done .n { background: var(--accent); color: var(--on-accent); }
td.bad { background: var(--danger-soft); color: var(--danger); }
.map-row { display: grid; gap: .6rem; grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) minmax(150px, 1.2fr); align-items: start; padding: .8rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.map-row .samples { font-size: .78rem; color: var(--ink-3); overflow-wrap: anywhere; }
.map-extra { grid-column: 1 / -1; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 700px) { .map-row { grid-template-columns: 1fr; } }
textarea.paste { min-height: 220px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; direction: ltr; text-align: left; white-space: pre; }

/* ---------- نافذة منبثقة ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(28, 34, 30, .42); display: grid; place-items: center; padding: 1rem; animation: fade .18s ease both; }
.dialog {
  width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow: auto;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: 0 30px 80px -30px rgba(0,0,0,.45);
  display: grid; grid-template-rows: auto 1fr auto; animation: pop .22s var(--ease) both;
}
.dialog.wide { width: min(980px, 100%); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem 1.4rem .6rem; }
.dialog-head h2 { font-family: var(--font-display); font-size: 1.35rem; }
.dialog-body { padding: .6rem 1.4rem 1rem; overflow: auto; }
.dialog-foot { display: flex; gap: .5rem; justify-content: flex-start; flex-wrap: wrap; padding: 1rem 1.4rem 1.3rem; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .overlay { place-items: end center; padding: 0; }
  .dialog { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- تنبيهات منبثقة ---------- */
.toasts { position: fixed; bottom: calc(1rem + env(safe-area-inset-bottom)); inset-inline: 0; display: grid; justify-items: center; gap: .5rem; z-index: 60; pointer-events: none; padding: 0 1rem; }
.toast { pointer-events: auto; max-width: 520px; padding: .75rem 1.1rem; border-radius: var(--r-md); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); font-weight: 500; animation: rise .25s var(--ease) both; display: flex; gap: .5rem; align-items: center; }
.toast.error { background: var(--danger); color: #fff; }
[data-mode="dark"] .toast.error { color: #2a0f0f; }

/* تخصيص */
.swatches { display: flex; gap: .6rem; flex-wrap: wrap; }
.swatch { position: relative; display: grid; justify-items: center; gap: .3rem; cursor: pointer; font-size: .8rem; color: var(--ink-2); }
.swatch input { position: absolute; opacity: 0; }
.swatch .dot { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch input:checked + .dot { box-shadow: 0 0 0 3px var(--ink); }
.swatch input:focus-visible + .dot { outline: 3px solid var(--accent); outline-offset: 3px; }
.order-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.order-item .grow { flex: 1; font-weight: 600; }

.loading { display: flex; gap: .6rem; align-items: center; color: var(--ink-3); padding: 1.5rem 0; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot-note { margin-top: 2rem; text-align: center; font-size: .8rem; color: var(--ink-3); max-width: 70ch; margin-inline: auto; }
.logo-preview { width: 84px; height: 84px; }


/* ==========================================================
   الإصدار 2: صور، ترحيب، أيام الأسبوع، معاينات الثيم، القوالب، الرسوم
   ========================================================== */

.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.name-card .lock-mini { position: absolute; top: .8rem; inset-inline-start: .8rem; color: var(--ink-3); }
.name-card .lock-mini svg { width: 16px; height: 16px; }

/* بطاقة الترحيب ودوام اليوم */
.welcome {
  position: relative; overflow: hidden; margin-bottom: var(--gap);
  display: grid; gap: 1.25rem; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.05fr); align-items: center;
  padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--hero-wash), var(--surface) 62%);
  border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
.welcome::after { content: ''; position: absolute; inset-inline-start: -80px; bottom: -110px; width: 260px; height: 260px; border-radius: 50%; background: var(--accent-2); opacity: .12; pointer-events: none; }
.welcome > * { position: relative; z-index: 1; }
.welcome-photo { position: relative; }
.welcome-photo .avatar { --size: clamp(76px, 12vw, 104px); box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.photo-edit { position: absolute; bottom: -2px; inset-inline-start: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border: 3px solid var(--surface); cursor: pointer; }
.photo-edit svg { width: 16px; height: 16px; }
.welcome-text { display: grid; gap: .35rem; min-width: 0; }
.welcome-greet { font-family: var(--font-display); font-size: clamp(1.8rem, 4.6vw, 2.7rem); font-weight: 700; line-height: 1.25; }
.welcome-dates { color: var(--ink-2); font-size: .92rem; display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
.welcome-shift { display: grid; gap: .55rem; padding: 1rem 1.1rem; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); }
.welcome-shift .ws-title { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.welcome-shift .ws-main { font-size: clamp(1.25rem, 3vw, 1.55rem); font-weight: 700; line-height: 1.35; }
.welcome-shift .ws-time { color: var(--ink-2); font-weight: 500; }
.welcome-shift .ws-note { font-size: .85rem; color: var(--ink-3); }
@media (max-width: 900px) {
  .welcome { grid-template-columns: auto minmax(0, 1fr); }
  .welcome-shift { grid-column: 1 / -1; }
}

/* أيام الأسبوع في الرغبات */
.weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .45rem; max-width: 640px; }
.weekday { min-height: 54px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; display: grid; place-items: center; gap: .1rem; padding: .35rem .2rem; line-height: 1.2; }
.weekday small { font-size: .65rem; font-weight: 600; visibility: hidden; }
.weekday[aria-pressed="true"] { background: var(--peach); border-color: var(--peach-ink); color: var(--peach-ink); }
.weekday[aria-pressed="true"] small { visibility: visible; }
.weekday:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 520px) { .weekdays { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* معاينة مصغرة للثيم */
.theme-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.theme-card { position: relative; display: grid; gap: .45rem; padding: .55rem; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: start; }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card:has(input:checked) { border-color: var(--ink); }
.theme-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.theme-card b { font-size: .85rem; }
.theme-card small { font-size: .7rem; color: var(--ink-3); line-height: 1.4; }
.mini { border-radius: 10px; padding: 7px; display: grid; gap: 5px; border: 1px solid rgba(0,0,0,.06); }
.mini-bar { display: flex; align-items: center; gap: 4px; }
.mini-dot { width: 12px; height: 12px; border-radius: 50%; }
.mini-line { height: 5px; border-radius: 3px; flex: 1; }
.mini-card { border-radius: 7px; padding: 6px; display: grid; gap: 4px; }
.mini-row { display: flex; gap: 3px; }
.mini-chip { height: 9px; border-radius: 5px; flex: 1; }
.mini-btn { height: 11px; width: 46%; border-radius: 6px; }
.swatch-row { display: flex; gap: 3px; }
.swatch-row span { flex: 1; height: 6px; border-radius: 3px; }

/* معاينة القوالب */
.layout-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.layout-card { position: relative; display: grid; gap: .4rem; padding: .6rem; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.layout-card input { position: absolute; opacity: 0; pointer-events: none; }
.layout-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.layout-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.layout-card b { font-size: .85rem; }
.layout-card small { font-size: .72rem; color: var(--ink-3); line-height: 1.45; }
.wire { height: 62px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); padding: 5px; display: grid; gap: 4px; }
.wire i { display: block; border-radius: 4px; background: var(--accent-soft); }
.wire i.s { background: var(--accent); opacity: .55; }
.wire-cards { grid-template-rows: 16px 1fr 1fr; }
.wire-dash { grid-template-columns: 2fr 1fr; grid-template-rows: 12px 1fr 1fr; }
.wire-dash i:first-child { grid-column: 1 / -1; }
.wire-side { grid-template-columns: 1fr 3fr; }
.wire-side i:first-child { grid-row: span 2; }
.wire-sect { grid-template-rows: 10px 1fr 10px 1fr; }
.wire-top { grid-template-rows: 10px 1fr; }
.wire-tiles { grid-template-columns: repeat(3, 1fr); grid-template-rows: 10px 1fr 1fr; }
.wire-tiles i:first-child { grid-column: 1 / -1; }

.order-item[draggable="true"] { cursor: grab; }
.order-item.dragging { opacity: .45; }
.order-item.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.order-item .grip { color: var(--ink-3); cursor: grab; font-size: 1.1rem; line-height: 1; padding-inline: .2rem; }

/* قص الصورة */
.crop-wrap { display: grid; justify-items: center; gap: .9rem; }
.crop-stage { position: relative; width: min(300px, 78vw); aspect-ratio: 1 / 1; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); touch-action: none; cursor: grab; border: 1px solid var(--line); }
.crop-stage canvas { width: 100%; height: 100%; display: block; }
.crop-stage::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.38); pointer-events: none; }
.crop-zoom { width: min(300px, 78vw); accent-color: var(--accent); }

/* ===== قوالب صفحة الموظف ===== */
[data-layout="dashboard"] .page { width: min(1440px, 100%); }
[data-layout="dashboard"] { --gap: .9rem; --pad: 1.1rem; }
[data-layout="dashboard"] .welcome { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr); padding: 1rem 1.25rem; }
[data-layout="dashboard"] .welcome-greet { font-size: clamp(1.4rem, 3vw, 1.9rem); }
[data-layout="dashboard"] .sections { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
[data-layout="dashboard"] .sections > * { grid-column: span 6; }
[data-layout="dashboard"] .sections > [data-section="schedule"],
[data-layout="dashboard"] .sections > [data-section="report"] { grid-column: span 12; }
[data-layout="dashboard"] .sections > [data-section="messages"],
[data-layout="dashboard"] .sections > [data-section="news"] { grid-column: span 6; max-height: 520px; overflow: auto; }
[data-layout="dashboard"] .panel-title { font-size: 1rem; }
@media (max-width: 1000px) { [data-layout="dashboard"] .sections > * { grid-column: 1 / -1 !important; max-height: none !important; } }

[data-layout="sidebar"] .emp-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
[data-layout="sidebar"] .emp-nav { position: sticky; top: 84px; display: grid; gap: .25rem; padding: .75rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
[data-layout="sidebar"] .emp-nav button { display: flex; align-items: center; gap: .6rem; min-height: 46px; padding: .45rem .8rem; border-radius: var(--r-md); border: 0; background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer; text-align: start; }
[data-layout="sidebar"] .emp-nav button svg { width: 20px; height: 20px; }
[data-layout="sidebar"] .emp-nav button:hover { background: var(--accent-soft); color: var(--accent-ink); }
[data-layout="sidebar"] .emp-nav button[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
[data-layout="sidebar"] .welcome { grid-template-columns: auto minmax(0, 1fr); }
[data-layout="sidebar"] .welcome-shift { grid-column: 1 / -1; }
@media (max-width: 860px) {
  [data-layout="sidebar"] .emp-shell { grid-template-columns: 1fr; }
  [data-layout="sidebar"] .emp-nav { top: 62px; z-index: 12; display: flex; overflow-x: auto; scrollbar-width: none; padding: .4rem; }
  [data-layout="sidebar"] .emp-nav button { flex: none; min-height: 40px; }
}
.emp-nav { display: none; }
[data-layout="sidebar"] .emp-nav { display: grid; }
@media (max-width: 860px) { [data-layout="sidebar"] .emp-nav { display: flex; } }

[data-layout="sections"] .page { width: 100%; padding-inline: 0; padding-top: 0; }
[data-layout="sections"] .welcome { border-radius: 0; border-inline: 0; border-top: 0; margin-bottom: 0; padding-inline: clamp(1rem, 6vw, 5rem); padding-block: clamp(2rem, 6vw, 3.5rem); }
[data-layout="sections"] .sections { gap: 0; }
[data-layout="sections"] .sections > .panel { border-radius: 0; border-inline: 0; border-top: 0; box-shadow: none; padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1rem, 6vw, 5rem); }
[data-layout="sections"] .sections > .panel:nth-child(even) { background: var(--panel-tint); }
[data-layout="sections"] .panel-title { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.3rem); }
[data-layout="sections"] .panel-title svg { width: 30px; height: 30px; }
[data-layout="sections"] .panel-head { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--accent-soft); }
[data-layout="sections"] .foot-note { padding-inline: 1rem; }
.sect-nav { display: none; }
[data-layout="sections"] .sect-nav { display: flex; position: sticky; top: 62px; z-index: 12; gap: .35rem; overflow-x: auto; padding: .55rem clamp(1rem, 6vw, 5rem); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.sect-nav a { flex: none; padding: .3rem .9rem; border-radius: var(--r-pill); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; border: 1px solid var(--line); background: var(--surface); }
.sect-nav a:hover { border-color: var(--accent); color: var(--accent-ink); }

/* تقويم شهري للجدول الشخصي */
.month-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.month-cal .wh { text-align: center; font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.mc-day { min-height: 74px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); padding: .3rem .35rem; display: grid; align-content: space-between; gap: .2rem; font-size: .78rem; }
.mc-day .n { font-weight: 700; font-size: .9rem; }
.mc-day.work { background: var(--sage-soft); color: var(--sage-ink); border-color: transparent; }
.mc-day.off { background: var(--peach); color: var(--peach-ink); border-color: transparent; }
.mc-day.leave { background: var(--lavender); color: var(--lavender-ink); border-color: transparent; }
.mc-day.is-today { outline: 3px solid var(--accent); outline-offset: -1px; }
.mc-day.is-past { opacity: .6; }
.mc-day .l { font-weight: 600; line-height: 1.25; }
.mc-day .t { font-size: .68rem; opacity: .9; }
@media (max-width: 560px) { .mc-day { min-height: 58px; padding: .2rem; } .mc-day .t { display: none; } }

/* أسابيع متتابعة */
.weeks { display: grid; gap: .8rem; }
.week { display: grid; gap: .5rem; }
.week-title { font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.week-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.wk-cell { border-radius: var(--r-sm); padding: .45rem .4rem; display: grid; gap: .15rem; font-size: .78rem; border: 1px solid var(--line); background: var(--surface-2); min-height: 66px; }
.wk-cell.empty { visibility: hidden; }
.wk-cell.work { background: var(--sage-soft); color: var(--sage-ink); border-color: transparent; }
.wk-cell.off { background: var(--peach); color: var(--peach-ink); border-color: transparent; }
.wk-cell.leave { background: var(--lavender); color: var(--lavender-ink); border-color: transparent; }
.wk-cell.is-today { outline: 3px solid var(--accent); outline-offset: -1px; }
@media (max-width: 640px) { .week-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ===== داشبورد التقارير ===== */
.rd { display: grid; gap: 1.1rem; }
.rd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }
.rd-title { font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 700; }
.rd-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.rd-scope { display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; flex-wrap: wrap; }
.rd-kpis { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.rd-kpi { position: relative; overflow: hidden; display: grid; gap: .25rem; padding: 1rem 1.1rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.rd-kpi::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--kpi-color, var(--accent)); }
.rd-kpi .k-label { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.rd-kpi .k-value { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: end; line-height: 1.3; }
.rd-kpi .k-value.na { font-size: 1rem; color: var(--ink-3); direction: rtl; text-align: start; }
.rd-kpi .k-desc { font-size: .78rem; color: var(--ink-3); line-height: 1.55; }
.rd-kpi .k-how { font-size: .72rem; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: .35rem; margin-top: .15rem; }
.rd-charts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.rd-chart { padding: 1rem 1.1rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: grid; gap: .7rem; align-content: start; min-width: 0; }
.rd-chart h4 { font-size: .98rem; font-weight: 700; }
.rd-chart .hint { margin: 0; }
.hbars { display: grid; gap: .45rem; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto; align-items: center; gap: .6rem; font-size: .84rem; }
.hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar .track { height: 14px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 7px; background: var(--chart-1); transform-origin: right; animation: grow .6s var(--ease) both; }
.hbar.me .fill { background: var(--chart-2); }
.hbar .val { font-variant-numeric: tabular-nums; direction: ltr; min-width: 3.5rem; text-align: end; font-weight: 600; }
.hbar.missing .val { color: var(--ink-3); direction: rtl; font-weight: 500; font-size: .78rem; }
@keyframes grow { from { transform: scaleX(0); } }
.rings { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-around; }
.ring { display: grid; justify-items: center; gap: .3rem; text-align: center; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.ring svg { width: 112px; height: 112px; }
.ring .bg { stroke: var(--surface-2); }
.ring .fg { stroke: var(--chart-1); transition: stroke-dashoffset .7s var(--ease); }
.ring text { fill: var(--ink); font-weight: 700; font-family: var(--font-ui); }
.trend svg { width: 100%; height: 180px; overflow: visible; }
.trend .axis { stroke: var(--line-strong); }
.trend .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.trend .ln { fill: none; stroke: var(--chart-1); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend .pt { fill: var(--surface); stroke: var(--chart-1); stroke-width: 3; }
.trend text { fill: var(--ink-3); font-size: 11px; font-family: var(--font-ui); }
.trend .lbl { fill: var(--ink); font-weight: 700; }
[data-layout="dashboard"] .rd-kpi .k-desc { display: none; }
[data-layout="dashboard"] .rd-kpi .k-value { font-size: 1.4rem; }

/* لوحة المشرفة: قوالب */
[data-admin-layout="top"] .admin { grid-template-columns: 1fr; }
[data-admin-layout="top"] .side { position: sticky; top: 66px; z-index: 15; height: auto; padding: .5rem clamp(1rem, 3vw, 2rem); border-inline-end: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
[data-admin-layout="top"] .side nav { display: flex; overflow-x: auto; gap: .35rem; scrollbar-width: none; }
[data-admin-layout="top"] .nav-link { flex: none; min-height: 40px; }
[data-admin-layout="top"] .admin-main { width: min(1280px, 100%); margin: 0 auto; }
[data-admin-layout="tiles"] .admin { grid-template-columns: 1fr; }
[data-admin-layout="tiles"] .side { display: none; }
[data-admin-layout="tiles"] .admin-main { width: min(1280px, 100%); margin: 0 auto; }
.tiles-nav { display: none; }
[data-admin-layout="tiles"] .tiles-nav { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); margin-bottom: 1.5rem; }
.tile { display: grid; gap: .5rem; padding: 1rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); text-decoration: none; color: var(--ink); font-weight: 700; }
.tile svg { width: 26px; height: 26px; color: var(--accent-ink); }
.tile[aria-current="page"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.tile[aria-current="page"] svg { color: var(--on-accent); }
.tile:hover { border-color: var(--accent); }
.side-note { display: none; }

.rs-short { display: none; }
@media (max-width: 560px) { .rs-long { display: none; } .rs-short { display: inline; } }
.welcome-text .btn { white-space: normal; text-align: start; height: auto; min-height: 40px; justify-self: start; line-height: 1.5; }

/* ==========================================================
   الإصدار 3: الإعلانات، الاقتراحات، الخبرات، طلبات الصلاحية
   ========================================================== */
.ann-banner-wrap:empty { display: none; }
.ann-banner { margin-bottom: var(--gap); padding: clamp(1rem, 3vw, 1.4rem); border-radius: var(--r-xl); background: linear-gradient(135deg, var(--peach), var(--surface) 75%); border: 2px solid color-mix(in srgb, var(--accent-2) 55%, var(--line)); box-shadow: var(--shadow-2); display: grid; gap: .9rem; }
.ann-banner-head { display: flex; align-items: center; gap: .6rem; color: var(--peach-ink); }
.ann-banner-head svg { width: 26px; height: 26px; }
.ann-banner-head h2 { font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 1.5rem); }
.ann-card { display: grid; gap: .55rem; padding: 1rem 1.1rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.ann-card.reminded { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.ann-card h3 { font-size: 1.1rem; }
[data-layout="sections"] .ann-banner { border-radius: 0; margin: 0; border-inline: 0; padding-inline: clamp(1rem, 6vw, 5rem); }

.composer { border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); }
.composer > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; font-weight: 700; color: var(--accent-ink); }
.composer > summary::-webkit-details-marker { display: none; }
.composer > summary svg { width: 18px; height: 18px; }
.composer[open] > summary { border-bottom: 1px dashed var(--line); }
.composer-form { padding: 1rem; }

.idea, .tip { display: grid; gap: .55rem; padding: 1rem 1.1rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.idea h3, .tip h3 { font-size: 1.05rem; }
.tip.flagged { border-color: var(--warn); }
.tip.stopped { border-style: dashed; opacity: .9; }
.tips-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.votes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.vote-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .35rem .9rem; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; color: var(--ink-2); }
.vote-btn svg { width: 18px; height: 18px; }
.vote-btn b { font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: center; }
.vote-btn.up[aria-pressed="true"] { background: var(--sage-soft); border-color: var(--sage-ink); color: var(--sage-ink); }
.vote-btn.down[aria-pressed="true"] { background: var(--peach); border-color: var(--peach-ink); color: var(--peach-ink); }
.vote-btn:disabled { opacity: .55; cursor: not-allowed; }
.decision { padding: .6rem .8rem; border-radius: var(--r-sm); background: var(--lavender); color: var(--lavender-ink); font-size: .9rem; }
.comments { display: grid; gap: .45rem; }
.comment { padding: .6rem .8rem; border-radius: var(--r-sm); border-inline-start: 4px solid var(--accent); background: var(--accent-soft); color: var(--ink); font-size: .9rem; display: grid; gap: .25rem; }
.comment-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; color: var(--accent-ink); }
.comment-head svg { width: 16px; height: 16px; }
.comment.c-correction { border-color: var(--lavender-ink); background: var(--lavender); }
.comment.c-correction .comment-head { color: var(--lavender-ink); }
.comment.c-warning { border-color: var(--warn); background: var(--warn-soft); }
.comment.c-warning .comment-head { color: var(--warn); }
.ack-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .9rem; color: var(--ink-2); }
.ack-stats b { color: var(--ink); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.progress { height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 5px; transition: width .4s var(--ease); }
[data-layout="dashboard"] .sections > [data-section="announcements"],
[data-layout="dashboard"] .sections > [data-section="suggestions"],
[data-layout="dashboard"] .sections > [data-section="tips"],
[data-layout="dashboard"] .sections > [data-section="access"] { grid-column: span 6; max-height: 640px; overflow: auto; }

/* رسالة عند تعذر تشغيل البوابة */
.boot-fail { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1rem; padding: 2rem; text-align: center; color: var(--ink-2); }
.boot-fail h1 { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); }

/* ==========================================================
   الإصدار 4: وش فاتني؟ والإشعارات والمفضلة وإعادة الضبط
   ========================================================== */
.sec-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .4rem; margin-inline-start: .45rem; border-radius: var(--r-pill); background: var(--accent-2); color: #1b1410; font-size: .75rem; font-weight: 700; font-family: var(--font-ui); line-height: 1; }
[data-mode="dark"] .sec-badge { color: #101312; }
.nav-link .sec-badge, .tile .sec-badge, .emp-nav button .sec-badge { margin-inline-start: auto; }
.nav-link[aria-current="page"] .sec-badge, .emp-nav button[aria-current="true"] .sec-badge { background: var(--surface); color: var(--ink); }
.bell-btn { position: relative; }
.bell-count { position: absolute; top: 3px; inset-inline-end: 3px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }
[data-mode="dark"] .bell-count { color: #2a0f0f; }

.wn-panel { border: 2px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: linear-gradient(160deg, var(--panel-tint), var(--surface) 60%); }
.wn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.wn-item { width: 100%; display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: start; color: var(--ink); }
.wn-item:hover { border-color: var(--accent); }
.wn-item.personal { border-inline-start: 4px solid var(--accent-2); }
.wn-item > svg { width: 16px; height: 16px; color: var(--ink-3); transform: rotate(90deg); flex: none; }
.wn-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.wn-icon svg { width: 18px; height: 18px; }
.wn-text { flex: 1; min-width: 0; display: grid; gap: .1rem; font-size: .92rem; line-height: 1.55; }
.wn-text small { color: var(--ink-3); font-size: .78rem; }
.wn-empty { display: grid; justify-items: center; gap: .3rem; padding: 1.25rem; text-align: center; color: var(--ink-2); font-weight: 600; }
.wn-empty svg { width: 30px; height: 30px; color: var(--accent); }
.wn-count { margin-inline-start: .5rem; }

.fav-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3); cursor: pointer; }
.fav-btn svg { width: 17px; height: 17px; }
.fav-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fav-btn[aria-pressed="true"] svg path { fill: currentColor; }
.news-meta .fav-btn { width: 30px; height: 30px; order: 99; margin-inline-start: auto; }
.fav-item small.pre { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@keyframes flashIt { 0% { box-shadow: 0 0 0 0 var(--accent); } 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.flash { animation: flashIt 1.6s var(--ease) 2; border-color: var(--accent) !important; }

.reset-type { align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.reset-type small { font-weight: 500; }
.reset-list { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .3rem; }
.reset-confirm { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
@media (max-width: 560px) { .topbar-actions .bell-btn { width: 44px; } }

.count-pill { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 .45rem; margin-inline-start: .5rem; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: .78rem; font-weight: 700; line-height: 1; font-family: var(--font-ui); }
.count-pill[hidden] { display: none; }

/* ==========================================================
   الإصدار 5: تبديل الأوف والبريكات
   ========================================================== */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: .7rem; padding-bottom: .9rem; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; inset-inline-start: 16px; top: 32px; bottom: 0; width: 2px; background: var(--line-strong); }
.timeline li.tl-done:not(:last-child)::before { background: var(--accent); }
.tl-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); border: 2px solid var(--line-strong); color: var(--ink-3); position: relative; z-index: 1; }
.tl-done .tl-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tl-current .tl-dot { background: var(--surface); border-color: var(--accent-2); color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 30%, transparent); }
.tl-failed .tl-dot { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.tl-body { display: grid; gap: .1rem; padding-top: .3rem; }
.tl-body small { color: var(--ink-3); }
.tl-current .tl-body b { color: var(--ink); }
.tl-future .tl-body b { color: var(--ink-3); font-weight: 500; }
.tl-failed .tl-body b { color: var(--danger); }
.swap-table td.st-cell { font-weight: 600; }
.swap-table td.work { color: var(--sage-ink); }
.swap-table td.off { color: var(--peach-ink); }
.swap-table td.changed { background: var(--accent-soft); }
.swap-card { background: var(--surface-2); box-shadow: none; }

.break-live { display: grid; }
.break-card { display: grid; justify-items: start; gap: .5rem; padding: 1.1rem 1.25rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); }
.break-card svg { width: 22px; height: 22px; color: var(--accent-ink); }
.break-card.on { background: linear-gradient(135deg, var(--peach), var(--surface) 80%); border-color: color-mix(in srgb, var(--accent-2) 50%, var(--line)); }
.break-timer { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; letter-spacing: .02em; }
.over-live { font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.over-live.over { color: var(--danger); }
.item.unpaid { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
tr.over-row td, tr.over-row th, tr.unpaid-row td, tr.unpaid-row th { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }
[data-layout="dashboard"] .sections > [data-section="breaknow"] { grid-column: span 4; }
[data-layout="dashboard"] .sections > [data-section="breaks"] { grid-column: span 8; }
[data-layout="dashboard"] .sections > [data-section="swaps"] { grid-column: span 12; }

/* شاشة الأسماء: صاحبة الإدارة أعلى الصفحة وحدها، والفريق تحتها */
.picker-lead { width: min(280px, 100%); margin-top: .75rem; display: grid; }
.picker-lead .name-card { padding: 1.6rem 1.25rem 1.4rem; border-width: 2px; border-color: color-mix(in srgb, var(--accent-3) 45%, var(--line)); box-shadow: var(--shadow-2); }
.picker-lead .name-card .nm { font-size: 1.35rem; }
.picker-team { width: min(1100px, 100%); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.picker-team-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.picker-team-head h2 { font-family: var(--font-display); font-size: 1.4rem; }
.picker-team-head .picker-search { margin-top: 0; }
.picker-team .names { padding-inline: 0; }

/* عبارة ثابتة أسفل كل صفحة (خارج نظام تعديل النصوص) */
.credit { text-align: center; padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom)); font-size: .82rem; color: var(--ink-3); border-top: 1px solid var(--line); background: var(--bg); }
.credit::before { content: '♥'; color: var(--accent-2); margin-inline-end: .35rem; }
.admin { min-height: calc(100vh - 66px - 60px); }

.text-rule { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: .5rem; align-items: center; }
.text-rule .arrow { color: var(--ink-3); font-weight: 700; }
@media (max-width: 640px) { .text-rule { grid-template-columns: 1fr auto; } .text-rule .arrow { display: none; } }
.text-results { max-height: 260px; overflow: auto; }
.text-hit { width: 100%; text-align: start; cursor: pointer; padding: .55rem .8rem; font-size: .9rem; }
.text-hit:hover { border-color: var(--accent); }
