/* Portal shell. Extends site.css tokens. */
.demo-bar { background: #fff6df; color: #6b4e00; border-bottom: 1px solid #ecd9a6; font-size: 13px; text-align: center; padding: 7px 16px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--navy); color: #d7def0; padding: 48px 56px; display: flex; flex-direction: column; }
.login-side .brand-text strong { color: var(--white); }
.login-side .brand-text span { color: #a9b6d6; }
.login-side .mark { background: var(--white); padding: 6px 8px; border-radius: 2px; }
.login-side h1 { color: var(--white); font-size: 36px; margin-top: auto; }
.login-side p { margin-top: 14px; max-width: 440px; font-size: 16px; }
.login-side ul { list-style: none; margin: 28px 0 auto; padding: 0; border-top: 1px solid rgba(255,255,255,.2); max-width: 440px; }
.login-side li { padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.14); font-size: 15px; }
.login-side .back { color: #a9b6d6; font-size: 14px; text-decoration: none; margin-top: 40px; }
.login-main { display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; }
.login-box { width: 100%; max-width: 400px; margin: 0 auto; }
.login-box h2 { font-size: 26px; }
.login-box .sub { color: var(--muted); font-size: 15px; margin: 6px 0 28px; }
.login-box .field { margin-bottom: 16px; }
.login-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin: 4px 0 22px; gap: 12px; }
.login-row label { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.login-box .btn { width: 100%; justify-content: center; }
.login-note { margin-top: 22px; font-size: 13px; color: #6b4e00; background: #fff6df; border: 1px solid #ecd9a6; padding: 10px 12px; }
.login-help { margin-top: 18px; font-size: 14px; color: var(--muted); }
.login-top { display: flex; justify-content: flex-end; margin-bottom: auto; }
.login-main .spacer { margin-top: auto; }

/* Dashboard */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 34px); }
.side { background: var(--navy-deep); color: #b9c4de; padding: 22px 0; display: flex; flex-direction: column; }
.side .brand { padding: 0 20px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side .brand img { background: var(--white); padding: 4px 6px; height: 38px; border-radius: 2px; }
.side .brand-text strong { color: var(--white); font-size: 15px; }
.side .brand-text span { color: #8f9cc0; font-size: 12px; }
.side nav { display: flex; flex-direction: column; padding: 14px 0; }
.side nav a { color: #b9c4de; text-decoration: none; padding: 10px 20px; font-size: 14px; border-inline-start: 3px solid transparent; }
.side nav a.active { color: var(--white); background: rgba(255,255,255,.06); border-inline-start-color: var(--blue); }
.side nav a.soon::after { content: attr(data-soon); font-size: 11px; color: #7e8bb0; margin-inline-start: 8px; }
.side .side-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.side .side-foot a { color: #b9c4de; }
.main { background: var(--soft); min-width: 0; }
.bar { background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 14px 28px; flex-wrap: wrap; }
.bar .who { font-size: 14px; color: var(--muted); }
.bar .who strong { color: var(--ink); display: block; font-size: 16px; }
.bar .tools { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
.bar select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid #c3cad8; border-radius: 2px; background: var(--white); max-width: 340px; }
.content { padding: 24px 28px 48px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--white); border: 1px solid var(--line); }
.kpi { padding: 18px 20px; border-inline-start: 1px solid var(--line); }
.kpi:first-child { border-inline-start: 0; }
.kpi span { font-size: 13px; color: var(--muted); display: block; }
.kpi strong { font-size: 28px; color: var(--navy); font-weight: 600; display: block; margin-top: 2px; }
.kpi small { font-size: 13px; color: var(--muted); }
.panel { background: var(--white); border: 1px solid var(--line); margin-top: 20px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; }
.panel-head .filters { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.panel-head input, .panel-head select { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid #c3cad8; border-radius: 2px; background: var(--white); }
.panel-head input { width: 240px; }
.pipeline { display: grid; grid-template-columns: repeat(8, 1fr); }
.pipe { padding: 14px 14px 16px; border-inline-start: 1px solid var(--line); cursor: pointer; background: none; border-top: 0; border-bottom: 0; border-inline-end: 0; text-align: start; font: inherit; color: inherit; }
.pipe:first-child { border-inline-start: 0; }
.pipe:hover { background: var(--soft); }
.pipe.on { background: #eaf3fb; box-shadow: inset 0 -2px 0 var(--blue); }
.pipe .n { font-size: 24px; font-weight: 600; color: var(--navy); }
.pipe .l { font-size: 12px; color: var(--muted); line-height: 1.35; display: block; min-height: 32px; }
.pipe .idx { font-size: 11px; color: var(--blue); font-weight: 600; }
.tbl-wrap { overflow-x: auto; }
table.cands { width: 100%; border-collapse: collapse; font-size: 14px; }
.cands th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
html[lang="ar"] .cands th { letter-spacing: 0; text-transform: none; font-size: 13px; }
.cands td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cands tbody tr { cursor: pointer; }
.cands tbody tr:hover { background: #f7f9fc; }
.cands .nm { font-weight: 600; color: var(--ink); }
.cands .ref { font-size: 12px; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 2px; color: var(--navy); background: #f4f6fa; }
.tag.dep { background: #e8f5ec; border-color: #bfe0c9; color: #1e6b37; }
.tag.hold { background: #fff6df; border-color: #ecd9a6; color: #6b4e00; }
.prog { display: flex; gap: 3px; }
.prog i { width: 14px; height: 6px; background: #dfe4ee; display: block; }
.prog i.f { background: var(--navy); }
.prog i.d { background: #2e8b57; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(18, 37, 96, .35); display: none; z-index: 80; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: 440px; max-width: 100%; background: var(--white); z-index: 90; transform: translateX(105%); transition: transform .2s ease; display: flex; flex-direction: column; border-inline-start: 1px solid var(--line); }
html[dir="rtl"] .drawer { transform: translateX(-105%); }
.drawer.open { transform: none !important; }
.drawer-bg.open { display: block; }
.drawer header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.drawer header h3 { font-size: 19px; }
.drawer header .ref { font-size: 13px; color: var(--muted); }
.drawer .x { background: none; border: 1px solid var(--line); font: inherit; font-size: 13px; padding: 6px 10px; cursor: pointer; border-radius: 2px; }
.drawer .body { padding: 18px 22px 32px; overflow-y: auto; }
.drawer h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 10px; font-weight: 600; }
html[lang="ar"] .drawer h4 { letter-spacing: 0; text-transform: none; font-size: 14px; }
.drawer dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.drawer dl div { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.drawer dt { font-size: 12px; color: var(--muted); }
.drawer dd { margin: 0; font-weight: 500; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; padding: 8px 0; font-size: 14px; align-items: center; border-bottom: 1px solid #eef1f6; }
.tl .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #c3cad8; }
.tl li.f .dot { background: var(--navy); border-color: var(--navy); }
.tl li.cur .dot { background: var(--white); border-color: var(--blue); box-shadow: 0 0 0 3px #d6ebf9; }
.tl li.p { color: var(--muted); }
.tl time { font-size: 12px; color: var(--muted); }
.docs { list-style: none; margin: 0; padding: 0; }
.docs li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #eef1f6; font-size: 14px; }

@media (max-width: 1100px) {
  .pipeline { grid-template-columns: repeat(4, 1fr); }
  .pipe:nth-child(5) { border-inline-start: 0; }
  .pipe:nth-child(n+5) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-side { padding: 28px 20px; }
  .login-side h1 { font-size: 26px; margin-top: 28px; }
  .login-side ul, .login-side .back { display: none; }
  .login-main { padding: 32px 16px 48px; }
  .app { grid-template-columns: 1fr; }
  .side { padding: 12px 0 0; }
  .side .brand { padding: 0 16px 12px; }
  .side nav { flex-direction: row; overflow-x: auto; padding: 0; }
  .side nav a { white-space: nowrap; border-inline-start: 0; border-bottom: 3px solid transparent; padding: 10px 14px; }
  .side nav a.active { border-bottom-color: var(--blue); }
  .side nav a.soon::after { display: none; }
  .side .side-foot { display: none; }
  .bar, .content { padding-left: 16px; padding-right: 16px; }
  .bar .tools { margin-inline-start: 0; width: 100%; }
  .bar select { flex: 1; max-width: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { border-inline-start: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipe:nth-child(odd) { border-inline-start: 0; }
  .pipe:nth-child(even) { border-inline-start: 1px solid var(--line); }
  .pipe:nth-child(n+3) { border-top: 1px solid var(--line); }
  .panel-head .filters, .panel-head input { width: 100%; }
  .panel-head select { flex: 1; }
  .cands .hide-m { display: none; }
}
.pipe .idx, .pipe .n { display: block; }
.side .brand { gap: 10px; }
.side .brand-text strong { white-space: nowrap; font-size: 14px; }
html, body { overflow-x: clip; }
.drawer { visibility: hidden; }
.drawer.open { visibility: visible; }
@media (max-width: 860px) { .app { grid-template-columns: minmax(0, 1fr); } .side, .side nav { min-width: 0; } }
@media (max-width: 860px) { .bar .tools { flex-wrap: wrap; } .bar select { flex: 1 1 100%; } }
