:root {
  --navy-950: #0a223b;
  --navy-900: #102f50;
  --navy-800: #173f67;
  --teal-700: #08756f;
  --teal-600: #0a8a82;
  --teal-100: #dff3f0;
  --gold-500: #c49a3a;
  --gold-100: #fbf3df;
  --ink: #17283c;
  --muted: #66778a;
  --line: #dce5ea;
  --line-strong: #cbd8df;
  --paper: #ffffff;
  --canvas: #f3f6f8;
  --danger: #b73d4a;
  --danger-soft: #fbe9eb;
  --warning: #a86411;
  --warning-soft: #fff3d9;
  --success: #167452;
  --success-soft: #e3f4ec;
  --info: #246ca6;
  --info-soft: #e7f1fa;
  --shadow-sm: 0 8px 24px rgba(18, 48, 75, .07);
  --shadow-md: 0 18px 50px rgba(12, 36, 58, .13);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 286px;
  --font: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: var(--font); font-size: 16px; line-height: 1.65; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--teal-700); }
button { cursor: pointer; }
img { max-width: 100%; }
.is-hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.ltr { direction: ltr; text-align: left; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* المصادقة والتثبيت */
.auth-page {
  background:
    radial-gradient(circle at 12% 15%, rgba(8, 117, 111, .16), transparent 34%),
    linear-gradient(145deg, #0a223b 0%, #133d5d 48%, #0b625f 100%);
  display: grid;
  place-items: center;
  padding: 28px;
}
.auth-page::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000, transparent 80%); }
.auth-shell { width: min(1120px, 100%); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .75fr); gap: 56px; align-items: center; position: relative; z-index: 1; }
.auth-identity { color: white; padding: 28px; }
.auth-logo { width: 142px; height: 142px; object-fit: contain; filter: drop-shadow(0 12px 24px rgba(0,0,0,.2)); margin-bottom: 18px; }
.auth-identity .eyebrow { color: #efd58e; }
.college-identity { display: block; color: #fff; font-size: 1.18rem; margin: 2px 0 8px; }
.auth-identity h1 { margin: 4px 0 16px; max-width: 650px; font-size: clamp(2rem, 4.8vw, 4rem); line-height: 1.2; letter-spacing: -.035em; }
.auth-identity > p:not(.eyebrow) { font-size: 1.15rem; color: #dfeaf1; max-width: 620px; }
.system-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.system-chips span { border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 8px 15px; color: #e6eef4; background: rgba(255,255,255,.06); }
.system-chips .active { background: #fff; color: var(--navy-900); border-color: #fff; font-weight: 800; }
.auth-card { background: rgba(255,255,255,.98); border: 1px solid rgba(255,255,255,.72); border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0,0,0,.24); padding: clamp(28px, 5vw, 46px); position: relative; z-index: 1; }
.card-heading > span, .eyebrow { display: block; color: var(--teal-700); font-weight: 800; font-size: .87rem; letter-spacing: .02em; }
.card-heading h2, .auth-card h1 { margin: 4px 0 6px; font-size: 1.8rem; line-height: 1.3; }
.card-heading p, .auth-card > p { color: var(--muted); margin: 0 0 24px; }
.form-stack { display: grid; gap: 17px; }
.form-stack label:not(.choice-card):not(.remember), .modal-form label, .settings-form label { display: grid; gap: 7px; font-weight: 700; color: #2b3d51; }
.form-stack label > span small, .modal-form label > span small { color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 11px; padding: 11px 13px; min-height: 48px; outline: none; transition: border-color .18s, box-shadow .18s, background .18s; }
textarea { min-height: 108px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-600); box-shadow: 0 0 0 4px rgba(10,138,130,.13); }
input:disabled, select:disabled { background: #edf2f4; color: #7b8793; }
.form-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: .93rem; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.remember input { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--teal-700); }
.button, .icon-button { border: 0; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 11px; min-height: 44px; padding: 10px 17px; font-weight: 800; transition: transform .16s, box-shadow .16s, background .16s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button.primary { background: linear-gradient(135deg, var(--teal-700), #0a8d83); color: #fff; box-shadow: 0 8px 22px rgba(8,117,111,.22); }
.button.navy { background: var(--navy-900); color: white; }
.button.secondary { background: #edf3f5; color: var(--navy-900); border: 1px solid var(--line); }
.button.ghost { background: transparent; color: var(--navy-900); border: 1px solid var(--line-strong); }
.button.danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #f1cdd2; }
.button.small { min-height: 36px; padding: 6px 11px; font-size: .9rem; }
.button.wide { width: 100%; min-height: 50px; }
.portal-link { display: block; text-align: center; margin-top: 18px; font-weight: 700; text-decoration: none; }
.auth-help { margin: 20px 0 0 !important; text-align: center; font-size: .9rem; }
.alert { padding: 12px 14px; border-radius: 11px; margin: 0 0 18px; font-weight: 650; border: 1px solid; }
.alert.error { background: var(--danger-soft); color: #8e2635; border-color: #efc8ce; }
.alert.info { background: var(--info-soft); color: #245d8b; border-color: #c9e0f3; }
.alert.success { background: var(--success-soft); color: #125c42; border-color: #c5e7d8; }
.compact-auth { min-height: 100vh; }
.standalone-card { width: min(520px, 100%); text-align: center; }
.standalone-card .form-stack { text-align: right; }
.small-logo { width: 90px; height: 90px; object-fit: contain; margin: 0 auto 14px; }
.success-mark, .expired-mark { width: 62px; height: 62px; border-radius: 50%; margin: 4px auto 18px; display: grid; place-items: center; font-size: 2rem; font-weight: 900; }
.success-mark { background: var(--success-soft); color: var(--success); }
.expired-mark { background: var(--warning-soft); color: var(--warning); }
.install-shell { width: min(1200px, 100%); display: grid; grid-template-columns: .78fr 1.22fr; gap: 44px; align-items: start; position: relative; z-index: 1; }
.install-brand { color: white; padding: 34px 18px; position: sticky; top: 24px; }
.install-brand img { width: 130px; height: 130px; object-fit: contain; }
.install-brand h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.24; margin: 6px 0 14px; }
.install-brand > p:not(.eyebrow) { color: #deebf0; font-size: 1.06rem; }
.install-points { list-style: none; padding: 0; display: grid; gap: 11px; margin-top: 26px; }
.install-points li::before { content: "✓"; color: #efd58e; font-weight: 900; margin-left: 9px; }
.install-card { padding: clamp(24px, 4vw, 40px); }
.choice-card { display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--line); border-radius: 12px; padding: 13px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--teal-600); background: #f0faf8; }
.choice-card input { width: 18px; min-height: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--teal-700); }
.choice-card span { display: grid; gap: 3px; }
.choice-card small { color: var(--muted); font-weight: 500; }
.manual-db { display: grid; gap: 14px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 13px; background: #f8fafb; }
.field-grid { display: grid; gap: 14px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-divider { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: .9rem; font-weight: 800; margin: 5px 0; }
.form-divider::before, .form-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.privacy-note { color: var(--muted); font-size: .88rem; margin: 0; }

/* هيكل التطبيق */
.app-body { overflow-x: hidden; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 0 0 auto; width: var(--sidebar); min-height: 100vh; background: linear-gradient(180deg, var(--navy-950), #0d3150 72%, #0b4b50); color: #fff; padding: 22px 18px; display: flex; flex-direction: column; z-index: 30; box-shadow: -4px 0 24px rgba(10,34,59,.12); }
.brand { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center; padding: 4px 5px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand img { width: 58px; height: 58px; object-fit: contain; }
.brand small { display: block; color: #d3e3eb; line-height: 1.35; }
.brand strong { display: block; font-size: 1rem; line-height: 1.35; margin-top: 3px; }
.side-nav { display: grid; gap: 5px; margin-top: 20px; }
.nav-button { appearance: none; width: 100%; border: 0; background: transparent; color: #d8e5eb; border-radius: 12px; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 9px 12px; font-weight: 750; text-align: right; transition: background .16s, color .16s, transform .16s; }
.nav-button:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-button.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset -3px 0 0 var(--gold-500); }
.nav-button svg { width: 21px; height: 21px; flex: 0 0 auto; stroke-width: 1.9; }
.nav-badge { margin-right: auto; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: #d7a93c; color: #17283c; font-size: .76rem; font-weight: 900; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; }
.user-mini { border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.07); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 38px 1fr auto; gap: 9px; align-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #e0bd63, #b7892a); color: var(--navy-950); display: grid; place-items: center; font-weight: 900; }
.user-mini strong { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini small { color: #c7d8df; display: block; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-small { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; text-decoration: none; display: grid; place-items: center; }
.main-column { grid-column: 2; min-width: 0; }
.topbar { min-height: 80px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); padding: 13px clamp(20px, 4vw, 48px); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-title { min-width: 0; }
.topbar-title small { color: var(--teal-700); font-weight: 800; display: block; }
.topbar-title h1 { font-size: clamp(1.15rem, 2vw, 1.45rem); margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.year-chip { background: var(--gold-100); color: #654d14; border: 1px solid #ead59f; border-radius: 11px; padding: 8px 13px; font-weight: 800; direction: ltr; }
.app-switcher { position: relative; }
.icon-button { width: 44px; padding: 0; background: #edf3f5; color: var(--navy-900); border: 1px solid var(--line); }
.icon-button svg { width: 20px; height: 20px; }
.switcher-menu { position: absolute; top: calc(100% + 10px); left: 0; width: 310px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-md); padding: 12px; display: grid; gap: 7px; }
.switcher-menu a { text-decoration: none; display: grid; grid-template-columns: 42px 1fr; gap: 10px; padding: 10px; border-radius: 11px; color: var(--ink); }
.switcher-menu a:hover { background: #f0f6f7; }
.switcher-menu .app-mark { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--teal-100); color: var(--teal-700); font-weight: 900; }
.switcher-menu strong { display: block; }
.switcher-menu small { display: block; color: var(--muted); }
.mobile-brand, .mobile-nav { display: none; }
.main-content { padding: clamp(22px, 4vw, 44px); max-width: 1680px; margin: 0 auto; }
.loading-state { min-height: calc(100vh - 170px); display: grid; place-items: center; text-align: center; color: var(--muted); }
.loading-state img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 12px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #dce9ec; border-top-color: var(--teal-700); animation: spin .8s linear infinite; margin: 12px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 25px; }
.page-head .eyebrow { margin-bottom: 2px; }
.page-head h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); line-height: 1.25; letter-spacing: -.025em; }
.page-head p { margin: 7px 0 0; color: var(--muted); max-width: 760px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 9px; }

/* البطاقات واللوحات */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 13px; min-height: 112px; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--teal-100); color: var(--teal-700); }
.stat-icon svg { width: 23px; height: 23px; }
.stat-card.warning .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat-card.success .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-card.info .stat-icon { background: var(--info-soft); color: var(--info); }
.stat-card span { color: var(--muted); font-size: .9rem; }
.stat-card strong { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--navy-900); margin-top: 3px; }
.layout-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 20px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.panel + .panel { margin-top: 18px; }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-head h3 { margin: 0; font-size: 1.08rem; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.panel-body { padding: 20px; }
.quick-links { display: grid; gap: 10px; }
.quick-link { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; text-decoration: none; color: var(--ink); background: #fff; }
.quick-link:hover { border-color: #9ecbc8; background: #f5fbfa; }
.quick-link .mark { width: 44px; height: 44px; border-radius: 12px; background: var(--teal-100); color: var(--teal-700); display: grid; place-items: center; font-weight: 900; }
.quick-link strong, .quick-link small { display: block; }
.quick-link small { color: var(--muted); }
.quick-link .arrow { color: var(--muted); font-size: 1.3rem; }
.reviewer-card { padding: 18px; background: linear-gradient(135deg, var(--navy-900), #0b6966); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.reviewer-card small { color: #d6e7eb; }
.reviewer-card h3 { margin: 5px 0 2px; }
.reviewer-card p { margin: 0; color: #e7eff2; }
.reviewer-card .status-dot { width: 9px; height: 9px; border-radius: 50%; background: #8ee0be; display: inline-block; margin-left: 6px; }
.progress-list { display: grid; gap: 15px; }
.progress-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(120px, 1.4fr) 52px; gap: 12px; align-items: center; }
.progress-row span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 9px; background: #e9eff2; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal-700), #1ba096); }
.progress-row b { text-align: left; color: var(--navy-900); }
.empty-state { text-align: center; padding: 42px 22px; color: var(--muted); }
.empty-icon { width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center; background: #edf3f5; color: var(--navy-800); margin: 0 auto 12px; font-size: 1.7rem; }
.empty-state h3 { color: var(--ink); margin: 0 0 6px; }

/* الفلاتر والجداول */
.filters { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, .7fr)); gap: 11px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.search-field { position: relative; }
.search-field input { padding-right: 42px; }
.search-field svg { position: absolute; right: 14px; top: 14px; width: 20px; height: 20px; color: var(--muted); }
.table-panel { overflow: hidden; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #f6f9fa; color: #46586a; font-size: .83rem; text-align: right; padding: 12px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 14px; border-bottom: 1px solid #e8eef1; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfd; }
.activity-title { min-width: 250px; max-width: 430px; }
.activity-title strong { display: block; line-height: 1.5; }
.activity-title small { display: block; color: var(--muted); margin-top: 3px; }
.source-tag, .status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: .78rem; font-weight: 850; white-space: nowrap; }
.source-tag.ce { color: #185d84; background: #e5f2fa; }
.source-tag.plan { color: #5d4a1f; background: var(--gold-100); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.draft { background: #edf1f3; color: #63707c; }
.status.submitted { background: var(--warning-soft); color: var(--warning); }
.status.returned { background: var(--danger-soft); color: var(--danger); }
.status.approved, .status.executed { background: var(--success-soft); color: var(--success); }
.status.executed { background: #dff0fb; color: #176a9c; }
.row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.action-button { width: 35px; height: 35px; padding: 0; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--navy-800); }
.action-button:hover { border-color: #9ecbc8; background: #f0f8f7; }
.action-button.danger { color: var(--danger); }
.action-button svg { width: 17px; height: 17px; }
.mobile-cards { display: none; }
.activity-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 15px; box-shadow: var(--shadow-sm); }
.activity-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.activity-card h3 { margin: 9px 0 8px; font-size: 1rem; line-height: 1.55; }
.activity-meta { display: grid; gap: 6px; color: var(--muted); font-size: .88rem; }
.activity-meta span { display: flex; align-items: flex-start; gap: 7px; }
.activity-card .row-actions { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.activity-card .row-actions .button { flex: 1; }

/* الأنواع والأقسام والتقارير */
.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.type-card { border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 17px; min-height: 148px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.type-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.type-group { color: var(--teal-700); font-size: .78rem; font-weight: 850; }
.type-card h3 { font-size: 1rem; margin: 8px 0 4px; }
.type-card p { color: var(--muted); margin: 0; font-size: .88rem; }
.type-card footer { margin-top: auto; padding-top: 13px; display: flex; align-items: center; justify-content: space-between; }
.type-count { font-size: 1.45rem; font-weight: 900; color: var(--navy-900); }
.sync-note { color: #176a9c; background: #e7f2f9; padding: 5px 8px; border-radius: 8px; font-size: .76rem; font-weight: 800; }
.departments-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.department-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 17px; box-shadow: var(--shadow-sm); }
.department-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.department-card h3 { margin: 0; font-size: 1rem; }
.department-card .category { background: #edf3f5; color: var(--navy-800); padding: 4px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.formation { color: var(--teal-700); font-size: .82rem; min-height: 26px; margin-top: 5px; }
.department-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 15px; }
.department-numbers div { background: #f6f9fa; border-radius: 10px; padding: 8px; text-align: center; }
.department-numbers b, .department-numbers small { display: block; }
.department-numbers b { font-size: 1.1rem; color: var(--navy-900); }
.department-numbers small { color: var(--muted); font-size: .72rem; }
.report-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.report-card { border-radius: 17px; padding: 20px; color: white; background: linear-gradient(135deg, var(--navy-900), #1a4a70); }
.report-card.teal { background: linear-gradient(135deg, #096d68, #0f968b); }
.report-card.gold { background: linear-gradient(135deg, #80621b, #c49a3a); }
.report-card span, .report-card strong { display: block; }
.report-card span { color: rgba(255,255,255,.8); }
.report-card strong { font-size: 2.2rem; line-height: 1.2; margin-top: 5px; }
.report-table-title { display: flex; align-items: center; gap: 10px; }

/* المستخدمون والإعدادات */
.user-list { display: grid; gap: 10px; }
.user-row { display: grid; grid-template-columns: 44px minmax(180px, 1.2fr) minmax(200px, 1fr) minmax(150px, .75fr) auto; gap: 13px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.user-row .avatar { color: var(--navy-900); }
.user-info strong, .user-info small { display: block; }
.user-info small { color: var(--muted); direction: ltr; text-align: right; }
.role-label { font-weight: 800; color: var(--navy-800); }
.active-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: .86rem; font-weight: 800; }
.active-indicator.off { color: var(--muted); }
.active-indicator::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.setting-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.setting-card h3 { margin: 0 0 4px; }
.setting-card > p { color: var(--muted); margin: 0 0 18px; }
.settings-form { display: grid; gap: 14px; }
.reviewer-setting { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 13px; padding: 14px; background: #f8fafb; }
.reviewer-setting .avatar { flex: 0 0 auto; }
.security-list { display: grid; gap: 10px; }
.security-line { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.security-line:last-child { border: 0; padding-bottom: 0; }
.security-line b { color: var(--success); }

/* النوافذ */
dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 90px rgba(7,28,47,.35); color: var(--ink); }
dialog::backdrop { background: rgba(8,25,41,.58); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.dialog-head h2 { margin: 2px 0 0; font-size: 1.3rem; }
.dialog-close { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #f5f8f9; color: var(--navy-900); font-size: 1.3rem; }
.dialog-body { padding: 22px; overflow-y: auto; }
.modal-form { display: grid; gap: 16px; }
.modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.modal-grid .full { grid-column: 1 / -1; }
.dialog-actions { padding: 15px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; background: #f8fafb; position: sticky; bottom: 0; }
.quota-box { background: var(--gold-100); color: #5e4817; border: 1px solid #ead59f; border-radius: 12px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quota-box b { direction: ltr; }
.source-lock { background: var(--info-soft); border: 1px solid #c9e0f3; color: #245d8b; padding: 11px 13px; border-radius: 11px; }
.review-summary { background: #f6f9fa; border: 1px solid var(--line); border-radius: 13px; padding: 15px; margin-bottom: 17px; }
.review-summary h3 { margin: 0 0 7px; }
.review-summary dl { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px 14px; }
.review-summary dt { color: var(--muted); font-size: .82rem; }
.review-summary dd { margin: 0; font-weight: 700; }
.decision-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast-stack { position: fixed; left: 20px; bottom: 20px; z-index: 100; display: grid; gap: 9px; width: min(390px, calc(100% - 40px)); }
.toast { border-radius: 13px; padding: 13px 15px; color: #fff; background: var(--navy-900); box-shadow: var(--shadow-md); animation: toast-in .22s ease-out; display: flex; align-items: flex-start; gap: 10px; }
.toast.success { background: #176d50; }
.toast.error { background: #9d3140; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* استجابة الهاتف */
@media (max-width: 1180px) {
  :root { --sidebar: 250px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .type-grid, .departments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .auth-shell, .install-shell { grid-template-columns: 1fr; gap: 18px; }
  .auth-identity { text-align: center; padding: 8px; }
  .auth-logo { width: 104px; height: 104px; }
  .auth-identity h1 { margin-inline: auto; font-size: 2rem; }
  .auth-identity > p:not(.eyebrow) { margin-inline: auto; }
  .system-chips { justify-content: center; }
  .install-brand { position: static; text-align: center; padding: 8px; }
  .install-brand img { width: 96px; height: 96px; }
  .install-brand h1 { font-size: 1.8rem; }
  .install-points { display: none; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-column { grid-column: auto; }
  .topbar { min-height: 70px; padding: 10px 15px; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
  .mobile-brand img { width: 44px; height: 44px; object-fit: contain; }
  .mobile-brand strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-brand small { display: block; color: var(--teal-700); font-size: .75rem; }
  .topbar-title { display: none; }
  .year-chip { display: none; }
  .switcher-menu { position: fixed; top: 72px; left: 12px; right: 12px; width: auto; }
  .main-content { padding: 20px 14px 104px; }
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(5, 1fr); left: 12px; right: 12px; bottom: 10px; z-index: 40; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 20px; padding: 7px; box-shadow: 0 18px 45px rgba(8,31,50,.22); backdrop-filter: blur(14px); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); border-radius: 14px; min-height: 56px; display: grid; place-items: center; align-content: center; gap: 2px; font-size: .7rem; font-weight: 800; }
  .mobile-nav button.active { background: var(--teal-100); color: var(--teal-700); }
  .mobile-nav svg { width: 20px; height: 20px; }
  .layout-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .report-summary { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 42px 1fr auto; }
  .user-row > .role-label, .user-row > .active-indicator { grid-column: 2; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .auth-page { padding: 15px; display: block; }
  .auth-card { padding: 26px 20px; }
  .auth-identity > p:not(.eyebrow), .system-chips { display: none; }
  .field-grid.two, .modal-grid { grid-template-columns: 1fr; }
  .modal-grid .full { grid-column: auto; }
  .form-between { align-items: flex-start; flex-direction: column; }
  .page-head { display: grid; gap: 14px; }
  .head-actions { width: 100%; }
  .head-actions .button { flex: 1; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { grid-template-columns: 38px 1fr; padding: 13px; min-height: 92px; gap: 9px; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-card strong { font-size: 1.5rem; }
  .stat-card span { font-size: .78rem; }
  .filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .desktop-table { display: none; }
  .mobile-cards { display: grid; gap: 11px; }
  .type-grid, .departments-grid { grid-template-columns: 1fr; }
  .progress-row { grid-template-columns: minmax(100px, 1fr) 1fr 42px; gap: 8px; font-size: .83rem; }
  .department-numbers { gap: 5px; }
  .user-row { grid-template-columns: 40px 1fr; }
  .user-row > *:last-child { grid-column: 1 / -1; }
  .review-summary dl { grid-template-columns: 1fr; }
  .decision-buttons { grid-template-columns: 1fr; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions .button { width: 100%; }
  .toast-stack { left: 12px; right: 12px; bottom: 88px; width: auto; }
}

@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .mobile-nav, .head-actions, .filters, .row-actions, .toast-stack, dialog { display: none !important; }
  .main-column { display: block; }
  .main-content { max-width: none; padding: 0; }
  .panel, .stat-card, .department-card, .type-card { box-shadow: none; break-inside: avoid; }
  .desktop-table { display: block !important; }
  .mobile-cards { display: none !important; }
  .page-head h2::before { content: "جامعة الفرات الأوسط التقنية — كلية البوليتكنك الكوفة — "; }
}
