:root {
  --navy: #0f2a43;
  --blue: #2f7bb5;
  --blue-light: #6fb3dd;
  --bg: #f7fafc;
  --bg-alt: #eef3f7;
  --text: #1c2b39;
  --text-muted: #56697a;
  --border: #dde6ed;
  --radius: 10px;
  --max-width: 1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 { font-family: inherit; color: var(--navy); margin: 0; }

a { color: var(--blue); text-decoration: none; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
  letter-spacing: 0.5px;
}
.brand span { color: var(--blue); margin-left: 4px; }

.nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav a {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
}
.nav a:hover { color: var(--blue); }

.nav-cta {
  background: var(--navy);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 999px;
}
.nav-cta:hover { background: var(--blue); }

.lang-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  font-family: inherit;
}
.lang-toggle-btn:hover { background: var(--bg-alt); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  padding: 64px 0 56px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 1px;
  overflow: hidden;
}
.hero-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hero h1 { font-size: 32px; margin-bottom: 8px; }

.hero-title {
  color: var(--blue);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 18px;
}

.hero-summary {
  max-width: 620px;
  margin: 0 auto 26px;
  color: var(--text-muted);
  font-size: 15.5px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-outline { border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }

.hero-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}
.hero-meta li::before { content: "•"; margin-right: 18px; color: var(--blue-light); }
.hero-meta li:first-child::before { content: ""; margin-right: 0; }

/* Sections */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-alt); }

.section h2 {
  font-size: 24px;
  margin-bottom: 28px;
  position: relative;
  padding-bottom: 12px;
}
.section h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 44px; height: 3px;
  background: var(--blue);
  border-radius: 3px;
}

.subhead {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin: 32px 0 16px;
}

.section-note { color: var(--text-muted); font-size: 14px; margin: -12px 0 24px; }
.section-note.small { margin-top: 24px; font-size: 13px; }
.section-note code { background: #fff; border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 22px; }
.timeline-item { display: flex; gap: 16px; align-items: flex-start; }
.timeline-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px #dceaf5;
}
.timeline-content h3 { font-size: 17px; margin-bottom: 3px; }
.role-org { color: var(--text); font-size: 14.5px; margin: 0 0 2px; }
.role-date { color: var(--text-muted); font-size: 13px; margin: 0; }

.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.card-list li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14.5px;
  color: var(--text-muted);
}
.card-list li strong { color: var(--navy); }

.honors-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.honor-chip {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Skills */
.lang-row { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.lang-item { display: grid; grid-template-columns: 70px 1fr 100px; align-items: center; gap: 12px; font-size: 14px; }
.bar { height: 8px; background: var(--border); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--navy)); border-radius: 6px; }
.lang-level { color: var(--text-muted); font-size: 12.5px; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.skill-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.skill-card h4 { font-size: 14.5px; margin-bottom: 6px; }
.skill-card p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  background: var(--navy);
  color: #fff;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 999px;
}

/* Certifications list */
.cert-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cert-list li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 16px;
  align-items: center;
  font-size: 14px;
}
.cert-name { color: var(--navy); font-weight: 600; grid-column: 1 / -1; }
.cert-org { color: var(--text-muted); font-size: 13px; }
.cert-date { color: var(--blue); font-size: 12.5px; font-weight: 600; white-space: nowrap; }

