/* ETC Agency OS — الشكل الجديد (الدفعة الأولى، 11 نوفمبر 2026).
   الألوان من ملفات هوية ETC المعتمدة (claude/erb-new-look-brand.md في بروجكت ETC)،
   والتقسيمة والحركة من مرجع الواجهة (claude/erb-ui-reference.md).
   الملف ده بيتحمّل بعد main.css و ui-polish.css وبيغطي عليهم؛ ملفات الطباعة مبتتأثرش. */

@media screen {
 body {
  --etc-bg: #070E2C; --etc-side: #0B1236; --etc-surface: #0F163F; --etc-raised: #172152; --etc-input: #0A1235;
  --etc-line: rgba(124, 210, 239, .13); --etc-line-strong: rgba(124, 210, 239, .28);
  --etc-blue: #43AEE3; --etc-blue-dark: #2F8FC4; --etc-sky: #7CD2EF; --etc-ink: #04102A;
  --etc-text: #E8EEF8; --etc-soft: #C3CEE6; --etc-muted: #9AA8C7;
  --etc-ease: cubic-bezier(.3, .8, .2, 1);
  --bg: var(--etc-bg); --navy: var(--etc-bg); --navy-light: var(--etc-surface); --navy-lighter: var(--etc-raised);
  --card: var(--etc-surface); --ui-surface: var(--etc-surface); --ui-raised: var(--etc-raised); --ui-input: var(--etc-input);
  --ui-line: var(--etc-line); --border: var(--etc-line); --muted: var(--etc-muted); --ui-muted: var(--etc-muted);
  --ui-cyan: var(--etc-sky); --primary: var(--etc-blue); --primary-dark: var(--etc-blue-dark); --accent: var(--etc-blue);
  --sky: var(--etc-sky); --text: var(--etc-text);
  --gradient: linear-gradient(135deg, var(--etc-blue), var(--etc-blue-dark));
  --ui-radius: 18px; --radius: 18px;
  background: var(--etc-bg); color: var(--etc-text);
 }

 /* خلفية: شبكة الخطوط والنقط بتاعة الفولدر والليتر هيد بدل الدواير المنوّرة */
 .orbs-bg { opacity: 1; background: url('../img/etc-mesh.svg') center 60% / cover no-repeat; }
 .orbs-bg::after { content: ''; position: absolute; inset: 0; background: var(--etc-bg); opacity: .86; }
 .hero-bg-orb { display: none; }

 body::before, #particles { display: none !important; }

 /* ---- القائمة الجانبية ----
    كانت قبل كده شريط أفقي فوق (ui-polish.css: "Navigation preference")، ورجعت
    جانبية بعد ما منعم اعتمد الشاشات التجريبية للشكل الجديد في 11 نوفمبر 2026. */
 @media (min-width: 861px) {
  .shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .topnav { position: sticky; top: 0; height: 100dvh; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; border-bottom: 0; }
  .nav-row { order: 0; flex: 1; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 4px; overflow-x: hidden; overflow-y: auto; max-height: none; padding: 0 0 16px; border-top: 0; }
  .nav-section-label { display: block; }
  .nav-item { white-space: normal; font-size: 14px; min-height: 44px; padding: 10px 12px; }
  .nav-item.active { padding: 10px 12px; }
 }
 .topnav { background: var(--etc-side); border-inline-end: 1px solid var(--etc-line); padding: 22px 14px 16px; view-transition-name: etc-sidebar; }
 @media (max-width: 860px) { .topnav { padding: 12px 16px; } }
 .brand { justify-content: flex-start; padding: 0 8px 22px; }
 .brand .name { font-size: 16px; font-weight: 800; color: #fff; }
 .brand .name span { color: var(--etc-sky); }
 .nav-section-label { color: var(--etc-muted); font-size: 11.5px; letter-spacing: .02em; padding: 16px 12px 8px; }
 .nav-item { position: relative; isolation: isolate; min-height: 44px; border-radius: 12px; font-size: 14px; color: var(--etc-soft); border: 0; padding: 10px 12px; transition: color .3s ease; }
 .nav-item:hover { background: rgba(124, 210, 239, .07); color: #fff; }
 .nav-item.active { background: transparent; border: 0; padding: 10px 12px; color: var(--etc-ink); font-weight: 800; }
 .nav-item.active .ui-icon { color: var(--etc-ink); }
 .nav-pill { position: absolute; inset: 0; z-index: -1; border-radius: 12px; background: linear-gradient(135deg, var(--etc-sky), var(--etc-blue)); box-shadow: 0 8px 24px rgba(67, 174, 227, .28); view-transition-name: etc-nav-pill; pointer-events: none; }

 /* ---- الشريط اللي فوق المحتوى ---- */
 .content-col { min-width: 0; display: flex; flex-direction: column; }
 /* الشريط العلوي فوق المحتوى: view-transition-name بيعمله طبقة لوحده، فمن غير
    z-index كانت قائمة الإشعارات بتتغطى بكروت الصفحة اللي بعده. */
 .topbar { position: relative; z-index: 60; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px clamp(20px, 3vw, 48px) 0; max-width: 1480px; width: 100%; margin: 0 auto; view-transition-name: etc-topbar; }
 .topbar .page-history { margin: 0; }
 .topbar-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--etc-muted); margin-inline-start: auto; }
 .topbar-date::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--etc-blue); }
 .topbar .util-row { border: 0; padding: 0; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
 .topbar .status-pill { order: 0; flex-basis: auto; }
 .topbar .util-btn, .topbar .user-chip summary { background: var(--etc-surface); border: 1px solid var(--etc-line); border-radius: 12px; height: 44px; }
 .topbar .util-btn { width: 44px; }
 .topbar .user-chip { flex: none; }
 .topbar .user-chip .av { background: var(--etc-raised); color: var(--etc-sky); }
 .topbar .notif-menu, .topbar .user-menu { top: calc(100% + 10px); bottom: auto; inset-inline-end: 0; background: var(--etc-raised); border: 1px solid var(--etc-line-strong); }
 .main { padding-top: 22px; }

 /* ---- الأسطح ---- */
 .card, .client-hero, .stat-card, .dash-nav-card, .company-card, .lead-card, .post-card, .svc-card, .catalog-row, .report-period, .cash-summary { background: var(--etc-surface); border-color: var(--etc-line); }
 .card, .client-hero { border-radius: 18px; }
 .company-card:hover, .lead-card:hover, .post-card:hover, .dash-nav-card:hover, .svc-card:hover, .catalog-row:hover { border-color: var(--etc-line-strong); background: var(--etc-surface); }
 .company-card, .lead-card, .post-card, .dash-nav-card { transition: transform .25s ease, border-color .25s ease; }
 .company-card:hover, .lead-card:hover, .post-card:hover, .dash-nav-card:hover { transform: translateY(-2px); }
 .dash-stat-row .stat-card:first-child { background: linear-gradient(140deg, var(--etc-blue), #2B86BF); border: 0; color: var(--etc-ink); }
 .dash-stat-row .stat-card:first-child .stat-lbl, .dash-stat-row .stat-card:first-child .stat-val, .dash-stat-row .stat-card:first-child small { color: var(--etc-ink); }
 .dnc-ic, .cc-avatar-initials, .hero-avatar { background: var(--etc-raised); color: var(--etc-sky); }
 .post-thumb-empty { background: var(--etc-raised); color: var(--etc-sky); }
 .table-scroll { background: var(--etc-surface); }
 table.data-table th { background: var(--etc-raised); color: var(--etc-soft); }
 table.data-table tr:hover td { background: rgba(124, 210, 239, .05); }
 .badge-admin, .post-tag { background: rgba(124, 210, 239, .12); color: var(--etc-sky); }
 .company-tab-card.active, .gate-tab.active { background: rgba(67, 174, 227, .14); color: #fff; border-color: var(--etc-blue); }
 .gate-tab { background: var(--etc-surface); border-color: var(--etc-line); }
 .gate-tabs { background: rgba(11, 18, 54, .6); border-color: var(--etc-line); }
 .modal, .ac-modal, .payment-modal { background: var(--etc-raised); border-color: var(--etc-line-strong); }
 .overlay { background: rgba(3, 7, 24, .78); }
 .trend-bar { background: linear-gradient(to top, var(--etc-blue-dark), var(--etc-sky)); }

 /* ---- الأزرار والحقول ---- */
 .btn-primary { background: linear-gradient(135deg, var(--etc-blue), var(--etc-blue-dark)); color: var(--etc-ink); border: 0; font-weight: 800; box-shadow: 0 6px 18px -8px rgba(67, 174, 227, .6); }
 .btn-primary:hover { background: linear-gradient(135deg, var(--etc-sky), var(--etc-blue)); box-shadow: 0 8px 22px -8px rgba(67, 174, 227, .7); }
 .btn-primary .ui-icon { color: var(--etc-ink); }
 .btn-outline, .btn-cancel { background: transparent; border: 1px solid var(--etc-line-strong); color: var(--etc-text); }
 .btn-outline:hover, .btn-cancel:hover { background: rgba(124, 210, 239, .08); border-color: var(--etc-sky); }
 .btn { border-radius: 12px; transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
 .btn:active:not(:disabled) { transform: scale(.98); }
 .form-field input:not([type=checkbox]):not([type=radio]):not([type=file]), .form-field select, .form-field textarea, .report-period input, .client-search input { background: var(--etc-input); border-color: rgba(124, 210, 239, .2); border-radius: 12px; }
 .form-field input:focus, .form-field select:focus, .form-field textarea:focus, .client-search input:focus { border-color: var(--etc-blue); box-shadow: 0 0 0 3px rgba(67, 174, 227, .18); }
 .form-field select option { background: var(--etc-surface); }
 :focus-visible { outline-color: var(--etc-sky); }

 /* ---- دخول الصفحة: المحتوى بيطلع واحد ورا التاني ---- */
 @keyframes etcRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
 .main > * { animation: etcRise .5s var(--etc-ease) both; }
 .main > *:nth-child(2) { animation-delay: 50ms; } .main > *:nth-child(3) { animation-delay: 100ms; }
 .main > *:nth-child(4) { animation-delay: 150ms; } .main > *:nth-child(5) { animation-delay: 200ms; }
 .main > *:nth-child(6) { animation-delay: 250ms; } .main > *:nth-child(n+7) { animation-delay: 300ms; }
 .company-grid > *, .lead-grid > *, .post-grid > *, .stat-row > *, .dash-nav-grid > * { animation: etcRise .5s var(--etc-ease) both; }
 .company-grid > *:nth-child(2), .lead-grid > *:nth-child(2), .post-grid > *:nth-child(2), .stat-row > *:nth-child(2), .dash-nav-grid > *:nth-child(2) { animation-delay: 60ms; }
 .company-grid > *:nth-child(3), .lead-grid > *:nth-child(3), .post-grid > *:nth-child(3), .stat-row > *:nth-child(3), .dash-nav-grid > *:nth-child(3) { animation-delay: 120ms; }
 .company-grid > *:nth-child(4), .lead-grid > *:nth-child(4), .post-grid > *:nth-child(4), .stat-row > *:nth-child(4), .dash-nav-grid > *:nth-child(4) { animation-delay: 180ms; }
 .company-grid > *:nth-child(n+5), .lead-grid > *:nth-child(n+5), .post-grid > *:nth-child(n+5), .stat-row > *:nth-child(n+5), .dash-nav-grid > *:nth-child(n+5) { animation-delay: 240ms; }

 /* ---- الموبايل ---- */
 @media (min-width: 861px) and (max-width: 1100px) { .shell { grid-template-columns: 228px minmax(0, 1fr); } }
 @media (max-width: 860px) {
  .topnav { background: rgba(11, 18, 54, .97); border-bottom: 1px solid var(--etc-line); view-transition-name: none; }
  .topbar { padding: 12px 16px 0; }
  .topbar .status-pill, .topbar .user-chip .uname { display: none; }
  .topbar .page-history .btn { min-height: 40px; padding: 6px 10px; }
  .topbar .notif-menu, .topbar .user-menu { position: fixed; top: 120px; inset-inline-end: 16px; }
 }
 @media (max-width: 540px) { .topbar-date { display: none; } }
}

/* الانتقال بين الصفحات: الصفحة القديمة بتسيح في الجديدة، والقائمة الجانبية ثابتة،
   والخلفية المنوّرة بتتزحلق من العنصر القديم للجديد. */
@view-transition { navigation: auto; }
/* اسم الانتقال على .main بيتحط من ui-shell.js وقت الانتقال بس: لو فضل ثابت
   بيعمل طبقة (stacking context) بتحبس أي نافذة جوه الصفحة (.overlay) تحت
   القائمة الجانبية والشريط العلوي. */
.main.etc-vt { view-transition-name: etc-main; }
/* الخلفية ثابتة، ومحتوى الصفحة نفسه هو اللي بيتحرك: القديم بيطلع ويبهت،
   والجديد بيدخل من الشمال (اتجاه «قدّام» في العربي). */
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(etc-main) { animation: none; }
::view-transition-old(etc-main), ::view-transition-new(etc-main) { height: 100%; object-fit: none; object-position: top center; }
::view-transition-old(etc-main) { animation: etcPageOut .2s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(etc-main) { animation: etcPageIn .46s cubic-bezier(.2, .8, .2, 1) .08s both; }
@keyframes etcPageOut { to { opacity: 0; transform: translateX(28px) scale(.985); filter: blur(3px); } }
@keyframes etcPageIn { from { opacity: 0; transform: translateX(-40px); filter: blur(4px); } }
::view-transition-group(etc-nav-pill) { animation-duration: .45s; animation-timing-function: cubic-bezier(.3, .8, .2, 1); }
::view-transition-old(etc-nav-pill), ::view-transition-new(etc-nav-pill) { animation: none; mix-blend-mode: normal; }
::view-transition-old(etc-nav-pill) { display: none; }

@media (prefers-reduced-motion: reduce) {
 @view-transition { navigation: none; }
 .main > *, .company-grid > *, .lead-grid > *, .post-grid > *, .stat-row > *, .dash-nav-grid > * { animation: none !important; }
}

/* ---- الدفعة الرابعة: عدّادات القائمة الجانبية وموجة الضغط على الأزرار ---- */
@media screen {
 .nav-count { margin-inline-start: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800; line-height: 1; background: rgba(124, 210, 239, .14); color: var(--etc-sky); font-variant-numeric: tabular-nums; }
 .nav-count.is-warn { background: rgba(248, 113, 113, .16); color: #FCA5A5; }
 .nav-item.active .nav-count { background: rgba(4, 16, 42, .22); color: var(--etc-ink); }
 .btn, .ec-chip, .board-tab { position: relative; overflow: hidden; }
 .etc-ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .22; transform: scale(0); animation: etcRipple .55s ease-out forwards; }
 @keyframes etcRipple { to { transform: scale(1); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { .etc-ripple { display: none; } }

/* ---- الدفعة الخامسة: أزرار الفترات الجاهزة جنب «عرض الفترة» ---- */
@media screen {
 .period-presets { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(4, 16, 42, .4); border: 1px solid var(--etc-line); }
 .period-preset { padding: 7px 12px; min-height: 36px; display: inline-flex; align-items: center; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--etc-muted); text-decoration: none; transition: background .2s, color .2s; }
 .period-preset:hover { color: var(--etc-text); }
 .period-preset[aria-current="true"] { background: var(--etc-raised); color: var(--etc-sky); box-shadow: inset 0 0 0 1px var(--etc-line-strong); }
}

/* ---- الدفعة الخامسة: بحث عام (Ctrl+K)، وزرار «+ جديد»، وطي القائمة ---- */
@media screen {
 .nav-tools { display: flex; gap: 8px; padding: 0 2px 14px; align-items: stretch; }
 .nav-search { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--etc-line); background: rgba(4, 16, 42, .4); color: var(--etc-muted); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .2s, color .2s; }
 .nav-search:hover { color: var(--etc-text); border-color: var(--etc-line-strong); }
 .nav-search kbd, .palette kbd { white-space: nowrap; flex-shrink: 0; }
 .nav-search kbd, .palette kbd { margin-inline-start: auto; font: inherit; font-size: 10.5px; direction: ltr; padding: 2px 6px; border-radius: 6px; background: rgba(124, 210, 239, .1); color: var(--etc-sky); }
 .new-menu { position: relative; }
 .new-btn { list-style: none; min-height: 40px; height: 100%; padding: 0 12px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
 .new-btn::-webkit-details-marker { display: none; }
 .new-btn .ui-icon { width: 18px; height: 18px; }
 .new-menu-list { position: absolute; z-index: 80; top: calc(100% + 8px); inset-inline-end: 0; min-width: 200px; padding: 6px; border-radius: 14px; background: var(--etc-raised); border: 1px solid var(--etc-line-strong); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); display: grid; gap: 2px; animation: etcRise .25s var(--etc-ease) both; }
 .new-menu-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--etc-text); text-decoration: none; font-size: 14px; }
 .new-menu-list a:hover, .new-menu-list a:focus-visible { background: rgba(124, 210, 239, .1); color: #fff; outline: none; }
 .new-menu-list .ui-icon { width: 18px; height: 18px; color: var(--etc-sky); }

 .nav-collapse { display: none; }
 @media (min-width: 861px) {
  .topnav { position: sticky; }
  .nav-collapse { display: grid; place-items: center; position: absolute; top: 18px; inset-inline-end: 12px; width: 32px; height: 32px; border-radius: 10px; }
  .brand { padding-inline-end: 48px; min-width: 0; }
  .brand .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .brand-logo { flex-shrink: 0; }
  .shell { transition: grid-template-columns .3s var(--etc-ease); }
  html.nav-collapsed .shell { grid-template-columns: 84px minmax(0, 1fr); }
  html.nav-collapsed .topnav { padding-inline: 12px; }
  html.nav-collapsed .brand { padding: 44px 0 18px; justify-content: center; }
  html.nav-collapsed .brand .name, html.nav-collapsed .nav-section-label, html.nav-collapsed .nav-label, html.nav-collapsed .nav-search kbd { display: none; }
  html.nav-collapsed .nav-collapse { inset-inline-end: 26px; }
  html.nav-collapsed .nav-collapse .ui-icon { transform: scaleX(-1); }
  html.nav-collapsed .nav-tools { flex-direction: column; padding-inline: 0; }
  html.nav-collapsed .nav-search, html.nav-collapsed .new-btn { justify-content: center; padding: 0; min-height: 44px; }
  html.nav-collapsed .new-menu-list { inset-inline-end: auto; inset-inline-start: 0; }
  /* ui-polish.css بيثبّت حجم خط .nav-item بـ !important، فلازم هنا كمان عشان الاسم يستخبى. */
  html.nav-collapsed .nav-item { font-size: 0 !important; justify-content: center; padding: 10px 0; gap: 0; }
  html.nav-collapsed .new-menu, html.nav-collapsed .new-btn { width: 100%; }
  html.nav-collapsed .brand-logo { width: 54px; max-width: 54px; height: auto; object-fit: contain; }
  html.nav-collapsed .nav-item .ui-icon { width: 21px; height: 21px; }
  html.nav-collapsed .nav-count { position: absolute; top: 4px; inset-inline-start: 6px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; margin: 0; }
  html.nav-collapsed .nav-section-label + .nav-item { margin-top: 10px; }
 }
 @media (max-width: 860px) {
  .nav-tools { display: none; }
  .topnav.nav-open .nav-tools { display: flex; order: 3; width: 100%; padding: 10px 0 0; }
 }

 /* لوحة البحث العام */
 .palette { width: min(620px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 120px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--etc-line-strong); border-radius: 18px; background: var(--etc-side); color: var(--etc-text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden; }
 .palette[open] { animation: etcPalette .22s var(--etc-ease) both; }
 .palette::backdrop { background: rgba(4, 16, 42, .6); backdrop-filter: blur(3px); }
 @keyframes etcPalette { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
 .palette-box { display: flex; flex-direction: column; max-height: inherit; }
 .palette-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--etc-line); color: var(--etc-muted); }
 .palette .palette-field input[type=search] { flex: 1; min-width: 0; width: auto; height: auto; padding: 4px 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--etc-text); font: inherit; font-size: 16px; outline: none; }
 .palette .palette-field input[type=search]::-webkit-search-cancel-button { display: none; }
 .palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
 .palette-list li[role="option"] { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
 .palette-list li[aria-selected="true"] { background: rgba(67, 174, 227, .16); box-shadow: inset 0 0 0 1px rgba(67, 174, 227, .35); }
 .palette-kind { flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(124, 210, 239, .1); color: var(--etc-sky); }
 .palette-label { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
 .palette-hint { margin-inline-start: auto; font-size: 12px; color: var(--etc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
 .palette-empty { padding: 22px; text-align: center; color: var(--etc-muted); }
 .etc-flash { animation: etcFlash 1.4s var(--etc-ease) 2; }
 @keyframes etcFlash { 40% { box-shadow: 0 0 0 4px rgba(67, 174, 227, .55); } }
 .palette-foot { margin: 0; padding: 9px 16px; border-top: 1px solid var(--etc-line); font-size: 12px; color: var(--etc-muted); }
}
@media (prefers-reduced-motion: reduce) { .palette[open], .new-menu-list { animation: none; } .shell { transition: none; } }

/* ---- فريق العميل (إعدادات العميل) ---- */
@media screen {
 .team-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 12px 0 16px; }
 .team-group { margin: 0; padding: 12px 14px; border: 1px solid var(--etc-line); border-radius: 14px; background: rgba(4, 16, 42, .3); display: grid; gap: 6px; }
 .team-group legend { padding: 0 6px; font-weight: 800; font-size: 13.5px; color: var(--etc-sky); }
 .team-alert { border-color: rgba(245, 181, 68, .5); background: rgba(245, 181, 68, .08); }
 .team-alert strong { color: #F5B544; }

 /* المرحلة 4: رأس مختصر لمساحة السوشيال، وقوايم أكشنز منسدلة */
 .ws-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--etc-line); border-radius: 16px; background: var(--etc-surface); }
 .ws-client { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
 .ws-avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: #1d3d55; color: #b1e9ff; font-weight: 800; }
 .ws-avatar-img { object-fit: contain; background: #fff; }
 .ws-name-wrap { display: grid; min-width: 0; }
 .ws-kicker { font-size: 11.5px; color: var(--etc-muted); }
 .ws-name { margin: 0; font-size: 18px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
 .ws-client:hover .ws-name { color: var(--etc-sky); }
 .ws-page-head { margin-top: 18px; align-items: center; }
 .ws-title { margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
 .ws-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
 .act-menu { position: relative; }
 /* القايمة المفتوحة لازم تبقى فوق اللي تحتها في الصفحة (الكروت ليها حركة بتعمل طبقات) */
 .ws-head { position: relative; z-index: 8; }
 .ws-page-head { position: relative; z-index: 6; }
 .card:has(.act-menu[open]), .page-header:has(.act-menu[open]) { position: relative; z-index: 7; }
 .act-menu-btn { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
 .act-menu-btn::-webkit-details-marker { display: none; }
 .act-menu-btn .ui-icon { width: 16px; height: 16px; transition: transform .2s var(--etc-ease); }
 .act-menu[open] .act-menu-btn .ui-icon { transform: rotate(180deg); }
 .act-menu-list { min-width: 270px; }
 .act-menu-label { padding: 8px 10px 2px; font-size: 11.5px; font-weight: 700; color: var(--etc-muted); }
 .gate-tabs.gate-tabs-compact { justify-content: flex-start !important; gap: 8px; padding: 8px; border-radius: 16px; }
 .gate-tabs-compact .gate-tab { flex: 0 0 auto; min-height: 0; flex-direction: row; gap: 7px; padding: 8px 11px; border-radius: 12px; }
 .gate-tabs-compact .gt-ic .ui-icon { width: 18px; height: 18px; }
 .gate-tabs-compact .gt-title { font-size: 12.5px; white-space: nowrap; }
 @media (hover: hover) { .gate-tabs-compact .gate-tab:hover { transform: translateY(-3px); } }

 /* المرحلة 4 — المتابعة (CRM) */
 .fu-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
 .fu-stat { display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--etc-line); background: var(--etc-surface); }
 .fu-stat .lbl { font-size: 12.5px; color: var(--etc-muted); }
 .fu-stat .val { font-size: 26px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
 .fu-stat.is-today { border-color: rgba(124, 210, 239, .45); }
 .fu-stat.is-today .val { color: var(--etc-sky); }
 .fu-stat.is-overdue { border-color: rgba(255, 107, 107, .45); background: rgba(255, 107, 107, .06); }
 .fu-stat.is-overdue .val { color: #FF8A8A; }
 .fu-stat.is-won .val { color: #5BE3A6; }
 @media (max-width: 760px) { .fu-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
 @media (max-width: 1000px) { .followup-col.wide { order: -1; } }

 .followup-col { background: var(--etc-surface); border-color: var(--etc-line); border-radius: 18px; }
 .followup-col-head { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--etc-line); font: inherit; color: inherit; text-align: start; gap: 8px; }
 .followup-col.narrow .followup-col-head { flex-direction: column; align-items: flex-start; }
 .followup-col-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
 .followup-col-head h2 .ui-icon { color: var(--etc-sky); flex-shrink: 0; }
 .followup-col-head:focus-visible { outline: 2px solid var(--etc-sky); outline-offset: 4px; border-radius: 8px; }
 .fu-count { min-width: 30px; padding: 2px 10px; border-radius: 999px; background: rgba(124, 210, 239, .12); color: var(--etc-sky); font-weight: 800; font-size: 13px; text-align: center; }
 .followup-col.narrow .fu-count { font-size: 22px; padding: 4px 14px; }
 .fu-peek { display: none; list-style: none; margin: 4px 0 0; padding: 0; gap: 6px; }
 .followup-col.narrow .fu-peek { display: grid; }
 .followup-col.narrow { cursor: pointer; }
 .fu-peek li { font-size: 12.5px; color: var(--etc-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; border-radius: 10px; background: rgba(4, 16, 42, .35); }
 .fu-peek li.more { color: var(--etc-muted); background: none; padding-block: 0; }
 .followup-col.narrow .fu-tools { display: none; }
 .fu-tools { display: grid; gap: 8px; }
 .fu-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--etc-line); background: var(--etc-input); }
 .fu-search .ui-icon { width: 17px; height: 17px; color: var(--etc-muted); flex-shrink: 0; }
 .fu-search input { flex: 1; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important; padding: 9px 0 !important; color: var(--etc-text); font: inherit; font-size: 13.5px; outline: none; }
 .fu-filters { display: flex; flex-wrap: wrap; gap: 6px; }
 .fu-filter { font: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--etc-line); background: none; color: var(--etc-soft); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
 .fu-filter:hover { border-color: var(--etc-line-strong); color: #fff; }
 .fu-filter[aria-pressed="true"] { background: rgba(67, 174, 227, .18); border-color: var(--etc-blue); color: #fff; }
 .quick-add-box { border-color: var(--etc-line); border-radius: 12px; background: rgba(4, 16, 42, .3); }
 .quick-add-box summary { color: var(--etc-sky); }
 .fu-quick-form { margin-top: 10px; display: grid; gap: 8px; }
 .fu-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1px solid var(--etc-line); background: rgba(4, 16, 42, .35); text-decoration: none; transition: border-color .2s, transform .2s var(--etc-ease), background .2s; }
 .fu-card:hover { border-color: var(--etc-line-strong); background: rgba(23, 33, 82, .6); transform: translateY(-2px); }
 .fu-card[hidden] { display: none; }
 .fu-avatar { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: rgba(67, 174, 227, .16); color: var(--etc-sky); }
 .fu-avatar.is-client { background: rgba(91, 227, 166, .12); color: #5BE3A6; }
 .fu-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
 .fu-card .fc-name { font-size: 14px; color: #fff; }
 .fu-card .fc-sub { font-size: 12px; }
 .fu-card .fc-meta { font-size: 12px; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
 .fu-owner, .fu-when { display: inline-flex; align-items: center; gap: 5px; }
 .fu-owner .ui-icon, .fu-when .ui-icon { width: 14px; height: 14px; }
 .fu-when.is-today { color: var(--etc-sky); font-weight: 700; }
 .fu-when.is-overdue { color: #FF8A8A; font-weight: 800; }
 .fu-when.is-none { color: var(--etc-muted); opacity: .7; }
 .fu-chip { flex-shrink: 0; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(124, 210, 239, .12); color: var(--etc-sky); white-space: nowrap; }
 .fu-chip.st-assigned { background: rgba(167, 139, 250, .15); color: #C4B5FD; }
 .fu-chip.st-following { background: rgba(245, 181, 68, .14); color: #F5B544; }
 .fu-chip.st-won, .fu-chip.st-up_to_date { background: rgba(91, 227, 166, .14); color: #5BE3A6; }
 .fu-chip.st-lost { background: rgba(154, 168, 199, .14); color: var(--etc-muted); }
 .fu-chip.st-needs_followup { background: rgba(255, 107, 107, .14); color: #FF8A8A; }
 .fu-nomatch { margin: 8px 0; text-align: center; color: var(--etc-muted); font-size: 13px; }

 /* المرحلة 4 — صفحة العميل المحتمل ومتابعة العميل الحالي */
 .fu-detail-head { align-items: center; }
 .fu-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
 .fu-who h1 { margin: 0; }
 .fu-who .subtitle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
 .fu-avatar-lg { width: 54px; height: 54px; border-radius: 16px; font-size: 22px; }
 .fu-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; border-radius: 16px; border: 1px solid rgba(67, 174, 227, .35); background: linear-gradient(135deg, rgba(67, 174, 227, .12), rgba(15, 22, 63, .6)); }
 .fu-banner strong { color: #fff; }
 .fu-banner.is-won { justify-content: flex-start; border-color: rgba(91, 227, 166, .35); background: rgba(91, 227, 166, .07); color: var(--etc-soft); }
 .fu-banner.is-won .ui-icon { color: #5BE3A6; }
 .fu-banner a { color: var(--etc-sky); font-weight: 800; }
 .fu-detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
 @media (max-width: 1000px) { .fu-detail { grid-template-columns: 1fr; } }
 .fu-main, .fu-side { display: grid; gap: 16px; min-width: 0; }
 .fu-panel { margin: 0; padding: 18px; border-radius: 18px; }
 .fu-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
 .fu-panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15.5px; font-weight: 800; color: #fff; }
 .fu-panel-head h2 .ui-icon { width: 18px; height: 18px; color: var(--etc-sky); }
 .fu-empty { margin: 6px 0 0; color: var(--etc-muted); font-size: 13.5px; }
 .fu-note-form, .fu-plan-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
 .fu-note-form input, .fu-plan-form input[type=text] { flex: 1; min-width: 200px; }
 .fu-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
 .fu-timeline li { position: relative; padding: 0 22px 16px 0; border-inline-start: 2px solid var(--etc-line); margin-inline-start: 6px; }
 .fu-timeline li:last-child { border-inline-start-color: transparent; padding-bottom: 0; }
 .fu-dot { position: absolute; inset-inline-start: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--etc-blue); box-shadow: 0 0 0 4px rgba(67, 174, 227, .18); }
 .fu-timeline li:first-child .fu-dot { background: var(--etc-sky); }
 .fu-tl-meta { font-size: 12.5px; color: var(--etc-muted); }
 .fu-tl-meta strong { color: var(--etc-soft); }
 .fu-tl-note { margin-top: 4px; color: var(--etc-text); line-height: 1.7; }
 .fu-plans { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
 .fu-plans li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--etc-line); background: rgba(4, 16, 42, .35); }
 .fu-plans li.is-overdue { border-color: rgba(255, 107, 107, .45); background: rgba(255, 107, 107, .06); }
 .fu-plans li.is-today { border-color: rgba(124, 210, 239, .45); }
 .fu-plans li.is-done { opacity: .6; }
 .fu-plan-date { display: grid; min-width: 86px; font-size: 13px; font-weight: 700; color: var(--etc-soft); font-variant-numeric: tabular-nums; }
 .fu-plan-date small { font-size: 11px; font-weight: 800; }
 .is-overdue .fu-plan-date, .is-overdue .fu-plan-date small { color: #FF8A8A; }
 .is-today .fu-plan-date small { color: var(--etc-sky); }
 .fu-plan-text { flex: 1; min-width: 0; color: var(--etc-text); }
 .fu-done { display: inline-flex; align-items: center; gap: 4px; color: #5BE3A6; font-weight: 800; font-size: 13px; }
 .fu-done .ui-icon { width: 15px; height: 15px; }
 .fu-facts { margin: 0; display: grid; gap: 10px; }
 .fu-facts div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--etc-line); }
 .fu-facts div:last-child { border-bottom: 0; padding-bottom: 0; }
 .fu-facts dt { color: var(--etc-muted); font-size: 13px; }
 .fu-facts dd { margin: 0; font-weight: 700; color: #fff; text-align: end; }
 .fu-notes { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(4, 16, 42, .35); }
 .fu-inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--etc-line); }
 .fu-inline-form label { font-size: 13px; color: var(--etc-muted); }
 .fu-inline-form select { flex: 1; min-width: 140px; }
 .fu-qual-edit { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--etc-line); }
 .fu-qual-edit summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--etc-sky); font-weight: 700; font-size: 13.5px; }
 .fu-qual-edit summary .ui-icon { width: 15px; height: 15px; }
 .fu-qual-form { display: grid; gap: 10px; margin-top: 10px; }
 .fu-qual-form .form-field { margin: 0; }
 .fu-chip.pr-hot { background: rgba(255, 107, 107, .14); color: #FF8A8A; }
 .fu-chip.pr-warm { background: rgba(245, 181, 68, .14); color: #F5B544; }
 .fu-chip.pr-cold { background: rgba(124, 210, 239, .12); color: var(--etc-sky); }
 .fu-task-target { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; }
 .fu-task-target a { color: var(--etc-sky); font-weight: 700; }
 /* المرحلة 4 — الموظفين والموردين وأدوات القوايم */
 .list-tools { margin-bottom: 14px; grid-template-columns: minmax(220px, 360px) 1fr; align-items: center; }
 @media (max-width: 760px) { .list-tools { grid-template-columns: 1fr; } }
 [data-list-item][hidden] { display: none !important; }
 .act-menu-danger { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: #FF8A8A; font: inherit; font-size: 14px; cursor: pointer; text-align: start; }
 .act-menu-danger:hover, .act-menu-danger:focus-visible { background: rgba(255, 107, 107, .12); outline: none; }
 .act-menu-list .ui-icon { width: 17px; height: 17px; flex-shrink: 0; }
 .emp-list { padding: 8px; }
 .emp-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
 .emp-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; transition: background .2s; }
 .emp-row:hover { background: rgba(124, 210, 239, .05); }
 .emp-row.is-paused { opacity: .6; }
 .emp-id { display: grid; min-width: 0; text-decoration: none; }
 .emp-name { color: #fff; font-weight: 800; }
 .emp-id:hover .emp-name { color: var(--etc-sky); }
 .emp-sub { font-size: 12.5px; color: var(--etc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
 .emp-cost { display: grid; text-align: end; min-width: 120px; }
 .emp-cost b { color: #fff; font-variant-numeric: tabular-nums; }
 .emp-cost small { font-size: 11.5px; color: var(--etc-muted); }
 .emp-actions { display: flex; gap: 6px; align-items: center; }
 @media (max-width: 900px) {
  .emp-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .emp-row > .fu-chip { display: none; }
  .emp-actions { grid-column: 1 / -1; justify-content: flex-end; }
 }
 .vendor-card { display: flex; flex-direction: column; }
 .vendor-card .cc-link { flex: 1; }
 .vendor-card .cc-name { white-space: normal; overflow: visible; }
 .vendor-due { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(91, 227, 166, .07); color: var(--etc-muted); font-size: 12.5px; }
 .vendor-due b { color: #5BE3A6; font-size: 16px; font-variant-numeric: tabular-nums; }
 .vendor-due.is-owed { background: rgba(255, 107, 107, .08); }
 .vendor-due.is-owed b { color: #FF8A8A; }
 .vendor-services { margin-top: 10px; display: grid; gap: 4px; font-size: 12px; color: var(--etc-muted); }
 .vendor-services b { color: var(--etc-soft); }
 .vendor-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--etc-line); }
 .vendor-foot .toggle-row { display: flex; align-items: center; gap: 8px; margin: 0; }
 .nav-item { white-space: nowrap; }
 /* المرحلة 4 — صفحة الفاتورة */
 .inv-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
 @media (max-width: 760px) { .inv-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
 .inv-progress { grid-column: 1 / -1; position: relative; height: 26px; border-radius: 999px; background: rgba(4, 16, 42, .5); border: 1px solid var(--etc-line); overflow: hidden; }
 .inv-progress span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: linear-gradient(90deg, #2BB673, #5BE3A6); transition: width .8s var(--etc-ease); }
 .inv-progress small { position: relative; display: block; text-align: center; line-height: 24px; font-size: 12px; font-weight: 800; color: #fff; }
 .inv-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
 .inv-modes { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(4, 16, 42, .5); border: 1px solid var(--etc-line); }
 .inv-modes a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; color: var(--etc-soft); text-decoration: none; font-size: 13.5px; font-weight: 700; }
 .inv-modes a .ui-icon { width: 16px; height: 16px; }
 .inv-modes a:hover { color: #fff; }
 .inv-modes a.is-on { background: rgba(67, 174, 227, .2); color: #fff; }
 .inv-modes a.is-on.is-internal { background: rgba(245, 181, 68, .18); color: #F5B544; }
 .inv-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
 .inv-controls form { display: flex; gap: 6px; align-items: center; margin: 0; }
 .inv-add-item summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--etc-sky); }
 .inv-add-item summary .ui-icon { width: 17px; height: 17px; }
 /* الأهداف الشهرية (13 نوفمبر 2026) */
 .tg-meter { position: relative; height: 14px; border-radius: 999px; background: rgba(4, 16, 42, .55); border: 1px solid var(--etc-line); overflow: visible; margin: 8px 0 6px; }
 .tg-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: linear-gradient(90deg, var(--etc-blue), var(--etc-sky)); transition: width .8s var(--etc-ease); }
 .tg-meter.is-ahead .tg-fill { background: linear-gradient(90deg, #2BB673, #5BE3A6); }
 .tg-pace { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-inline-start: -1px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 2px rgba(11, 18, 56, .8); }
 .tg-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--etc-muted); }
 .tg-meta b { color: #fff; font-variant-numeric: tabular-nums; }
 .tg-ok { color: #5BE3A6; font-weight: 700; }
 .tg-late { color: #F5B544; font-weight: 700; }
 .tg-title { display: flex; align-items: baseline; gap: 10px; font-weight: 800; color: #fff; }
 .ec-target-box { margin: 4px 0 12px; }
 .tg-form { display: grid; gap: 12px; margin-top: 14px; }
 .tg-default { max-width: 360px; margin: 0; }
 .tg-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
 .tg-months .form-field { margin: 0; display: grid; gap: 4px; font-size: 13px; color: var(--etc-muted); }
 .tg-clients { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
 .tg-clients li { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--etc-line); background: rgba(4, 16, 42, .3); }
 .tg-client-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
 .tg-client-name { color: #fff; font-weight: 800; text-decoration: none; }
 .tg-client-name:hover { color: var(--etc-sky); }
 .tg-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
 .tg-inline input[type=text] { width: 150px; }
 /* كارت إنجاز اليوم أسفل القائمة الجانبية */
 .today-card { margin: 16px 12px 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--etc-line); background: linear-gradient(160deg, rgba(67, 174, 227, .12), rgba(4, 16, 42, .35)); display: grid; gap: 6px; }
 .today-title { font-size: 12px; font-weight: 800; color: var(--etc-sky); }
 .today-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--etc-soft); }
 .today-row b { color: #fff; font-variant-numeric: tabular-nums; }
 .today-bar { height: 6px; border-radius: 999px; background: rgba(4, 16, 42, .6); overflow: hidden; }
 .today-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2BB673, #5BE3A6); }
 .sidebar.is-collapsed .today-card, .nav-collapsed .today-card { display: none; }
 /* أرشيف المجموعات: قايمة التصدير لازم تطلع برّه الجدول على الشاشات الواسعة */
 .group-archive-scroll { overflow-x: auto; }
 @media (min-width: 900px) { .group-archive-scroll { overflow: visible; } }
}
