:root {
  --navy: #1f3a6b;
  --navy-2: #284b85;
  --blue: #5aa9f0;
  --gold: #f2b533;
  --bg: #f4f7fb;
  --bs-font-sans-serif: 'Cairo', system-ui, sans-serif;
}
body { font-family: 'Cairo', system-ui, sans-serif; background: var(--bg); color: #1d2433; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; background: linear-gradient(180deg, var(--navy), #16294d);
  color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1040;
}
.sidebar .brand { background: #fff; padding: 12px 14px 8px; text-align: center; border-bottom: 4px solid var(--gold); }
.sidebar .brand img { max-width: 100%; height: 86px; object-fit: contain; }
.sidebar .brand-sub { color: var(--navy); font-weight: 700; font-size: .85rem; margin-top: 2px; }
.sidebar nav { padding: 10px 8px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; color: #d6e2f5; text-decoration: none;
  padding: 9px 12px; border-radius: 10px; margin-bottom: 2px; font-weight: 600; font-size: .95rem;
}
.sidebar nav a i { font-size: 1.1rem; color: var(--blue); }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: var(--gold); color: #1d2433; }
.sidebar nav a.active i { color: #1d2433; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid #e3e8f0; position: sticky; top: 0; z-index: 1030; }
.content { padding: 22px; flex: 1; }
@media (max-width: 991px) {
  .sidebar { position: fixed; right: -260px; transition: right .25s; }
  .sidebar.open { right: 0; box-shadow: -5px 0 25px rgba(0,0,0,.25); }
  .content { padding: 14px; }
}
.page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title h1 { font-size: 1.45rem; font-weight: 800; margin: 0; color: var(--navy); }
.card { border: 0; border-radius: 14px; box-shadow: 0 1px 3px rgba(20,40,80,.08); }
.card-header { background: #fff; font-weight: 700; color: var(--navy); border-bottom: 2px solid var(--bg); border-radius: 14px 14px 0 0 !important; }
.stat { padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat .icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; }
.stat .num { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.stat .lbl { color: #6b778c; font-size: .9rem; }
.btn-primary { background: var(--navy); border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1d2433; font-weight: 700; }
.btn-gold:hover { background: #e5a51f; }
.table { vertical-align: middle; }
.table thead th { background: #eef3fa; color: var(--navy); font-weight: 700; white-space: nowrap; }
.form-section { background: #fff; border-radius: 14px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(20,40,80,.08); overflow: hidden; }
.form-section > h5 { background: var(--navy); color: #fff; margin: 0; padding: 10px 16px; font-size: 1rem; font-weight: 700; border-right: 6px solid var(--gold); }
.form-section > .body { padding: 16px; }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.req::after { content: ' *'; color: #d63939; }
.att-grid .btn-check + .btn { min-width: 70px; }
.marks-input { width: 80px; text-align: center; }
.public { min-height: 100vh; background: linear-gradient(135deg, #eaf3fe, #fff7e3); }
.login-card { max-width: 420px; margin: 6vh auto; }
.login-card img { height: 120px; object-fit: contain; }
.fail-mark { color: #d63939; font-weight: 700; }
td.num, th.num { text-align: center; }

/* ===== الطباعة ===== */
@media print {
  .sidebar, .topbar, .no-print, footer, .btn, .alert { display: none !important; }
  .content { padding: 0; }
  body, .public { background: #fff !important; }
  .card { box-shadow: none; }
  @page { size: A4; margin: 10mm; }
}
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* استمارة EMIS المطبوعة */
.emis { background: #fff; max-width: 210mm; margin: 0 auto; padding: 8mm; border: 6px double var(--navy); font-size: 13.5px; }
.emis .head { background: var(--navy); color: #fff; text-align: center; padding: 8px; border-radius: 4px; position: relative; }
.emis .head .t1 { font-size: 13px; }
.emis .head .t2 { font-size: 18px; font-weight: 800; }
.emis .logo-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.emis .logo-row img { height: 70px; }
.emis h6 { color: var(--navy); font-weight: 800; margin: 12px 0 4px; border-bottom: 3px solid #1d2433; padding-bottom: 3px; }
.emis .f { display: inline-block; margin: 5px 0 5px 14px; }
.emis .f b { font-weight: 700; }
.emis .v { display: inline-block; min-width: 110px; border-bottom: 1px dotted #555; padding: 0 4px; font-weight: 600; color: #0c2a5c; }
.emis .v.w { min-width: 180px; }
.emis .box { display: inline-block; width: 14px; height: 14px; border: 1.5px solid #222; vertical-align: middle; margin-left: 4px; text-align: center; line-height: 11px; font-size: 12px; font-weight: 800; }
.emis .note { color: #c62828; font-size: 12px; font-weight: 700; }
.emis .photo { width: 85px; height: 105px; border: 1.5px dashed #888; display: grid; place-items: center; color: #888; font-size: 11px; overflow: hidden; }
.emis .photo img { width: 100%; height: 100%; object-fit: cover; }
@media print { .emis { border-width: 6px; padding: 6mm; font-size: 13px; } }