@media (min-width: 640px) {
  .cert-name { grid-column: auto; }
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.gallery-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gallery-item img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.gallery-item:hover { border-color: var(--blue); }
.gallery-item span { font-weight: 600; color: var(--text); }

/* Contact */
.contact-inner { text-align: center; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.contact-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
}
.contact-card strong { color: var(--navy); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.contact-card span { color: var(--text-muted); font-size: 14px; }
.contact-card:hover { border-color: var(--blue); }

/* Footer */
.footer { padding: 24px 0; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 34px;
  cursor: pointer;
  line-height: 1;
}

/* ───────────────────────── Auth pages ───────────────────────── */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
}
.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 32px rgba(15, 42, 67, 0.08);
}
.auth-brand { display: inline-block; margin-bottom: 20px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-sub { color: var(--text-muted); font-size: 13.5px; margin: 0 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.auth-form input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.auth-error { color: #c0392b; font-size: 13px; margin: 0; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-footer { text-align: center; font-size: 13px; color: var(--text-muted); margin: 14px 0 0; }

/* ───────────────────────── Admin dashboard ───────────────────────── */
.admin-main { padding: 40px 24px 80px; }
.admin-main h1 { font-size: 26px; margin-bottom: 8px; }
.admin-topbar-right { display: flex; align-items: center; gap: 12px; }
.role-badge {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--navy);
  font-weight: 600;
  text-transform: capitalize;
}
.btn-small { padding: 7px 16px; font-size: 13px; }

.admin-tabs { display: flex; gap: 8px; margin: 24px 0; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.admin-tab {
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.admin-tab.active { color: var(--navy); border-bottom-color: var(--blue); }
.admin-panel { padding-top: 8px; }

/* Chat */
.chat-window {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.chat-bubble { max-width: 75%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.4; }
.chat-user { align-self: flex-end; background: var(--navy); color: #fff; }
.chat-assistant { align-self: flex-start; background: var(--bg-alt); color: var(--text); }
.chat-form { display: flex; gap: 8px; align-items: center; }
.chat-form input[type="text"] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
}
.chat-attach-name { font-size: 12px; color: var(--text-muted); margin: 6px 0 0; }

/* CV edit form */
.cv-form { display: flex; flex-direction: column; gap: 28px; }
.cv-section { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.cv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.cv-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.cv-form label.full-width { margin-top: 12px; }
.cv-form input, .cv-form textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: inherit;
  width: 100%;
}
.cv-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) 32px; gap: 8px; align-items: center; }
.cv-row input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}
.btn-remove {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #c0392b;
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
}

/* Certificates manage */
.cert-upload-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.cert-upload-form input[type="text"] {
  border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
}
.cert-manage-list { display: flex; flex-direction: column; gap: 10px; }
.cert-manage-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
}
.cert-manage-row img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.cert-manage-info { display: flex; flex-direction: column; flex: 1; }
.cert-manage-info span { font-size: 12.5px; color: var(--text-muted); }

/* Submissions tab */
.submissions-filter { display: flex; gap: 8px; margin-bottom: 18px; }
.submissions-filter .filter-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.submissions-filter .filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.submissions-list { display: flex; flex-direction: column; gap: 12px; }
.submission-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.submission-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.submission-title { color: var(--blue); font-size: 13px; margin-left: 10px; }
.submission-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.submission-meta { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.submission-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Users tab */
.invite-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.invite-form input, .invite-form select {
  border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
}
.user-table { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.user-row {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-size: 13.5px;
}
.user-row-name { font-weight: 600; flex: 1; }
.user-row select { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-family: inherit; }

/* Responsive */
@media (max-width: 760px) {
  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 14px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .hero h1 { font-size: 26px; }
}

/* ───────────────────────── Printable CV sheet (cv-status.html) ───────────────────────── */
.print-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}
.print-sheet h1 { font-size: 26px; margin-bottom: 4px; }
.print-sheet .print-title { color: var(--blue); font-weight: 600; margin: 0 0 6px; }
.print-sheet .print-meta { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }
.print-sheet .print-summary { font-size: 14px; color: var(--text); margin: 0 0 24px; }
.print-sheet h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy);
  border-bottom: 2px solid var(--blue);
  padding-bottom: 6px;
  margin: 28px 0 14px;
}
.print-item { margin-bottom: 14px; }
.print-item-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.print-item-head span { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.print-item-sub { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }
.print-sheet ul { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--text); }
.print-sheet p { font-size: 13.5px; margin: 0 0 6px; }

.print-sheet-wrapper { display: none; }

.brand-logo-img { height: 32px; width: auto; display: block; }

/* ───────────────────────── RTL (Arabic) overrides ───────────────────────── */
[dir="rtl"] body {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", -apple-system, sans-serif;
}
[dir="rtl"] .brand span { margin-left: 0; margin-right: 4px; }
[dir="rtl"] .section h2::after { left: auto; right: 0; }
[dir="rtl"] .hero-meta li::before { margin-right: 0; margin-left: 18px; }
[dir="rtl"] .hero-meta li:first-child::before { margin-left: 0; }
[dir="rtl"] .gallery-item { text-align: right; }
[dir="rtl"] .lightbox-close { right: auto; left: 24px; }
[dir="rtl"] .submission-title { margin-left: 0; margin-right: 10px; }
[dir="rtl"] .print-sheet ul,
[dir="rtl"] .print-sheet-wrapper ul { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .cv-form label,
[dir="rtl"] .auth-form label { text-align: right; }
[dir="rtl"] .card-list li strong,
[dir="rtl"] .contact-card strong { letter-spacing: 0; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .print-sheet { border: none; padding: 0; max-width: none; box-shadow: none; }
  .print-sheet-wrapper { display: block !important; }
}
