
:root{
  --navy:#211d42;
  --navy-2:#2B2652;
  --navy-light:#3a3470;
  --teal:#00B8BA;
  --teal-light:#73CBCE;
  --teal-pale:#BAE3E4;
  --green:#68BD49;
  --purple:#423393;
  --bg:#F5F6FA;
  --card:#ffffff;
  --ink:#1E1B38;
  --sub:#726F92;
  --line:#E7E7F0;
  --danger:#E8555A;
  --warn:#E6A93B;
  --radius:16px;
  --shadow: 0 4px 24px rgba(43,38,82,0.07);
  --shadow-lg: 0 12px 40px rgba(43,38,82,0.14);
}
*{box-sizing:border-box; margin:0; padding:0;}
html,body{height:100%;}
body{
  font-family:'IBM Plex Sans Arabic', sans-serif;
  background:var(--bg);
  color:var(--ink);
  overflow-x:hidden;
}
.num, .mono{ font-family:'Poppins','IBM Plex Sans Arabic',sans-serif; }
::-webkit-scrollbar{width:8px; height:8px;}
::-webkit-scrollbar-thumb{background:#d3d3e6; border-radius:8px;}
::-webkit-scrollbar-track{background:transparent;}

/* ===== Layout ===== */
.app{ display:flex; min-height:100vh; }

/* ===== Sidebar ===== */
.sidebar{
  width:270px; flex-shrink:0;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  position:relative; overflow:hidden;
  display:flex; flex-direction:column;
  color:#fff;
}
.sidebar::before{
  content:""; position:absolute; inset:0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,.25) 100%, transparent),
    radial-gradient(1.5px 1.5px at 90px 120px, rgba(255,255,255,.2) 100%, transparent),
    radial-gradient(1px 1px at 150px 60px, rgba(255,255,255,.18) 100%, transparent),
    radial-gradient(1.5px 1.5px at 200px 200px, rgba(255,255,255,.2) 100%, transparent),
    radial-gradient(1px 1px at 60px 250px, rgba(255,255,255,.15) 100%, transparent),
    radial-gradient(1.5px 1.5px at 230px 320px, rgba(255,255,255,.2) 100%, transparent),
    radial-gradient(1px 1px at 40px 400px, rgba(255,255,255,.15) 100%, transparent),
    radial-gradient(1.5px 1.5px at 180px 460px, rgba(255,255,255,.2) 100%, transparent);
  pointer-events:none;
}
.sidebar-inner{ position:relative; z-index:2; display:flex; flex-direction:column; height:100%; }
.brand{ display:flex; align-items:center; gap:12px; padding:28px 24px 22px; border-bottom:1px solid rgba(255,255,255,.08); }
.brand-mark{ width:40px; height:40px; border-radius:50%; background:conic-gradient(from 220deg, var(--purple), var(--teal), var(--green), var(--teal-light), var(--purple)); display:flex; align-items:center; justify-content:center; box-shadow:0 0 0 3px rgba(255,255,255,.06);}
.brand-mark span{ width:26px; height:26px; border-radius:50%; background:var(--navy); }
.brand-text{ line-height:1.1; }
.brand-text b{ font-family:'Poppins'; font-size:19px; letter-spacing:.5px; display:block;}
.brand-text small{ font-size:11px; color:var(--teal-pale); letter-spacing:.5px; }

