/* ═══ أنماط المنصة المتصلة ═══ */

/* شاشة الدخول */
#login{position:fixed;inset:0;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--brand-darker),var(--brand-deep) 60%,var(--brand));z-index:100}
#login::before{content:'';position:absolute;left:-10%;top:-10%;width:500px;height:500px;
  background:radial-gradient(circle,rgba(1,219,154,.2),transparent 65%)}
.login-card{position:relative;background:var(--surface);border-radius:var(--r-xl);
  padding:40px 38px;width:400px;max-width:92vw;box-shadow:var(--shadow-lg);text-align:center}
.login-logo{height:88px;margin:0 auto 8px;display:block}
.login-title{font-family:var(--font-display);font-size:20px;font-weight:700;margin-top:6px}
.login-sub{font-size:13px;color:var(--ink-faint);margin-bottom:26px}
.login-field{text-align:right;margin-bottom:16px}
.login-field label{font-size:13px;font-weight:500;display:block;margin-bottom:7px}
.login-field input{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:var(--r-sm);
  font-family:inherit;font-size:14px;transition:all .16s var(--ease)}
.login-field input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-tint)}
.login-btn{width:100%;background:var(--brand);color:#fff;padding:13px;border-radius:var(--r-sm);
  font-size:15px;font-weight:600;margin-top:8px;transition:all .16s var(--ease)}
.login-btn:hover{background:var(--brand-deep)}
.login-btn:disabled{opacity:.6;cursor:not-allowed}
.login-err{color:var(--danger);font-size:13px;margin-top:12px;min-height:18px}
.login-hint{margin-top:22px;padding-top:18px;border-top:1px solid var(--line-soft);
  font-size:12px;color:var(--ink-faint);line-height:1.8}
.login-hint b{color:var(--ink-soft)}
.login-accounts{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:10px}
.login-chip{font-size:11.5px;background:var(--surface-alt);padding:4px 10px;border-radius:20px;
  cursor:pointer;transition:all .14s;font-family:var(--font-mono)}
.login-chip:hover{background:var(--brand-soft);color:var(--brand)}

/* التطبيق */
.app{display:flex;min-height:100vh}
.hidden{display:none!important}

/* الشريط الجانبي */
.sidebar{width:var(--sidebar-w);background:var(--brand-darker);color:#cddbe4;
  position:fixed;inset:0 0 0 auto;right:0;display:flex;flex-direction:column;z-index:40;
  transition:transform .3s var(--ease)}
.brand{padding:22px 24px 20px;border-bottom:1px solid rgba(255,255,255,.08);text-align:center}
.brand-logo{height:74px;margin:0 auto 4px;display:block}
.brand-divider{width:44px;height:2px;margin:12px auto;
  background:linear-gradient(90deg,var(--teal),var(--mint));border-radius:2px}
