/* PDO Learning — lightweight stylesheet (no external fonts or frameworks) */
:root {
  --primary: #1b5fa3; --primary-dark: #134a80; --primary-light: #e8f0f9;
  --text: #1d2430; --muted: #5f6b7a; --line: #dde3ea; --bg: #f5f7fa; --card: #fff;
  --ok: #1e7b45; --ok-bg: #e5f4ea; --warn: #8a5a00; --warn-bg: #fff4d6; --bad: #b42318; --bad-bg: #fdecea;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif; color: var(--text); background: var(--bg); }
[dir=rtl] body { font-family: "Noto Naskh Arabic", "Jameel Noori Nastaleeq", "Segoe UI", Tahoma, Arial, sans-serif; font-size: 16px; line-height: 1.8; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .8rem; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1.02rem; margin: 1rem 0 .4rem; }
p { margin: .4rem 0 .8rem; }
small, .muted { color: var(--muted); }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: .9em; }

.topbar { display: flex; align-items: center; gap: 12px; background: var(--primary); color: #fff; padding: 0 16px; min-height: 52px; position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; font-size: 1.05rem; }
.topnav { margin-inline-start: auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.topnav a, .topnav .linkbtn { color: #fff; font-size: .92rem; }
.navbtn { display: none; cursor: pointer; font-size: 1.3rem; color: #fff; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--primary); }
form.inline { display: inline; margin: 0; }

.has-sidebar .main { margin-inline-start: 220px; }
.sidebar { position: fixed; top: 52px; bottom: 0; inset-inline-start: 0; width: 220px; background: #fff; border-inline-end: 1px solid var(--line); overflow-y: auto; padding: 10px 0; z-index: 10; }
.sidebar a { display: block; padding: 7px 18px; color: var(--text); font-size: .93rem; }
.sidebar a:hover { background: var(--primary-light); text-decoration: none; }
.sidebar a.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; border-inline-start: 3px solid var(--primary); }
.main { padding: 20px 24px 40px; max-width: 1280px; }
.no-sidebar .main { margin: 0 auto; max-width: 1000px; }
.footer { display: flex; gap: 16px; flex-wrap: wrap; padding: 16px 24px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); background: #fff; }
.has-sidebar .footer { margin-inline-start: 220px; }

@media (max-width: 860px) {
  .navbtn { display: block; }
  .sidebar { display: none; width: 100%; bottom: auto; max-height: 75vh; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
  #navtoggle:checked + .sidebar { display: block; }
  .has-sidebar .main, .has-sidebar .footer { margin-inline-start: 0; }
  .main { padding: 14px 12px 30px; }
  .topnav { gap: 10px; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .n { font-size: 1.55rem; font-weight: 700; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat .s { font-size: .8rem; color: var(--muted); }
.stat.alert .n { color: var(--bad); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn { display: inline-block; background: var(--primary); color: #fff; border: 1px solid var(--primary); padding: 7px 14px; border-radius: 6px; font: inherit; font-size: .92rem; cursor: pointer; line-height: 1.3; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-sec { background: #fff; color: var(--primary); }
.btn-sec:hover { background: var(--primary-light); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn-sm { padding: 3px 9px; font-size: .84rem; }
.btn-lg { padding: 11px 20px; font-size: 1rem; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; font-size: .92rem; }
th { background: #f0f3f7; font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafcff; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.table-wrap table { border: 0; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; background: #f7f9fb; }

form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
label { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 3px; }
.field { margin-bottom: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c5ced8; border-radius: 6px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc0e6; border-color: var(--primary); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 6px 0; }
.check input { margin-top: 4px; }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
.field-error { color: var(--bad); font-size: .84rem; margin-top: 2px; }
.req::after { content: " *"; color: var(--bad); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filters .field { margin: 0; min-width: 140px; }
.filters input, .filters select { padding: 6px 8px; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; border: 1px solid; }
.flash-success { background: var(--ok-bg); border-color: #b5dcc3; color: var(--ok); }
.flash-error { background: var(--bad-bg); border-color: #f3c0bb; color: var(--bad); }
.flash-info { background: var(--primary-light); border-color: #bcd3ec; color: var(--primary-dark); }
.flash-warning { background: var(--warn-bg); border-color: #f0d68a; color: var(--warn); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .78rem; font-weight: 600; background: #eef1f5; color: #3b4654; white-space: nowrap; }
.b-eligible, .b-active, .b-open, .b-received, .b-referred, .b-present, .b-published { background: var(--primary-light); color: var(--primary-dark); }
.b-completed, .b-certified, .b-resolved, .b-placed, .b-reached, .b-filled, .b-high { background: var(--ok-bg); color: var(--ok); }
.b-ineligible, .b-dropped, .b-closed_bad, .b-absent, .b-rejected, .b-revoked, .b-not_interested, .b-low { background: var(--bad-bg); color: var(--bad); }
.b-applied, .b-in_progress, .b-under_review, .b-late, .b-interviewed, .b-offered, .b-draft, .b-medium, .b-at_risk { background: var(--warn-bg); color: var(--warn); }

.progress { height: 8px; background: #e6eaef; border-radius: 4px; overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--ok); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; color: var(--muted); }
.tabs a.on { background: #fff; border-color: var(--line); color: var(--text); font-weight: 600; margin-bottom: -1px; }
.empty { color: var(--muted); padding: 18px; text-align: center; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 10px 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-inline-start: 2px solid var(--line); padding: 0 0 10px 12px; margin-inline-start: 4px; font-size: .9rem; }
[dir=rtl] .timeline li { padding: 0 12px 10px 0; }

/* learning */
.course-card { display: flex; flex-direction: column; }
.course-card h3 { margin: 0 0 6px; }
.course-card .grow { flex: 1; }
.outline { list-style: none; padding: 0; margin: 0; }
.outline li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.outline .done { color: var(--ok); font-weight: 700; }
.lesson-body { font-size: 1.02rem; max-width: 760px; }
.lesson-body img { max-width: 100%; }
.video-box { position: relative; background: #111; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; max-width: 860px; margin-bottom: 12px; }
.video-box iframe, .video-box video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-box .load { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; gap: 6px; cursor: pointer; background: #1d2430; border: 0; width: 100%; font: inherit; }
.video-box .load b { font-size: 2.4rem; line-height: 1; }
.quiz-q { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.quiz-q.right { border-color: #9fd3b2; background: #f4fbf6; }
.quiz-q.wrong { border-color: #f1b4ad; background: #fff7f6; }
.post { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.post .meta { font-size: .82rem; color: var(--muted); margin-bottom: 4px; }

/* certificate */
.cert-wrap { background: #fff; max-width: 1000px; margin: 0 auto; }
.certificate { border: 10px double var(--primary); padding: 40px 50px; text-align: center; aspect-ratio: 1.414 / 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; position: relative; }
.certificate .org { font-size: 1.1rem; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-dark); font-weight: 700; }
.certificate .title { font-size: 2.2rem; font-weight: 700; margin: 10px 0 4px; font-family: Georgia, "Times New Roman", serif; }
.certificate .name { font-size: 1.9rem; font-family: Georgia, "Times New Roman", serif; border-bottom: 1px solid #999; display: inline-block; padding: 0 30px 4px; margin: 8px auto; }
.certificate .course { font-size: 1.3rem; font-weight: 600; }
.certificate .foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 26px; text-align: start; font-size: .9rem; }
.certificate .sign { border-top: 1px solid #555; padding-top: 4px; min-width: 200px; }
.certificate .qr img { width: 110px; height: 110px; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  .topbar, .sidebar, .footer, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .main { margin: 0 !important; padding: 0 !important; max-width: none; }
  .certificate { aspect-ratio: auto; height: 180mm; }
}

.landing-hero { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 28px 24px; margin-bottom: 18px; }
.landing-hero h1 { font-size: 1.7rem; }
.chip { display: inline-block; background: #eef1f5; border-radius: 12px; padding: 1px 9px; font-size: .8rem; margin: 2px; }
.danger-zone { border-color: #f3c0bb; }
.right { text-align: end; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
