/* ============================================================================
   Mizan Consult — Unified Design System (IBM Plex Sans Arabic, #0F2D52, #2563EB)
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --navy: #0F2D52;
  --text: #0F2D52;
  --text-muted: #5B6B80;
  --text-sec: #46566B;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-tint: #EAF1FF;
  --border: #E5EAF1;
  --border-strong: #D5DEEB;
  --green: #0E7A4F;
  --green-bg: #E8F6EF;
  --yellow: #8A5A00;
  --yellow-bg: #FFF4DB;
  --red: #B42318;
  --red-bg: #FDECEA;
  --radius: 12px;
  --font: 'IBM Plex Sans Arabic', Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font);
  color: var(--navy);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* App Shell */
.app { display: flex; direction: rtl; min-height: 100vh; background: var(--bg); }
.sb {
  width: 264px;
  flex: none;
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  direction: rtl;
}
.lg { display: flex; align-items: center; gap: 12px; padding: 0 8px; font-weight: 700; font-size: 17px; }
.lm { width: 42px; height: 42px; border-radius: 12px; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; }
.lt b { display: block; font-size: 17px; line-height: 1.2; color: var(--navy); }
.lt span { font-size: 11px; color: var(--text-muted); letter-spacing: .06em; }
.nvs { display: flex; flex-direction: column; gap: 4px; }
.nv {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14.5px;
  color: var(--text-sec);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nv:hover { background: #F1F5FA; color: var(--navy); }
.nv.on { background: var(--accent-tint); color: var(--accent-hover); font-weight: 600; }
.nv svg { width: 19px; height: 19px; flex: none; }
.nv-divider { font-size: 11.5px; font-weight: 700; color: #8A99AD; padding: 10px 14px 4px; }
.sbf { margin-top: auto; padding: 16px; border-radius: 12px; background: var(--bg); font-size: 13px; color: var(--text-sec); line-height: 1.7; border: 1px solid #EEF2F7; }
.sbf b { color: var(--navy); display: block; margin-bottom: 4px; }

/* Main & Topbar */
.mn { flex: 1; min-width: 0; direction: rtl; display: flex; flex-direction: column; }
.tb { height: 76px; background: #fff; border-bottom: 1px solid var(--border); padding: 0 36px; display: flex; align-items: center; gap: 16px; }
.sr { flex: 1; max-width: 360px; height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--text-muted); font-size: 14px; }
.sr input { border: 0; background: transparent; outline: none; width: 100%; font: 14px var(--font); color: var(--navy); }
.sp { flex: 1; }
.ib { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: var(--navy); display: grid; place-items: center; position: relative; cursor: pointer; }
.ib i { position: absolute; top: 10px; left: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.us { display: flex; align-items: center; gap: 12px; }
.av { width: 42px; height: 42px; border-radius: 50%; background: #DCE7F8; color: var(--navy); display: grid; place-items: center; font-weight: 700; }
.us b { display: block; font-size: 14px; }
.us span { font-size: 12px; color: var(--text-muted); }

/* Content & Cards */
.ct { padding: 32px 36px 48px; display: flex; flex-direction: column; gap: 24px; }
.page { display: none; flex-direction: column; gap: 24px; }
.page.active { display: flex; }
.hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hd h1 { margin: 0 0 6px; font-size: 28px; font-weight: 700; }
.hd p { margin: 0; font-size: 15px; color: var(--text-muted); }
.btn, .cta {
  height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: 600 14.5px var(--font);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .22);
  transition: transform .15s, background .15s;
}
.btn:hover, .cta:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn.o { background: #fff; color: var(--navy); border: 1px solid var(--border-strong); box-shadow: none; }
.btn.o:hover { background: var(--bg); }
.btn.sm { height: 38px; padding: 0 14px; font-size: 13px; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 45, 82, .04), 0 6px 18px rgba(15, 45, 82, .05);
  padding: 24px;
}
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.g2 { display: grid; grid-template-columns: 1.75fr 1fr; gap: 20px; align-items: start; }
.g2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.kh { display: flex; justify-content: space-between; align-items: center; }
.kl { font-size: 14px; color: var(--text-sec); font-weight: 500; }
.ki { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; }
.kv { font-size: 32px; font-weight: 700; margin: 12px 0 8px; letter-spacing: -.01em; }
.kd { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.up { display: inline-flex; align-items: center; gap: 4px; color: var(--green); background: var(--green-bg); padding: 3px 8px; border-radius: 999px; font-weight: 600; direction: ltr; }
.km { color: var(--text-muted); }
.ch { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.ch h3, h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.ch p, .sub { margin: 0; font-size: 14px; color: var(--text-muted); }

/* Journey 4-Steps */
.jr { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; }
.jr:before { content: ""; position: absolute; top: 42px; right: 12%; left: 12%; border-top: 2px dashed #C9D6EA; }
.st { position: relative; text-align: center; padding: 0 12px; }
.sn { position: absolute; top: 0; right: 50%; margin-right: -44px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; border: 3px solid #fff; z-index: 2; }
.si { width: 72px; height: 72px; margin: 6px auto 16px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; border: 6px solid #fff; box-shadow: 0 0 0 1px #DCE7F8; position: relative; z-index: 1; }
.st h4 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.st p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--text-muted); }

/* Charts & Progress */
.ms { display: flex; gap: 28px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #EEF2F7; }
.ms div span { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.ms div b { font-size: 20px; }
.bars { height: 210px; display: flex; align-items: flex-end; gap: 18px; border-bottom: 1px solid var(--border); }
.bc { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; position: relative; }
.bar { width: 100%; max-width: 52px; background: #C7D7F4; border-radius: 8px 8px 0 0; transform-origin: bottom; animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; }
.bar.hi { background: var(--accent); }
.bv { font-size: 12px; color: var(--text-sec); font-weight: 500; }
.bn { position: absolute; bottom: -28px; font-size: 13px; color: var(--text-muted); }
.fq { margin-bottom: 18px; }
.fr { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 8px; font-weight: 500; }
.fr b { color: var(--text-sec); font-size: 14px; }
.tr { height: 8px; border-radius: 99px; background: #EEF2F7; overflow: hidden; }
.fl { height: 100%; border-radius: 99px; background: var(--accent); animation: fill 1s ease-out both; }

/* Tables & Badges */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: right; font-weight: 600; color: var(--text-muted); font-size: 13px; padding: 12px 12px; background: var(--bg); white-space: nowrap; }
th:first-child { border-radius: 0 10px 10px 0; }
th:last-child { border-radius: 10px 0 0 10px; }
td { padding: 15px 12px; border-bottom: 1px solid #EEF2F7; color: #1E3553; }
tr:last-child td { border-bottom: 0; }
tr.sel td { background: #F3F7FF; }
.num, .ltr { font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.bd { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.ok { background: var(--green-bg); color: var(--green); }
.mi { background: var(--red-bg); color: var(--red); }
.wip { background: var(--yellow-bg); color: var(--yellow); }
.bl { background: var(--accent-tint); color: var(--accent-hover); }
.lk { color: var(--accent-hover); font-weight: 600; cursor: pointer; background: none; border: 0; font-family: var(--font); font-size: 13.5px; padding: 0; }
.lk:hover { text-decoration: underline; }

/* Forms, Chips, Toggles & Waves */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; font: 500 13.5px var(--font); color: var(--text-sec); cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 11px 14px;
  font: 14.5px var(--font);
  color: var(--navy);
  background: #fff;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
label.l { display: block; font-size: 13.5px; font-weight: 600; margin: 0 0 7px; color: var(--navy); }
.fld { margin-bottom: 16px; }
.bub { padding: 12px 14px; border-radius: 12px; background: var(--bg); font-size: 14px; line-height: 1.7; margin-top: 10px; }
.bub.a { background: var(--accent-tint); margin-inline-start: 32px; }
.bub small { display: block; color: var(--text-muted); font-size: 12px; margin-bottom: 2px; font-weight: 600; }
.stt { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--green-bg); color: var(--green); font-weight: 600; font-size: 15px; margin: 18px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #12A06A; box-shadow: 0 0 0 4px #CDEBDD; }
.mt { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid #EEF2F7; font-size: 14px; color: var(--text-sec); }
.mt b { font-size: 17px; color: var(--navy); }
.tg { position: relative; width: 44px; height: 26px; display: inline-block; flex: none; }
.tg input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.tg span { position: absolute; inset: 0; border-radius: 99px; background: #C9D6EA; transition: .2s; }
.tg span:after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.tg input:checked+span { background: var(--accent); }
.tg input:checked+span:after { right: 21px; }
.wave { display: flex; align-items: center; gap: 5px; height: 48px; }
.wave i { width: 5px; height: 100%; border-radius: 4px; background: var(--accent); animation: wv 1.2s ease-in-out infinite; }
.wave i:nth-child(2n) { animation-delay: .2s; background: #7FA3EC; }
.wave i:nth-child(3n) { animation-delay: .45s; }
.toast-banner { position: fixed; bottom: 24px; left: 24px; z-index: 9999; background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(15,45,82,.25); display: none; border-right: 4px solid #12A06A; }

@keyframes grow { from { transform: scaleY(0); } }
@keyframes fill { from { width: 0; } }
@keyframes wv { 50% { transform: scaleY(.3); } }
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g2, .g2-eq, .g3, .jr { grid-template-columns: 1fr; }
  .jr:before { display: none; }
}