.brand-name{font-family:var(--font-display);font-weight:700;font-size:15px;color:#fff}
.brand-sub{font-size:11.5px;color:#8fb4c4;margin-top:2px}
.nav{padding:14px 12px;flex:1;overflow-y:auto}
.nav-label{font-size:10.5px;letter-spacing:.8px;color:#6d94a6;padding:14px 12px 6px;font-weight:600}
.nav-item{display:flex;align-items:center;gap:11px;padding:9.5px 12px;border-radius:var(--r-sm);
  font-size:14px;color:#bccdd8;transition:all .16s var(--ease);position:relative;margin-bottom:1px}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:var(--brand);color:#fff;font-weight:500}
.nav-item.active::before{content:'';position:absolute;right:-12px;top:50%;transform:translateY(-50%);
  width:3px;height:20px;background:var(--mint);border-radius:2px}
.nav-item svg{width:18px;height:18px;flex-shrink:0;opacity:.85}
.nav-item .badge{margin-inline-start:auto;font-size:11px;font-weight:600;
  background:rgba(1,219,154,.2);color:#7fe5c4;padding:1px 8px;border-radius:20px;font-family:var(--font-mono)}
.nav-user{padding:14px;border-top:1px solid rgba(255,255,255,.08);display:flex;align-items:center;gap:11px}
.avatar{width:36px;height:36px;border-radius:10px;flex-shrink:0;
  background:linear-gradient(135deg,var(--teal),var(--mint));display:grid;place-items:center;
  color:#fff;font-weight:600;font-size:13px;font-family:var(--font-display)}
.nav-user-info{flex:1;min-width:0}
.nav-user-name{font-size:13.5px;color:#fff;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-user-role{font-size:11.5px;color:#8fb4c4}
.logout-btn{color:#8fb4c4;padding:6px;border-radius:6px;transition:all .14s}
.logout-btn:hover{background:rgba(255,255,255,.08);color:#fff}
.logout-btn svg{width:17px;height:17px}

/* المحتوى */
.main{flex:1;margin-right:var(--sidebar-w);min-width:0;display:flex;flex-direction:column}
.topbar{height:66px;background:rgba(246,248,250,.85);backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);display:flex;align-items:center;gap:16px;
  padding:0 32px;position:sticky;top:0;z-index:30}
.menu-btn{display:none;width:40px;height:40px;border-radius:var(--r-sm);align-items:center;justify-content:center}
.page-title{font-family:var(--font-display);font-size:20px;font-weight:700}
.page-crumb{font-size:12.5px;color:var(--ink-faint);margin-top:-2px}
.content{padding:28px 32px 60px;flex:1}
.screen{display:none;animation:fadeUp .4s var(--ease)}
.screen.active{display:block}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* مشترك */
.section-head{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:18px;gap:16px;flex-wrap:wrap}
.section-title{font-family:var(--font-display);font-size:17px;font-weight:600}
.section-desc{font-size:13px;color:var(--ink-soft);margin-top:2px}
.eyebrow{font-size:11px;letter-spacing:1.2px;color:var(--brand);font-weight:600;
  text-transform:uppercase;margin-bottom:6px;display:flex;align-items:center;gap:8px}
.eyebrow::before{content:'';width:18px;height:2px;background:var(--accent);border-radius:2px}
.btn{display:inline-flex;align-items:center;gap:8px;padding:10px 18px;border-radius:var(--r-sm);
  font-size:13.5px;font-weight:500;transition:all .16s var(--ease);white-space:nowrap}
.btn svg{width:16px;height:16px}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary:hover{background:var(--brand-deep);transform:translateY(-1px);box-shadow:var(--shadow)}
.btn-ghost{background:var(--surface);border:1px solid var(--line);color:var(--ink-soft)}
.btn-ghost:hover{border-color:var(--brand);color:var(--brand)}
.btn-danger{background:var(--danger-soft);color:var(--danger)}
.btn-danger:hover{background:#f0d8d5}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow-sm)}
.status{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:500;padding:3px 10px;border-radius:20px}
.status::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}
.status.OPEN{background:#eef1ef;color:#6b7c88}
.status.IN_PROGRESS{background:#e8f0f5;color:var(--info)}
.status.SUBMITTED{background:#e8f0f5;color:var(--info)}
.status.UNDER_REVIEW{background:#f5efdb;color:#a07b28}
.status.APPROVED,.status.CLOSED{background:#e3f2ea;color:var(--ok)}
.status.RETURNED{background:var(--danger-soft);color:var(--danger)}
.status.overdue{background:var(--danger-soft);color:var(--danger)}
.chip{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:500;
  padding:2px 9px;border-radius:6px;background:var(--surface-alt);color:var(--ink-soft)}
.chip.CRITICAL{background:var(--danger-soft);color:var(--danger)}
.chip.HIGH{background:var(--gold-soft);color:var(--gold)}
.spinner{width:32px;height:32px;border:3px solid var(--line);border-top-color:var(--brand);
  border-radius:50%;animation:spin .7s linear infinite;margin:40px auto}
@keyframes spin{to{transform:rotate(360deg)}}
.empty{text-align:center;padding:50px 20px;color:var(--ink-faint)}
.empty svg{width:48px;height:48px;opacity:.4;margin-bottom:12px}

/* لوحة المؤشرات */
.board-hero{background:linear-gradient(120deg,var(--brand-darker),var(--brand-deep) 50%,var(--brand));
  border-radius:var(--r-xl);padding:32px 34px;color:#fff;position:relative;overflow:hidden;margin-bottom:22px}
.board-hero::after{content:'';position:absolute;left:-60px;top:-80px;width:340px;height:340px;
  background:radial-gradient(circle,rgba(1,219,154,.32),rgba(0,170,206,.12) 45%,transparent 70%)}
.hero-inner{position:relative;z-index:1;display:flex;justify-content:space-between;align-items:flex-start;gap:24px;flex-wrap:wrap}
.hero-eyebrow{font-size:11.5px;letter-spacing:1.5px;color:var(--mint);font-weight:600;margin-bottom:12px}
.hero-big{font-family:var(--font-display);font-size:58px;font-weight:900;line-height:1}
.hero-big small{font-size:26px;opacity:.7}
.hero-label{font-size:14px;color:#c5dae4;margin-top:10px;max-width:360px}
.hero-mini{display:flex;gap:26px;flex-wrap:wrap}
.hero-mini-val{font-family:var(--font-display);font-size:26px;font-weight:700}
.hero-mini-lbl{font-size:12px;color:#9fc5d4;margin-top:2px}
.kpi-row{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:20px;box-shadow:var(--shadow-sm);transition:all .2s var(--ease)}
.kpi:hover{box-shadow:var(--shadow);transform:translateY(-2px)}
.kpi-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;margin-bottom:14px}
.kpi-icon svg{width:20px;height:20px}
.kpi.g1 .kpi-icon{background:var(--accent-soft);color:var(--accent)}
.kpi.g2 .kpi-icon{background:var(--gold-soft);color:var(--gold)}
.kpi.g3 .kpi-icon{background:#e8f0f5;color:var(--info)}
.kpi.g4 .kpi-icon{background:var(--danger-soft);color:var(--danger)}
.kpi-val{font-family:var(--font-display);font-size:32px;font-weight:600;line-height:1}
.kpi-lbl{font-size:13px;color:var(--ink-soft);margin-top:5px}
.board-grid{display:grid;grid-template-columns:1.5fr 1fr;gap:16px}
.dept-row{display:flex;align-items:center;gap:14px;padding:13px 24px;transition:background .16s}
.dept-row:hover{background:var(--surface-alt)}
.dept-rank{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;
  font-family:var(--font-mono);font-size:12px;font-weight:600;background:var(--surface-alt);color:var(--ink-soft);flex-shrink:0}
.dept-row:first-child .dept-rank{background:linear-gradient(135deg,var(--teal),var(--mint));color:#fff}
.dept-info{flex:1;min-width:0}
.dept-name{font-size:13.5px;font-weight:500}
.dept-bar-track{height:5px;background:var(--line-soft);border-radius:3px;margin-top:6px;overflow:hidden}
.dept-bar-fill{height:100%;border-radius:3px;transition:width .6s var(--ease)}
.dept-pct{font-family:var(--font-mono);font-size:14px;font-weight:600;flex-shrink:0}
.risk-item{display:flex;gap:13px;padding:13px 0;border-bottom:1px solid var(--line-soft)}
.risk-item:last-child{border:none;padding-bottom:0}
.risk-dot{width:9px;height:9px;border-radius:50%;margin-top:7px;flex-shrink:0}
.risk-dot.crit{background:var(--danger)}.risk-dot.warn{background:var(--warn)}
.risk-title{font-size:13.5px;font-weight:500}
.risk-meta{font-size:12px;color:var(--ink-faint);margin-top:2px}

/* بطاقات المهام */
.inbox-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:20px}
.mini-stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:15px 16px;
  cursor:pointer;transition:all .18s var(--ease);border-inline-start:3px solid transparent}
.mini-stat:hover{box-shadow:var(--shadow);transform:translateY(-2px)}
.mini-stat.sel{border-inline-start-color:var(--brand);background:var(--brand-tint)}
.mini-stat-val{font-family:var(--font-display);font-size:26px;font-weight:600;line-height:1}
.mini-stat-lbl{font-size:12.5px;color:var(--ink-soft);margin-top:4px}
.mini-stat.danger .mini-stat-val{color:var(--danger)}
.mini-stat.warn .mini-stat-val{color:var(--warn)}
.task-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  padding:18px 20px;box-shadow:var(--shadow-sm);margin-bottom:12px;transition:all .2s var(--ease);
  cursor:pointer;position:relative;overflow:hidden}
.task-card:hover{box-shadow:var(--shadow);border-color:var(--brand-soft);transform:translateX(-3px)}
.task-card::before{content:'';position:absolute;inset:0 auto 0 0;width:4px;background:var(--brand);opacity:0;transition:opacity .2s}
.task-card:hover::before{opacity:1}
.task-top{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px}
.task-title{font-size:15px;font-weight:600;font-family:var(--font-display)}
.task-src{font-size:12px;color:var(--ink-faint);margin-top:3px}
.task-meta{display:flex;align-items:center;gap:16px;flex-wrap:wrap;font-size:12.5px;color:var(--ink-soft)}
.task-meta-item{display:flex;align-items:center;gap:6px}
.pipeline{display:flex;align-items:center;margin-top:14px;padding-top:14px;border-top:1px solid var(--line-soft)}
.pl-node{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;flex-shrink:0;
  font-size:11px;font-weight:600;border:2px solid var(--line);background:var(--surface);color:var(--ink-faint)}
.pl-node.done{background:var(--brand);border-color:var(--brand);color:#fff}
.pl-node.current{border-color:var(--brand);color:var(--brand);box-shadow:0 0 0 4px var(--brand-tint)}
.pl-line{flex:1;height:2px;background:var(--line);margin:0 4px}
.pl-line.done{background:var(--brand)}
.pl-label{font-size:11.5px;color:var(--ink-faint);font-weight:500;margin:0 6px}
.pl-label.active{color:var(--brand);font-weight:600}

/* تفاصيل + نموذج */
.detail-layout{display:grid;grid-template-columns:1fr 320px;gap:18px;align-items:start}
.detail-main{display:flex;flex-direction:column;gap:16px}
.dh-title{font-family:var(--font-display);font-size:21px;font-weight:600;line-height:1.3}
.dh-tags{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.dh-obligation{background:var(--brand-tint);border:1px solid var(--brand-soft);border-radius:var(--r);padding:16px 18px;margin-top:16px}
.dh-ob-label{font-size:11px;letter-spacing:.8px;color:var(--brand);font-weight:600;margin-bottom:6px}
.dh-ob-text{font-size:13.5px;line-height:1.7}
.dh-ob-ref{font-family:var(--font-mono);font-size:12px;color:var(--ink-soft);margin-top:8px}
.field{margin-bottom:18px}
.field-label{font-size:13.5px;font-weight:500;margin-bottom:8px;display:flex;gap:5px}
.field-req{color:var(--danger)}
.input,.textarea{width:100%;padding:11px 14px;border:1px solid var(--line);border-radius:var(--r-sm);
  font-family:inherit;font-size:13.5px;transition:all .16s var(--ease)}
.input:focus,.textarea:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-tint)}
.textarea{resize:vertical;min-height:80px;line-height:1.6}
.form-actions{display:flex;gap:10px;padding:18px 0 0;flex-wrap:wrap}
.side-card{padding:20px}
.side-title{font-size:13px;font-weight:600;color:var(--ink-soft);margin-bottom:16px}
.meta-row{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid var(--line-soft);font-size:13px}
.meta-row:last-child{border:none}
.meta-k{color:var(--ink-faint)}.meta-v{font-weight:500}
.timeline{padding-inline-start:8px}
.tl-item{position:relative;padding-inline-start:22px;padding-bottom:18px}
.tl-item::before{content:'';position:absolute;right:5px;top:16px;bottom:-2px;width:2px;background:var(--line)}
.tl-item:last-child::before{display:none}
.tl-item.done::before{background:var(--brand)}
.tl-node{position:absolute;right:0;top:2px;width:13px;height:13px;border-radius:50%;
  border:2px solid var(--line);background:var(--surface)}
.tl-item.done .tl-node{background:var(--brand);border-color:var(--brand)}
.tl-title{font-size:13px;font-weight:500}
.tl-meta{font-size:11.5px;color:var(--ink-faint);margin-top:2px}

/* لوحة الاعتماد */
.review-layout{display:grid;grid-template-columns:1fr 340px;gap:18px;align-items:start}
.ev-item{margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid var(--line-soft)}
.ev-item:last-child{border:none;margin:0;padding:0}
.ev-label{font-size:12px;color:var(--ink-faint);font-weight:500;margin-bottom:5px}
.ev-val{font-size:14px;line-height:1.7}
.score-widget{text-align:center;padding:14px 0}
.score-ring{width:120px;height:120px;margin:0 auto;position:relative}
.score-num{position:absolute;inset:0;display:grid;place-items:center;flex-direction:column}
.score-big{font-family:var(--font-display);font-size:34px;font-weight:700}
.score-lbl{font-size:11px;color:var(--ink-faint)}
.score-slider{width:100%;margin:16px 0 6px;-webkit-appearance:none;height:6px;border-radius:4px;background:var(--line)}
.score-slider::-webkit-slider-thumb{-webkit-appearance:none;width:22px;height:22px;border-radius:50%;
  background:var(--brand);cursor:pointer;border:3px solid #fff;box-shadow:0 2px 6px rgba(47,109,132,.4)}
.decision-actions{display:flex;flex-direction:column;gap:10px;margin-top:18px}
.decision-actions .btn{width:100%;justify-content:center;padding:12px}
.sod-notice{display:flex;gap:10px;padding:12px 14px;background:var(--brand-tint);border:1px solid var(--brand-soft);
  border-radius:var(--r-sm);margin-top:14px;font-size:12px;color:var(--brand-deep);line-height:1.5}
.sod-notice svg{width:16px;height:16px;color:var(--brand);flex-shrink:0;margin-top:1px}
.sod-notice.blocked{background:var(--danger-soft);border-color:#f0d0cc;color:var(--danger)}
.sod-notice.blocked svg{color:var(--danger)}

/* جداول */
table{width:100%;border-collapse:collapse}
thead th{text-align:right;font-size:11.5px;font-weight:600;color:var(--ink-faint);
  padding:12px 22px;border-bottom:1px solid var(--line);background:var(--surface-alt)}
tbody td{padding:15px 22px;font-size:13.5px;border-bottom:1px solid var(--line-soft)}
tbody tr:last-child td{border:none}
tbody tr{transition:background .14s}
tbody tr:hover{background:var(--brand-tint)}
.avatar-sm{width:28px;height:28px;border-radius:8px;background:var(--brand-soft);color:var(--brand);
  display:grid;place-items:center;font-size:11px;font-weight:600;font-family:var(--font-display)}
.assignee{display:flex;align-items:center;gap:8px}
.td-title{font-weight:500}.td-sub{font-size:12px;color:var(--ink-faint);margin-top:1px}
.role-tag{display:inline-flex;font-size:11.5px;font-weight:500;padding:3px 10px;border-radius:6px;
  background:var(--brand-soft);color:var(--brand);margin:2px}
.oblig-source{display:inline-flex;font-size:12px;font-weight:500;padding:3px 10px;border-radius:6px}
.oblig-source.REGULATION{background:var(--brand-soft);color:var(--brand)}
.oblig-source.BOARD_DECISION{background:var(--gold-soft);color:var(--gold)}
.oblig-source.AUDIT{background:#e8f0f5;color:var(--info)}
.oblig-source.INTERNAL{background:var(--surface-alt);color:var(--ink-soft)}

/* توست */
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(80px);
  background:var(--brand-deep);color:#fff;padding:13px 22px;border-radius:var(--r);font-size:14px;
  box-shadow:var(--shadow-lg);z-index:200;opacity:0;transition:all .3s var(--ease);display:flex;align-items:center;gap:10px}
.toast.show{transform:translateX(-50%) translateY(0);opacity:1}
.toast.err{background:var(--danger)}
.toast svg{width:18px;height:18px}

@media(max-width:1100px){.board-grid,.detail-layout,.review-layout{grid-template-columns:1fr}
  .kpi-row{grid-template-columns:repeat(2,1fr)}.inbox-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:820px){.sidebar{transform:translateX(100%)}.sidebar.open{transform:none}
  .main{margin-right:0}.menu-btn{display:flex}.content{padding:20px}.topbar{padding:0 20px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ═══ النافذة المنبثقة (modal) ═══ */
.modal-overlay{position:fixed;inset:0;background:rgba(43,74,94,.45);backdrop-filter:blur(3px);
  z-index:150;display:grid;place-items:center;padding:20px;animation:fadeIn .2s var(--ease)}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.modal{background:var(--surface);border-radius:var(--r-xl);box-shadow:var(--shadow-lg);
  width:520px;max-width:100%;max-height:90vh;display:flex;flex-direction:column;
  animation:modalUp .28s var(--ease)}
.modal.wide{width:720px}
@keyframes modalUp{from{opacity:0;transform:translateY(20px) scale(.98)}to{opacity:1;transform:none}}
.modal-head{display:flex;align-items:center;justify-content:space-between;
  padding:20px 24px;border-bottom:1px solid var(--line)}
.modal-title{font-family:var(--font-display);font-size:17px;font-weight:600}
.modal-close{width:32px;height:32px;border-radius:8px;color:var(--ink-faint);font-size:16px;
  transition:all .14s}
.modal-close:hover{background:var(--surface-alt);color:var(--ink)}
.modal-body{padding:22px 24px;overflow-y:auto}
.modal-foot{display:flex;justify-content:flex-start;gap:10px;
  padding:16px 24px;border-top:1px solid var(--line)}
.modal-foot .btn{min-width:100px;justify-content:center}
select.input{cursor:pointer;background:var(--surface)}

/* ═══ المرفقات ═══ */
.attach-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--line);
  border-radius:var(--r-sm);margin-bottom:8px;transition:all .16s var(--ease)}
.attach-item:hover{border-color:var(--brand-soft);background:var(--brand-tint)}
.attach-item:last-child{margin-bottom:0}
.attach-icon{width:38px;height:38px;border-radius:9px;flex-shrink:0;display:grid;place-items:center;
  background:var(--brand-soft);color:var(--brand)}
.attach-icon svg{width:20px;height:20px}
.attach-info{flex:1;min-width:0}
.attach-name{font-size:13.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.attach-meta{font-size:11.5px;color:var(--ink-faint);margin-top:2px}
.attach-dl{width:34px;height:34px;border-radius:8px;flex-shrink:0;display:grid;place-items:center;
  color:var(--ink-soft);transition:all .14s}
.attach-dl:hover{background:var(--brand);color:#fff}
.attach-dl svg{width:17px;height:17px}

/* ═══ السجل التاريخي المبرز (بعد الإغلاق) ═══ */
.history-highlight{border:2px solid var(--brand-soft);box-shadow:0 4px 16px rgba(47,109,132,.1)}
.history-highlight .side-title{color:var(--brand);font-size:14px}

/* ═══ التبويبات (المطلوب/المنجزة) ═══ */
.tabs-bar{display:flex;gap:4px;margin-bottom:20px;background:var(--surface-alt);padding:4px;border-radius:var(--r);width:fit-content}
.tab-btn{padding:9px 20px;border-radius:var(--r-sm);font-size:13.5px;font-weight:500;color:var(--ink-soft);transition:all .16s var(--ease)}
.tab-btn:hover{color:var(--ink)}
.tab-btn.active{background:var(--surface);color:var(--brand);box-shadow:var(--shadow-sm);font-weight:600}

/* ═══ جرس التنبيهات ═══ */
.notif-bell{position:relative;width:40px;height:40px;border-radius:var(--r-sm);display:grid;place-items:center;color:var(--ink-soft);transition:all .14s}
.notif-bell:hover{background:var(--surface-alt);color:var(--brand)}
.notif-bell svg{width:20px;height:20px}
.notif-dot{position:absolute;top:7px;right:8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--danger);color:#fff;font-size:10px;font-weight:700;display:grid;place-items:center;font-family:var(--font-mono)}
.notif-panel{position:absolute;top:54px;left:20px;width:340px;max-width:90vw;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow-lg);z-index:80;overflow:hidden;animation:fadeUp .2s var(--ease)}
.notif-head{padding:14px 18px;border-bottom:1px solid var(--line);font-weight:600;font-size:14px;font-family:var(--font-display)}
.notif-list{max-height:380px;overflow-y:auto}
.notif-item{padding:13px 18px;border-bottom:1px solid var(--line-soft);cursor:pointer;transition:background .14s;display:flex;gap:11px}
.notif-item:hover{background:var(--surface-alt)}
.notif-item.unread{background:var(--brand-tint)}
.notif-icon{width:32px;height:32px;border-radius:8px;flex-shrink:0;display:grid;place-items:center}
.notif-icon.OVERDUE{background:var(--danger-soft);color:var(--danger)}
.notif-icon.DUE_SOON{background:var(--gold-soft);color:var(--gold)}
.notif-icon svg{width:16px;height:16px}
.notif-title{font-size:13px;font-weight:500;line-height:1.4}
.notif-body{font-size:12px;color:var(--ink-faint);margin-top:2px}
.notif-empty{padding:40px 20px;text-align:center;color:var(--ink-faint);font-size:13px}

/* ═══ خطوة الإسناد في السجل (بالأسماء) ═══ */
.chain-item{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line-soft)}
.chain-item:last-child{border:none}
.chain-avatar{width:34px;height:34px;border-radius:9px;flex-shrink:0;display:grid;place-items:center;font-size:12px;font-weight:600;font-family:var(--font-display)}
.chain-role{font-size:11px;color:var(--ink-faint);margin-bottom:1px}
.chain-name{font-size:13.5px;font-weight:500}
.chain-date{font-size:11.5px;color:var(--ink-faint);margin-top:2px}