.nav{ padding:18px 14px; flex:1; overflow-y:auto; }
.nav-group-label{ font-size:11px; color:rgba(255,255,255,.4); padding:14px 12px 6px; letter-spacing:.5px; }
.nav-item{
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border-radius:12px; color:rgba(255,255,255,.75);
  cursor:pointer; font-size:14.5px; margin-bottom:4px; position:relative;
  transition:.2s;
}
.nav-item svg{ width:19px; height:19px; flex-shrink:0; opacity:.85; }
.nav-item:hover{ background:rgba(255,255,255,.06); color:#fff; }
.nav-item.active{ background:linear-gradient(90deg, rgba(0,184,186,.25), rgba(0,184,186,.05)); color:#fff; }
.nav-item.active::before{ content:""; position:absolute; right:0; top:8px; bottom:8px; width:3px; border-radius:3px; background:var(--teal); }
.nav-item .badge{ margin-inline-start:auto; background:var(--danger); color:#fff; font-size:10.5px; padding:1px 7px; border-radius:20px; font-family:'Poppins'; }

.sidebar-foot{ padding:16px 22px 22px; border-top:1px solid rgba(255,255,255,.08); }
.assistant-chip{ display:flex; align-items:center; gap:10px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); border-radius:14px; padding:10px 12px; cursor:pointer;}
.assistant-chip .dot{width:8px;height:8px;border-radius:50%; background:var(--green); box-shadow:0 0 0 3px rgba(104,189,73,.25);}
.assistant-chip small{ display:block; color:rgba(255,255,255,.5); font-size:10.5px;}
.assistant-chip b{font-size:13px; font-weight:600;}

/* ===== Main ===== */
.main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar{
  height:76px; background:var(--card); border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between; padding:0 32px;
  position:sticky; top:0; z-index:20;
}
.page-title{ display:flex; flex-direction:column; gap:2px;}
.page-title h1{ font-size:20px; font-weight:700;}
.page-title span{ font-size:12.5px; color:var(--sub); }
.top-actions{ display:flex; align-items:center; gap:16px; }
.search-box{ display:flex; align-items:center; gap:8px; background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:9px 14px; width:280px; }
.search-box input{ border:none; background:transparent; outline:none; font-family:inherit; font-size:13.5px; width:100%; }
.search-box svg{ width:16px; height:16px; color:var(--sub); flex-shrink:0;}
.icon-btn{ position:relative; width:40px; height:40px; border-radius:12px; background:var(--bg); display:flex; align-items:center; justify-content:center; cursor:pointer; border:1px solid var(--line);}
.icon-btn svg{ width:18px; height:18px; color:var(--navy-2); }
.icon-btn .dot{ position:absolute; top:8px; left:9px; width:8px; height:8px; border-radius:50%; background:var(--danger); border:2px solid #fff; }
.user-chip{ display:flex; align-items:center; gap:10px; padding-inline-start:14px; border-inline-start:1px solid var(--line); }
.avatar{ width:38px; height:38px; border-radius:50%; background:linear-gradient(135deg,var(--purple),var(--teal)); display:flex; align-items:center; justify-content:center; color:#fff; font-family:'Poppins'; font-weight:600; font-size:14px;}
.user-chip .name{font-size:13.5px; font-weight:600;}
.user-chip .role{font-size:11.5px; color:var(--sub);}

.content{ padding:28px 32px 60px; }
.view{ display:none; animation:fadeIn .35s ease; }
.view.active{ display:block; }
@keyframes fadeIn{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }

/* ===== Generic components ===== */
.grid{ display:grid; gap:20px; }
.g4{ grid-template-columns:repeat(4,1fr); }
.g3{ grid-template-columns:repeat(3,1fr); }
.g2{ grid-template-columns:2fr 1fr; }
.g2e{ grid-template-columns:1fr 1fr; }
@media (max-width:1200px){ .g4{grid-template-columns:repeat(2,1fr);} .g3{grid-template-columns:repeat(2,1fr);} .g2{grid-template-columns:1fr;} }

.card{ background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow); padding:22px; border:1px solid var(--line); }
.card-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.card-head h3{ font-size:15.5px; font-weight:700; }
.card-head .link{ font-size:12.5px; color:var(--teal); cursor:pointer; font-weight:600;}
.muted{ color:var(--sub); font-size:12.5px; }

/* KPI orbit cards */
.kpi{ display:flex; align-items:center; gap:16px; }
.orbit{ position:relative; width:74px; height:74px; flex-shrink:0; }
.orbit svg{ width:100%; height:100%; transform:rotate(-90deg); }
.orbit .track{ fill:none; stroke:#EEEEF6; stroke-width:6; }
.orbit .val{ fill:none; stroke-width:6; stroke-linecap:round; }
.orbit .center{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-family:'Poppins'; font-weight:600; font-size:13px;}
.kpi-info b{ font-size:24px; font-family:'Poppins'; font-weight:600; display:block; }
.kpi-info .lbl{ font-size:12.5px; color:var(--sub); margin-top:2px;}
.kpi-info .delta{ font-size:11.5px; margin-top:6px; display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:20px; font-weight:600;}
.delta.up{ background:rgba(104,189,73,.12); color:#4e9635; }
.delta.down{ background:rgba(232,85,90,.12); color:var(--danger); }

/* Badges */
.badge{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; padding:4px 10px; border-radius:20px; white-space:nowrap;}
.badge::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor;}
.badge.b-progress{ background:rgba(0,184,186,.1); color:var(--teal); }
.badge.b-sent{ background:rgba(66,51,147,.1); color:var(--purple); }
.badge.b-wait{ background:rgba(230,169,59,.12); color:var(--warn); }
.badge.b-ok{ background:rgba(104,189,73,.12); color:#4e9635; }
.badge.b-neg{ background:rgba(115,203,206,.15); color:#1a9a9c; }
.badge.b-reject{ background:rgba(232,85,90,.12); color:var(--danger); }
.badge.b-late{ background:rgba(232,85,90,.12); color:var(--danger); }

/* Table */
.table-wrap{ overflow-x:auto; }
table{ width:100%; border-collapse:collapse; font-size:13px; min-width:640px;}
thead th{ text-align:right; color:var(--sub); font-weight:600; font-size:11.5px; padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap;}
tbody td{ padding:13px 12px; border-bottom:1px solid var(--line); vertical-align:middle;}
tbody tr:hover{ background:#FAFAFD; }
tbody tr:last-child td{border-bottom:none;}
.cell-strong{ font-weight:700; }
.ref{ font-family:'Poppins'; font-size:11.5px; color:var(--sub); }

/* Tabs */
.tabs{ display:flex; gap:6px; background:var(--card); padding:6px; border-radius:14px; border:1px solid var(--line); margin-bottom:20px; flex-wrap:wrap; box-shadow:var(--shadow); }
.tab{ padding:9px 16px; border-radius:10px; font-size:13px; font-weight:600; color:var(--sub); cursor:pointer; transition:.2s;}
.tab:hover{ color:var(--ink); }
.tab.active{ background:var(--navy-2); color:#fff; }

.subview{ display:none; } .subview.active{ display:block; animation:fadeIn .3s ease; }

/* progress bar */
.pbar{ height:8px; border-radius:20px; background:#EEEEF6; overflow:hidden; }
.pbar > div{ height:100%; border-radius:20px; background:linear-gradient(90deg,var(--purple),var(--teal)); }

/* alert list */
.alert-item{ display:flex; gap:12px; align-items:flex-start; padding:13px 0; border-bottom:1px solid var(--line);}
.alert-item:last-child{ border-bottom:none; }
.alert-ico{ width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.alert-ico svg{ width:16px; height:16px; }
.alert-ico.warn{ background:rgba(230,169,59,.12); color:var(--warn); }
.alert-ico.err{ background:rgba(232,85,90,.12); color:var(--danger); }
.alert-ico.ok{ background:rgba(104,189,73,.12); color:#4e9635; }
.alert-text b{ font-size:13px; display:block; }
.alert-text span{ font-size:11.5px; color:var(--sub); }

/* stat pill list */
.pill-row{ display:flex; align-items:center; justify-content:space-between; padding:11px 0; border-bottom:1px dashed var(--line); font-size:13px;}
.pill-row:last-child{ border:none; }

/* buttons */
.btn{ display:inline-flex; align-items:center; gap:8px; padding:10px 18px; border-radius:10px; font-size:13px; font-weight:600; cursor:pointer; border:none; font-family:inherit; }
.btn-primary{ background:var(--navy-2); color:#fff; }
.btn-teal{ background:var(--teal); color:#fff; }
.btn-ghost{ background:var(--bg); color:var(--ink); border:1px solid var(--line); }
.btn svg{ width:15px; height:15px; }

/* project card */
.proj-card{ background:var(--card); border-radius:var(--radius); border:1px solid var(--line); overflow:hidden; box-shadow:var(--shadow);}
.proj-top{ height:6px; background:linear-gradient(90deg,var(--purple),var(--teal)); }
.proj-body{ padding:20px; }
.proj-body h4{ font-size:15px; margin-bottom:4px;}
.proj-meta{ display:flex; gap:14px; flex-wrap:wrap; margin:12px 0; font-size:12px; color:var(--sub); }
.proj-meta b{ color:var(--ink); }
.items-row{ display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; }
.item-chip{ font-size:11px; background:var(--bg); border:1px solid var(--line); padding:4px 9px; border-radius:8px; display:flex; align-items:center; gap:5px;}
.item-chip .dot{ width:6px; height:6px; border-radius:50%; }

/* calendar strip */
.cal-strip{ display:flex; gap:12px; overflow-x:auto; padding-bottom:6px;}
.cal-day{ min-width:150px; background:var(--bg); border:1px solid var(--line); border-radius:14px; padding:14px; flex-shrink:0; }
.cal-day .date{ font-family:'Poppins'; font-weight:600; font-size:13px; color:var(--purple); margin-bottom:6px;}
.cal-day .title{ font-size:12.5px; font-weight:600; margin-bottom:4px;}
.cal-day .type{ font-size:10.5px; color:var(--sub);}

/* supplier stars */
.stars{ color:var(--warn); font-size:12px; letter-spacing:1px;}

/* footer note*/
.section-title{ font-size:17px; font-weight:700; margin-bottom:4px;}
.section-sub{ font-size:13px; color:var(--sub); margin-bottom:20px; }

.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:20px;}
@media (max-width:1000px){ .two-col{grid-template-columns:1fr;} }

/* pattern divider */
.pattern-band{
  height:64px; border-radius:var(--radius); margin-bottom:20px; position:relative; overflow:hidden;
  background:linear-gradient(120deg, var(--navy-2), var(--purple) 70%);
  display:flex; align-items:center; padding:0 24px; color:#fff;
}
.pattern-band::before{
  content:""; position:absolute; inset:0; opacity:.5;
  background-image: radial-gradient(1.5px 1.5px at 10% 30%, #fff 100%, transparent), radial-gradient(1.5px 1.5px at 30% 70%, #fff 100%, transparent), radial-gradient(1px 1px at 50% 20%, #fff 100%, transparent), radial-gradient(1.5px 1.5px at 70% 60%, #fff 100%, transparent), radial-gradient(1px 1px at 90% 40%, #fff 100%, transparent), radial-gradient(1.5px 1.5px at 95% 80%, #fff 100%, transparent);
}
.pattern-band span{ position:relative; z-index:2; font-size:13px; font-weight:600;}

/* responsive sidebar toggle */
.menu-toggle{ display:none; }
@media (max-width:960px){
  .sidebar{ position:fixed; z-index:100; height:100vh; transform:translateX(100%); transition:.3s;}
  .sidebar.open{ transform:translateX(0); }
  .menu-toggle{ display:flex; }
  .search-box{ display:none; }
}

/* ===== Breadcrumb / toolbar ===== */
.breadcrumb-bar{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; flex-wrap:wrap; gap:12px; }
.breadcrumb{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--sub); }
.breadcrumb b{ color:var(--ink); font-weight:600; }
.breadcrumb .sep{ opacity:.5; }
.toolbar-actions{ display:flex; align-items:center; gap:10px; }
.chip-btn{ display:inline-flex; align-items:center; gap:7px; padding:8px 14px; border-radius:10px; background:var(--card); border:1px solid var(--line); font-size:12.5px; font-weight:600; color:var(--ink); cursor:pointer;}
.chip-btn:hover{ border-color:var(--teal); color:var(--teal); }
.chip-btn.active{ background:var(--navy-2); color:#fff; border-color:var(--navy-2); }
.view-toggle{ display:flex; gap:8px; }
.chip-btn svg{ width:14px; height:14px; }
.status-legend{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; font-size:11.5px; color:var(--sub); margin-bottom:16px;}
.status-legend .lg-item{ display:flex; align-items:center; gap:6px; }
.status-legend .dot{ width:8px; height:8px; border-radius:50%; }

/* ===== Table toolbar: search / filter / sort ===== */
.table-toolbar{ display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.tbl-search{ display:flex; align-items:center; gap:8px; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:8px 12px; flex:1; min-width:180px; max-width:320px;}
.tbl-search input{ border:none; background:transparent; outline:none; font-family:inherit; font-size:12.5px; width:100%; }
.tbl-search svg{ width:14px; height:14px; color:var(--sub); flex-shrink:0;}
.filter-chip{ display:flex; align-items:center; gap:6px; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:8px 12px; font-size:12px; font-weight:600; color:var(--sub); cursor:pointer;}
.filter-chip.active{ background:rgba(0,184,186,.1); border-color:var(--teal); color:var(--teal); }
th.sortable{ cursor:pointer; user-select:none; }
th.sortable .arrows{ display:inline-flex; flex-direction:column; margin-inline-start:4px; vertical-align:middle; opacity:.4; }
th.sortable:hover .arrows{ opacity:.9; }
th.sortable svg{ width:9px; height:9px; display:block; }
tr.row-click{ cursor:pointer; }
tr.hidden-row{ display:none; }

/* ===== Pagination ===== */
.pagination{ display:flex; align-items:center; justify-content:space-between; margin-top:16px; padding-top:14px; border-top:1px solid var(--line); font-size:12px; color:var(--sub);}
.page-btns{ display:flex; gap:6px; }
.page-btn{ width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; background:var(--bg); border:1px solid var(--line); cursor:pointer; font-family:'Poppins'; font-size:12px;}
.page-btn.active{ background:var(--navy-2); color:#fff; border-color:var(--navy-2);}

/* ===== Overlay + Drawer ===== */
.overlay{ position:fixed; inset:0; background:rgba(17,14,38,.45); backdrop-filter:blur(2px); z-index:200; opacity:0; pointer-events:none; transition:.25s; }
.overlay.show{ opacity:1; pointer-events:auto; }
.drawer{ position:fixed; top:0; bottom:0; left:0; width:420px; max-width:92vw; background:var(--card); z-index:201; box-shadow:var(--shadow-lg); transform:translateX(-100%); transition:.3s cubic-bezier(.2,.9,.3,1); display:flex; flex-direction:column;}
.drawer.show{ transform:translateX(0); }
.drawer-head{ padding:20px 22px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; background:linear-gradient(120deg,var(--navy-2),var(--purple)); color:#fff; }
.drawer-head .ref{ color:rgba(255,255,255,.65); }
.drawer-head h3{ font-size:16px; margin-top:2px;}
.drawer-close{ width:32px; height:32px; border-radius:10px; background:rgba(255,255,255,.12); display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;}
.drawer-close svg{ width:16px; height:16px; color:#fff;}
.drawer-body{ padding:22px; overflow-y:auto; flex:1; }
.drawer-section{ margin-bottom:22px; }
.drawer-section h4{ font-size:12px; color:var(--sub); text-transform:uppercase; letter-spacing:.5px; margin-bottom:10px; font-weight:700;}
.drawer-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.drawer-field{ background:var(--bg); border-radius:10px; padding:10px 12px;}
.drawer-field span{ display:block; font-size:11px; color:var(--sub); margin-bottom:3px;}
.drawer-field b{ font-size:13px; }
.timeline{ position:relative; padding-inline-start:22px; }
.timeline::before{ content:""; position:absolute; right:6px; top:4px; bottom:4px; width:2px; background:var(--line); }
.timeline-item{ position:relative; padding-bottom:18px; }
.timeline-item::before{ content:""; position:absolute; right:-22px; top:2px; width:10px; height:10px; border-radius:50%; background:var(--teal); border:2px solid #fff; box-shadow:0 0 0 2px var(--teal);}
.timeline-item b{ font-size:12.5px; display:block;}
.timeline-item span{ font-size:11.5px; color:var(--sub);}
.drawer-foot{ padding:18px 22px; border-top:1px solid var(--line); display:flex; gap:10px; }
.drawer-foot .btn{ flex:1; justify-content:center; }

/* ===== Notification dropdown ===== */
.notif-panel{ position:absolute; top:60px; left:32px; width:340px; background:var(--card); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-lg); z-index:150; opacity:0; pointer-events:none; transform:translateY(-8px); transition:.2s; overflow:hidden;}
.notif-panel.show{ opacity:1; pointer-events:auto; transform:none; }
.notif-panel .nhead{ padding:16px 18px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center;}
.notif-panel .nhead b{ font-size:13.5px; }
.notif-panel .nhead span{ font-size:11.5px; color:var(--teal); cursor:pointer; font-weight:600;}
.notif-list{ max-height:340px; overflow-y:auto; }
.notif-row{ display:flex; gap:11px; padding:13px 18px; border-bottom:1px solid var(--line); cursor:pointer; }
.notif-row:hover{ background:var(--bg); }
.notif-row:last-child{ border:none; }
.notif-row b{ font-size:12.5px; display:block; }
.notif-row span{ font-size:11px; color:var(--sub); }

/* ===== Kanban ===== */
.kanban{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; align-items:start; }
@media (max-width:1100px){ .kanban{ grid-template-columns:repeat(2,1fr);} }
.kanban-col{ background:var(--bg); border-radius:14px; padding:14px; }
.kanban-col-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; padding:0 2px;}
.kanban-col-head b{ font-size:12.5px; }
.kanban-col-head span{ font-size:11px; background:#fff; border:1px solid var(--line); padding:1px 8px; border-radius:20px; font-family:'Poppins';}
.kcard{ background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px; margin-bottom:10px; box-shadow:0 2px 8px rgba(43,38,82,.05); cursor:grab; }
.kcard b{ font-size:12.5px; display:block; margin-bottom:6px;}
.kcard .kmeta{ display:flex; justify-content:space-between; align-items:center; font-size:10.5px; color:var(--sub);}
.kcard .avatar-mini{ width:22px; height:22px; border-radius:50%; background:linear-gradient(135deg,var(--purple),var(--teal)); color:#fff; display:flex; align-items:center; justify-content:center; font-size:9px; font-family:'Poppins'; font-weight:600;}

/* ===== FAB ===== */
.fab{ position:fixed; bottom:28px; left:28px; width:56px; height:56px; border-radius:50%; background:linear-gradient(135deg,var(--purple),var(--teal)); display:flex; align-items:center; justify-content:center; box-shadow:0 10px 30px rgba(0,184,186,.4); cursor:pointer; z-index:60; transition:.2s;}
.fab:hover{ transform:scale(1.06); }
.fab svg{ width:24px; height:24px; color:#fff; }

/* ===== Permission matrix ===== */
.perm-table td, .perm-table th{ text-align:center; }
.perm-table td:first-child, .perm-table th:first-child{ text-align:right; }
.check{ width:20px; height:20px; border-radius:6px; display:inline-flex; align-items:center; justify-content:center; }
.check.yes{ background:rgba(104,189,73,.15); color:#4e9635; }
.check.no{ background:rgba(232,85,90,.08); color:var(--danger); opacity:.5;}
.check svg{ width:12px; height:12px; }

.tooltip{ position:relative; }
.tooltip:hover::after{ content:attr(data-tip); position:absolute; bottom:120%; right:50%; transform:translateX(50%); background:var(--navy); color:#fff; font-size:10.5px; padding:5px 9px; border-radius:6px; white-space:nowrap; z-index:50; }

.countdown{ font-family:'Poppins'; font-weight:600; }
.role-tag{ font-size:10.5px; font-weight:700; padding:2px 9px; border-radius:20px; background:rgba(66,51,147,.1); color:var(--purple); }

/* ===== Real form fields (new request) ===== */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:16px; }
.form-field{ display:flex; flex-direction:column; gap:6px; }
.form-field.full{ grid-column:1/-1; }
.form-field label{ font-size:11.5px; color:var(--sub); font-weight:600; }
.form-field input, .form-field select, .form-field textarea{ border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-family:inherit; font-size:13px; background:var(--bg); outline:none; transition:.2s; color:var(--ink); width:100%; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus{ border-color:var(--teal); background:#fff; box-shadow:0 0 0 3px rgba(0,184,186,.1); }
.form-field textarea{ resize:vertical; min-height:64px; font-family:inherit; }
.field-required::after{ content:" *"; color:var(--danger); }
.row-fade-in{ animation:rowFadeIn .5s ease; }
@keyframes rowFadeIn{ from{ background:rgba(0,184,186,.18);} to{ background:transparent; } }
.row-fade-out{ animation:rowFadeOut .4s ease forwards; }
@keyframes rowFadeOut{ to{ opacity:0; transform:translateX(-12px); } }
.action-btn{ display:inline-flex; align-items:center; gap:5px; padding:6px 12px; border-radius:8px; background:rgba(0,184,186,.1); color:var(--teal); font-size:11.5px; font-weight:700; cursor:pointer; border:1px solid transparent; white-space:nowrap;}
.action-btn:hover{ background:var(--teal); color:#fff; }
.action-btn svg{ width:12px; height:12px; }
.toast.err{ border-inline-start:4px solid var(--danger); }

/* ===== Item status pipeline stepper ===== */
.stepper{ display:flex; flex-direction:column; gap:0; }
.step{ display:flex; gap:12px; position:relative; padding-bottom:18px; }
.step:last-child{ padding-bottom:0; }
.step::before{ content:""; position:absolute; right:9px; top:22px; bottom:0; width:2px; background:var(--line); }
.step:last-child::before{ display:none; }
.step-dot{ width:20px; height:20px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; z-index:1; background:#fff; border:2px solid var(--line); }
.step.done .step-dot{ background:#4e9635; border-color:#4e9635; }
.step.done .step-dot svg{ width:11px; height:11px; color:#fff; }
.step.current .step-dot{ background:var(--teal); border-color:var(--teal); box-shadow:0 0 0 4px rgba(0,184,186,.15); }
.step-label{ font-size:12.5px; padding-top:1px; }
.step.done .step-label{ color:var(--sub); }
.step.current .step-label{ font-weight:700; color:var(--ink); }
.step.pending .step-label{ color:var(--sub); opacity:.6; }
.step-editable{ cursor:pointer; border-radius:8px; transition:.15s; }
.step-editable:hover{ background:rgba(0,184,186,.08); }
.step-editable:hover .step-dot{ box-shadow:0 0 0 3px rgba(0,184,186,.2); }
.step-editable:hover .step-label{ color:var(--teal); opacity:1; }

/* ===== Focus states / accessibility ===== */
:focus-visible{ outline:2px solid var(--teal); outline-offset:2px; border-radius:6px; }
.skip-link{ position:absolute; right:-999px; top:0; background:var(--navy-2); color:#fff; padding:10px 16px; z-index:999; border-radius:0 0 10px 10px; }
.skip-link:focus{ right:0; }

/* ===== Toasts ===== */
.toast-wrap{ position:fixed; bottom:28px; right:32px; z-index:400; display:flex; flex-direction:column; gap:10px; }
.toast{ display:flex; align-items:center; gap:10px; background:var(--navy); color:#fff; padding:13px 18px; border-radius:12px; box-shadow:var(--shadow-lg); font-size:13px; min-width:260px; transform:translateY(10px); opacity:0; animation:toastIn .35s forwards; }
.toast.ok{ border-inline-start:4px solid var(--green); }
.toast.info{ border-inline-start:4px solid var(--teal); }
@keyframes toastIn{ to{ transform:none; opacity:1; } }
.toast svg{ width:18px; height:18px; flex-shrink:0; color:var(--teal-light); }
.toast.err svg{ color:#ff9a9e; }

/* ===== Skeleton loading ===== */
.skeleton-overlay{ position:absolute; inset:0; background:var(--bg); z-index:30; padding:28px 32px; display:none; }
.skeleton-overlay.show{ display:block; }
.sk{ background:linear-gradient(90deg,#EDEDF6 25%, #F7F7FC 37%, #EDEDF6 63%); background-size:400% 100%; animation:shimmer 1.3s ease infinite; border-radius:12px; }
@keyframes shimmer{ 0%{background-position:100% 0;} 100%{background-position:0 0;} }
.sk-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; margin-bottom:20px; }
.sk-card{ height:96px; }
.sk-block{ height:260px; }
.content{ position:relative; }

/* ===== Empty state ===== */
.empty-state{ text-align:center; padding:50px 20px; display:none; }
.empty-state.show{ display:block; }
.empty-state svg{ width:52px; height:52px; color:var(--line); margin-bottom:14px; }
.empty-state b{ display:block; font-size:14px; margin-bottom:4px; }
.empty-state span{ font-size:12.5px; color:var(--sub); }

/* ===== Saved filters ===== */
.saved-filters{ display:flex; align-items:center; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.saved-filters .sf-label{ font-size:11.5px; color:var(--sub); }
.sf-chip{ display:flex; align-items:center; gap:6px; background:linear-gradient(135deg,rgba(66,51,147,.08),rgba(0,184,186,.08)); border:1px solid var(--teal-pale); color:var(--purple); font-size:11.5px; font-weight:700; padding:6px 12px; border-radius:20px; cursor:pointer;}
.sf-chip svg{ width:11px; height:11px; }

/* ===== Gantt ===== */
.gantt{ overflow-x:auto; }
.gantt-grid{ min-width:760px; }
.gantt-head{ display:grid; grid-template-columns:190px repeat(8,1fr); font-size:11px; color:var(--sub); padding-bottom:10px; border-bottom:1px solid var(--line); margin-bottom:10px;}
.gantt-head span{ text-align:center; }
.gantt-row{ display:grid; grid-template-columns:190px repeat(8,1fr); align-items:center; height:44px; position:relative;}
.gantt-row .g-label{ font-size:12px; font-weight:600; padding-inline-end:10px;}
.gantt-track{ grid-column:2 / -1; position:relative; height:22px; background:repeating-linear-gradient(90deg, transparent, transparent calc(12.5% - 1px), var(--line) calc(12.5% - 1px), var(--line) 12.5%); border-radius:6px;}
.gantt-bar{ position:absolute; top:0; height:22px; border-radius:6px; background:linear-gradient(90deg,var(--purple),var(--teal)); display:flex; align-items:center; padding:0 10px; font-size:10.5px; color:#fff; font-weight:600; white-space:nowrap; overflow:hidden;}
.gantt-bar.late{ background:linear-gradient(90deg,#c94a4f,var(--danger)); }
.gantt-bar.done{ background:linear-gradient(90deg,#4e9635,var(--green)); }
.gantt-today{ position:absolute; top:-6px; bottom:-6px; width:2px; background:var(--warn); }
.gantt-today::after{ content:"اليوم"; position:absolute; top:-18px; right:-14px; font-size:9px; color:var(--warn); font-weight:700;}

/* ===== Command palette ===== */
.cmdk-overlay{ position:fixed; inset:0; background:rgba(17,14,38,.55); backdrop-filter:blur(3px); z-index:500; display:none; align-items:flex-start; justify-content:center; padding-top:12vh;}
.cmdk-overlay.show{ display:flex; }
.cmdk-box{ width:560px; max-width:92vw; background:var(--card); border-radius:18px; box-shadow:var(--shadow-lg); overflow:hidden; }
.cmdk-input-wrap{ display:flex; align-items:center; gap:10px; padding:16px 20px; border-bottom:1px solid var(--line);}
.cmdk-input-wrap svg{ width:18px; height:18px; color:var(--sub); flex-shrink:0;}
.cmdk-input-wrap input{ border:none; outline:none; font-family:inherit; font-size:15px; width:100%; }
.cmdk-input-wrap kbd{ font-family:'Poppins'; font-size:10.5px; background:var(--bg); border:1px solid var(--line); border-radius:6px; padding:2px 7px; color:var(--sub);}
.cmdk-results{ max-height:340px; overflow-y:auto; padding:10px;}
.cmdk-group{ font-size:10.5px; color:var(--sub); padding:8px 10px 4px; text-transform:uppercase; letter-spacing:.5px;}
.cmdk-item{ display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:10px; cursor:pointer; font-size:13px;}
.cmdk-item:hover, .cmdk-item.sel{ background:var(--bg); }
.cmdk-item .cico{ width:32px; height:32px; border-radius:9px; background:rgba(0,184,186,.1); color:var(--teal); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.cmdk-item .cico svg{ width:15px; height:15px;}
.cmdk-item small{ display:block; color:var(--sub); font-size:11px;}
.cmdk-hint{ padding:10px 20px; border-top:1px solid var(--line); font-size:11px; color:var(--sub); display:flex; gap:16px;}

/* ===== Draggable KPI cards ===== */
.kpi-drag[draggable="true"]{ cursor:grab; }
.kpi-drag.dragging{ opacity:.4; }
.kpi-drag.drag-over{ outline:2px dashed var(--teal); outline-offset:4px; }
.drag-hint{ font-size:11px; color:var(--sub); display:flex; align-items:center; gap:6px; margin-bottom:12px;}
.drag-hint svg{ width:13px; height:13px;}

/* ===== Lang toggle ===== */
.lang-toggle{ display:flex; align-items:center; gap:4px; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:3px; font-family:'Poppins'; font-size:11.5px; font-weight:600;}
.lang-toggle span{ padding:6px 10px; border-radius:8px; cursor:pointer; color:var(--sub);}
.lang-toggle span.active{ background:var(--navy-2); color:#fff; }
body.lang-en{ }
body.lang-en [data-i18n]{ }

/* ===== Print ===== */
@media print{
  .sidebar, .topbar, .fab, .overlay, .drawer, .notif-panel, .cmdk-overlay, .toast-wrap, .breadcrumb-bar, .tabs, .skeleton-overlay{ display:none !important; }
  .main{ width:100%; }
  .content{ padding:0; }
  .view{ display:block !important; }
  .subview{ display:block !important; margin-bottom:24px; }
  body{ background:#fff; }
  .card{ box-shadow:none; border:1px solid #ddd; break-inside:avoid; }
}
