/* هوية جامعة بنغازي — منصة الدراسات العليا */
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  --uob-blue: #4A75B8; --uob-navy: #003665; --uob-navy-2: #0b4a85; --uob-gold: #B9B13C; --uob-gold-soft: #f3f1d9;
  --uob-bg: #eef2f8; --uob-ink: #1d2b3a; --uob-muted: #6b7a8c; --uob-line: #dfe6f0;
  --bs-primary: #4A75B8; --bs-primary-rgb: 74, 117, 184; --bs-link-color: #2f5ea8; --bs-link-hover-color: #003665;
  --bs-body-font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif; --bs-body-color: #1d2b3a; --bs-border-radius: .6rem;
}
body { background: var(--uob-bg); font-family: var(--bs-body-font-family); min-height: 100vh; }
.btn-primary { --bs-btn-bg: var(--uob-blue); --bs-btn-border-color: var(--uob-blue); --bs-btn-hover-bg: var(--uob-navy-2); --bs-btn-hover-border-color: var(--uob-navy-2); --bs-btn-active-bg: var(--uob-navy); }
.btn-navy { --bs-btn-color: #fff; --bs-btn-bg: var(--uob-navy); --bs-btn-border-color: var(--uob-navy); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--uob-navy-2); --bs-btn-hover-border-color: var(--uob-navy-2); }
.btn-gold { --bs-btn-color: #2c2a07; --bs-btn-bg: var(--uob-gold); --bs-btn-border-color: var(--uob-gold); --bs-btn-hover-bg: #a59e2f; --bs-btn-hover-border-color: #a59e2f; --bs-btn-hover-color: #fff; }
.text-navy { color: var(--uob-navy) !important; } .text-gold { color: #8d8622 !important; } .bg-navy { background: var(--uob-navy) !important; }
.small-muted { color: var(--uob-muted); font-size: .85rem; }

/* الترويسة */
.topbar { background: linear-gradient(90deg, var(--uob-navy) 0%, #0b4a85 70%, var(--uob-blue) 100%); color: #fff; border-bottom: 4px solid var(--uob-gold); position: sticky; top: 0; z-index: 1030; }
.topbar .brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; }
.topbar .brand img { width: 46px; height: 46px; background: #fff; border-radius: 50%; padding: 2px; }
.topbar .brand .t1 { font-weight: 800; font-size: 1.05rem; line-height: 1.1; }
.topbar .brand .t2 { font-size: .8rem; opacity: .85; }
.topbar .who { font-size: .85rem; text-align: left; line-height: 1.25; }
.topbar .who .role { font-size: .72rem; opacity: .8; }
.topbar .btn-outline-light { --bs-btn-padding-y: .25rem; }

/* الشريط الجانبي */
.layout { display: flex; min-height: calc(100vh - 66px); }
.sidebar { width: 260px; flex-shrink: 0; background: #fff; border-left: 1px solid var(--uob-line); padding: 1rem .75rem; display: flex; flex-direction: column; }
.sidebar .nav-title { font-size: .72rem; color: var(--uob-muted); font-weight: 700; margin: .9rem .6rem .35rem; letter-spacing: .02em; }
.sidebar a.nav-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: .55rem; color: var(--uob-ink); text-decoration: none; font-weight: 500; font-size: .93rem; }
.sidebar a.nav-item i { color: var(--uob-blue); font-size: 1.05rem; }
.sidebar a.nav-item:hover { background: var(--uob-bg); }
.sidebar a.nav-item.active { background: var(--uob-navy); color: #fff; }
.sidebar a.nav-item.active i { color: var(--uob-gold); }
.sidebar .cid-credit { margin-top: auto; padding-top: 1rem; border-top: 1px dashed var(--uob-line); text-align: center; }
.sidebar .cid-credit img { width: 92px; }
.sidebar .cid-credit div { font-size: .72rem; color: var(--uob-muted); margin-top: .25rem; }
.content { flex: 1; padding: 1.5rem 1.75rem 3rem; min-width: 0; }
@media (max-width: 991px) { .sidebar { display: none; } .sidebar.open { display: flex; position: fixed; top: 66px; bottom: 0; right: 0; z-index: 1020; box-shadow: 0 0 30px rgba(0,0,0,.2); overflow-y: auto; } .content { padding: 1rem; } }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.45rem; font-weight: 800; color: var(--uob-navy); margin: 0; }
.page-head h1 i { color: var(--uob-gold); }
.card { border: 1px solid var(--uob-line); border-radius: .9rem; box-shadow: 0 2px 10px rgba(0,54,101,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--uob-line); font-weight: 700; color: var(--uob-navy); border-radius: .9rem .9rem 0 0 !important; }
.stat { background: #fff; border: 1px solid var(--uob-line); border-radius: .9rem; padding: 1rem 1.1rem; display: flex; align-items: center; gap: .9rem; height: 100%; text-decoration: none; color: inherit; }
.stat:hover { border-color: var(--uob-blue); }
.stat .ic { width: 46px; height: 46px; border-radius: .75rem; display: grid; place-items: center; font-size: 1.35rem; background: #e6eef9; color: var(--uob-blue); flex-shrink: 0; }
.stat .ic.gold { background: var(--uob-gold-soft); color: #8d8622; } .stat .ic.navy { background: var(--uob-navy); color: #fff; } .stat .ic.green { background: #e3f4ea; color: #1f8a4c; } .stat .ic.red { background: #fde8e8; color: #c0392b; }
.stat .v { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--uob-navy); }
.stat .l { font-size: .82rem; color: var(--uob-muted); margin-top: .25rem; }
.table { --bs-table-hover-bg: #f3f7fc; }
.table thead th { background: #f5f8fc; color: var(--uob-navy); font-weight: 700; font-size: .85rem; white-space: nowrap; border-bottom: 2px solid var(--uob-line); }
.table td { vertical-align: middle; font-size: .92rem; }
.badge { font-weight: 600; }
.filters { background: #fff; border: 1px solid var(--uob-line); border-radius: .9rem; padding: .85rem; margin-bottom: 1rem; }
.form-label { font-weight: 600; font-size: .9rem; color: #33475b; }
.form-control, .form-select { border-color: #cfd9e6; }
.form-control:focus, .form-select:focus { border-color: var(--uob-blue); box-shadow: 0 0 0 .2rem rgba(74,117,184,.18); }
.mono { font-family: 'Courier New', monospace; direction: ltr; unicode-bidi: embed; }
.ltr { direction: ltr; unicode-bidi: embed; text-align: left; }

/* صفحات الدخول */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: linear-gradient(160deg, var(--uob-navy) 0%, #0b4a85 60%, var(--uob-blue) 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset: auto -120px -120px auto; width: 320px; height: 320px; border-radius: 50%; border: 40px solid rgba(185,177,60,.25); }
.auth-side .uob { width: 150px; height: 150px; background: #fff; border-radius: 50%; padding: 5px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.auth-side h1 { font-weight: 800; font-size: 2rem; margin-top: 1.25rem; }
.auth-side p { opacity: .9; max-width: 420px; }
.auth-side .gold-line { width: 80px; height: 4px; background: var(--uob-gold); border-radius: 4px; margin: .75rem auto; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; background: #fff; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-weight: 800; color: var(--uob-navy); font-size: 1.5rem; }
.auth-card .form-control { padding: .7rem .9rem; }
.auth-foot { margin-top: 2.5rem; display: flex; align-items: center; gap: .75rem; color: var(--uob-muted); font-size: .78rem; }
.auth-foot img { width: 70px; }
.otp-input { font-size: 1.8rem; letter-spacing: .6rem; text-align: center; font-family: 'Courier New', monospace; direction: ltr; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { padding: 2rem 1rem; } .auth-side .uob { width: 96px; height: 96px; } .auth-side h1 { font-size: 1.4rem; } }

.home-hero { background: linear-gradient(160deg, var(--uob-navy) 0%, #0b4a85 60%, var(--uob-blue) 100%); color: #fff; padding: 3.5rem 1rem 5rem; text-align: center; border-bottom: 5px solid var(--uob-gold); }
.home-hero img.uob { width: 130px; height: 130px; background: #fff; border-radius: 50%; padding: 4px; }
.home-cards { margin-top: -3rem; }
.home-card { background: #fff; border-radius: 1rem; padding: 2rem 1.5rem; text-align: center; border: 1px solid var(--uob-line); box-shadow: 0 10px 30px rgba(0,54,101,.08); height: 100%; }
.home-card i { font-size: 2.4rem; color: var(--uob-blue); }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 1.75rem 1.1rem 0; }
.timeline li::before { content: ""; position: absolute; right: .45rem; top: .35rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--uob-blue); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--uob-blue); }
.timeline li::after { content: ""; position: absolute; right: .82rem; top: 1.2rem; bottom: 0; width: 2px; background: var(--uob-line); }
.timeline li:last-child::after { display: none; }
.steps { display: flex; gap: .25rem; flex-wrap: wrap; }
.steps .s { flex: 1; min-width: 120px; text-align: center; padding: .55rem .3rem; font-size: .78rem; border-radius: .5rem; background: #f0f3f8; color: var(--uob-muted); }
.steps .s.done { background: #e3f4ea; color: #1f7a45; font-weight: 700; } .steps .s.cur { background: var(--uob-navy); color: #fff; font-weight: 700; }
.err-list { margin: 0; padding-right: 1rem; font-size: .82rem; color: #b02a37; }
.d-none-js { display: none; }
.qr-box { background: #fff; border: 1px solid var(--uob-line); border-radius: .8rem; padding: .6rem; display: inline-block; }
.w-auto-min { min-width: 160px; }
.table-sm-text td { font-size: .85rem; }
.col-check { width: 36px; }
.text-truncate-300 { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-badge { background: var(--uob-gold-soft); color: #6c6719; border: 1px solid #e4dfae; }
.err-cell { min-width: 260px; }

/* بوابة الطالب */
.student-nav .nav-link { color: var(--uob-navy, #003665); border-radius: 10px; }
.student-nav .nav-link.active { background: #003665; color: #fff; }
.kv { display: grid; grid-template-columns: minmax(140px, 38%) 1fr; gap: .35rem .75rem; font-size: .92rem; }
.kv dt { color: #6b7a8c; font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; }
.proc-where { background: #f0f4fb; border-inline-start: 4px solid #4A75B8; border-radius: 8px; padding: .5rem .75rem; }
.committee li { margin-bottom: .2rem; }

/* شارة الدخول بصفة مستخدم */
.imp-banner { background: repeating-linear-gradient(45deg, #b3261e, #b3261e 14px, #c2382f 14px, #c2382f 28px); color: #fff; position: sticky; top: 0; z-index: 1050; font-size: .92rem; }
.imp-banner .badge { font-size: .78rem; }

/* جرس الإشعارات */
.bell-menu { width: min(380px, 92vw); max-height: 70vh; overflow-y: auto; }
.bell-item { display: flex; gap: .6rem; align-items: flex-start; white-space: normal; padding: .6rem .9rem; border-bottom: 1px solid #eef1f5; }
.bell-item > i { color: #4A75B8; margin-top: .15rem; }
.bell-item .t { display: block; font-size: .9rem; }
.bell-item.unread { background: #f0f5ff; }
.bell-item.unread .t { font-weight: 700; }
.bell-item.unread::after { content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; background: #c9a227; margin-top: .45rem; margin-inline-start: auto; }

/* مستندات مطبوعة (إفادات وقوائم) */
.print-body { background: #e9edf3; }
.print-tools { max-width: 210mm; margin: 16px auto 8px; }
.sheet { background: #fff; max-width: 210mm; margin: 0 auto 24px; padding: 14mm 14mm 10mm; box-shadow: 0 2px 12px rgba(0,0,0,.12); position: relative; }
.sheet::before { content: ""; position: absolute; inset: 0; background: url(/static/img/uob-logo-hd.png) center 45% / 55% no-repeat; opacity: .05; pointer-events: none; }
.doc-head { display: flex; align-items: center; gap: 14px; border-bottom: 3px solid #003665; padding-bottom: 10px; margin-bottom: 16px; }
.doc-head img { width: 82px; height: 82px; }
.doc-head .u { font-size: 1.45rem; font-weight: 800; color: #003665; }
.doc-head .d { font-size: 1.1rem; font-weight: 700; color: #4A75B8; }
.doc-head .e { font-size: .78rem; color: #6b7a8c; direction: ltr; text-align: right; }
.doc-title { text-align: center; font-weight: 800; font-size: 1.35rem; color: #003665; margin: 6px 0 14px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.doc-table th, .doc-table td { border: 1px solid #c9d3e0; padding: 6px 8px; }
.doc-table th { background: #eef3fa; color: #003665; width: 28%; }
.doc-list th { width: auto; }
.doc-qr { display: flex; gap: 14px; align-items: center; margin-top: 16px; border: 1px dashed #c9a227; border-radius: 8px; padding: 10px; }
.doc-qr .qr { width: 110px; height: 110px; }
.doc-qr .qr svg { width: 100%; height: 100%; }
.doc-foot { margin-top: 18px; border-top: 1px solid #c9d3e0; padding-top: 6px; font-size: .72rem; color: #6b7a8c; text-align: center; }
.doc-group { break-inside: avoid-page; }
@media print {
  @page { size: A4; margin: 10mm; }
  body, .print-body { background: #fff !important; }
  .no-print, .imp-banner { display: none !important; }
  .sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .page-break { break-before: page; }
  .doc-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.quality-msg { font-weight: 600; }
.kpi-bar { background: #e9eef6; border-radius: 6px; height: 10px; }
.kpi-bar > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4A75B8, #003665); }

/* نموذج طلب الالتحاق المطبوع */
.doc-sub { font-size: 1rem; font-weight: 600; color: #4A75B8; margin-top: 2px; }
.doc-meta { width: 100%; border-collapse: separate; border-spacing: 6px 0; margin: 0 -6px 12px; }
.doc-meta td { background: #f0f4fb; border: 1px solid #c9d3e0; border-radius: 6px; padding: 5px 8px; text-align: center; width: 25%; }
.doc-meta span { display: block; font-size: .72rem; color: #6b7a8c; }
.doc-meta b { font-size: .88rem; color: #003665; }
.doc-section { margin-bottom: 11px; break-inside: avoid; }
.doc-h { background: #003665; color: #fff; font-weight: 700; font-size: .9rem; padding: 4px 10px; border-radius: 4px 4px 0 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-2col th { width: 17%; }
.doc-2col td { width: 33%; }
.doc-table td, .doc-table th { font-size: .84rem; padding: 4px 7px; }
.doc-hl td { background: #fff8e1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-note { font-size: .72rem; color: #6b7a8c; margin-top: 2px; }
.doc-chk { display: inline-block; margin-inline-end: 14px; white-space: nowrap; }
.doc-decl { font-size: .82rem; line-height: 1.75; text-align: justify; border: 1px solid #c9d3e0; border-top: 0; padding: 6px 10px; margin: 0; }
.doc-sigs { width: 100%; border-collapse: collapse; }
.doc-sigs td { border: 1px solid #c9d3e0; border-top: 0; padding: 6px 10px; vertical-align: top; width: 33%; }
.doc-sigs span { display: block; font-size: .74rem; color: #6b7a8c; }
.doc-sigs b { font-size: .86rem; }
.doc-sigs i { display: block; height: 34px; }
.doc-sigs i.seal { height: 46px; }
.doc-office td { background: #fafbfd; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-qr .qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.pdf-mode .sheet { box-shadow: none; margin: 0; }
.pdf-mode .print-tools { display: none; }
