:root {
  --ink: #1C1A17; --papyrus: #EFE7D8; --papyrus-deep: #E4D9C3;
  --teal: #1E7C74; --teal-deep: #125650; --ochre: #C98A2C; --lapis: #28425E;
  --card: #FBF8F1; --line: rgba(28,26,23,0.14); --bad: #A6462F;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--papyrus); color: var(--ink); font-family: 'Inter', sans-serif; font-size: 15px; }
html[lang="ar"] body { font-family: 'Cairo', sans-serif; }
h1, h2, h3 { font-family: 'Fraunces', serif; margin: 0; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
header { background: rgba(239,231,216,0.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; }
.brand-logo-image { width: 42px; height: 42px; object-fit: contain; border-radius: 12px; background: #fff; box-shadow: 0 8px 20px rgba(28,26,23,0.08); padding: 4px; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.brand-mark svg { width: 18px; height: 18px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-weight: 600; margin-bottom: 16px; }
.back-link:hover { color: var(--ochre); }
.links { display: flex; gap: 24px; font-weight: 500; }
.links a:hover { color: var(--teal); }
.nav-right { display: flex; gap: 10px; align-items: center; }
.lang-stamp { background: none; border: 1.5px solid var(--ink); border-radius: 50px; padding: 6px 12px; font-weight: 600; cursor: pointer; font-size: 0.8rem; }
.lang-stamp span { opacity: 0.55; }
.lang-stamp span.active { opacity: 1; color: var(--teal); }
.cta-btn { background: var(--ink); color: var(--papyrus); border-radius: 50px; padding: 9px 20px; font-weight: 600; border: none; cursor: pointer; font-family: inherit; display: inline-block; text-align: center; }
.cta-outline { border: 1.5px solid var(--ink); border-radius: 50px; padding: 8px 18px; font-weight: 600; background: none; cursor: pointer; font-family: inherit; display: inline-block; text-align: center; }
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: var(--papyrus); padding: 26px 20px; }
.sidebar h2 { margin-bottom: 4px; }
.sidebar a:hover { color: var(--ochre); }
.main { padding: 32px 40px; background: var(--papyrus-deep); }
.brand-logo-img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.form-box { max-width: 450px; margin: 60px auto; background: var(--card); padding: 30px; border: 1px solid var(--line); border-radius: 6px; }
.form-box h2 { margin-bottom: 18px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-family: inherit; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; background: var(--card); }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--ink); color: var(--papyrus); font-weight: 600; }
main h1 { margin-bottom: 20px; }
.hero-panel { margin: 26px auto 18px; padding: 32px; background: linear-gradient(135deg, rgba(30,124,116,0.08), rgba(201,138,44,0.1)); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 16px 40px rgba(28,26,23,0.06); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 24px; align-items: center; }
.hero-card { background: rgba(251,248,241,0.9); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.hero-card ul { padding-left: 18px; margin: 8px 0 0; color: #4a4640; line-height: 1.7; }
.page-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 30px rgba(28,26,23,0.05); }
.page-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.page-card-body { padding: 24px; }
.empty-state { text-align: center; padding: 28px 20px; color: #5b564c; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; font-size: 0.85rem; }

/* ============================================================
   Premium UI Components (used by dashboards & homepage)
   ============================================================ */
.role-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; color: var(--ochre); margin: 18px 0 10px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.side-nav a { color: var(--papyrus); padding: 9px 12px; border-radius: 6px; font-weight: 500; font-size: 0.92rem; }
.side-nav a:hover { background: rgba(239,231,216,0.08); color: var(--ochre); }
.side-nav a.active { background: rgba(201,138,44,0.16); color: var(--ochre); }
.side-foot { margin-top: auto; padding-top: 20px; color: var(--papyrus); font-size: 0.85rem; display: flex; justify-content: space-between; align-items: center; }
.sidebar { display: flex; flex-direction: column; }

.page-head .eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; color: var(--teal); }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 1.7rem; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 24px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 1.05rem; }
.panel-head a { color: var(--teal); font-weight: 600; font-size: 0.85rem; }
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .panel-row { grid-template-columns: 1fr; } }

.status-pill { display: inline-block; padding: 4px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; }
.status-pill.interview { background: rgba(80,200,120,0.16); color: #1d7a3f; }
.status-pill.review { background: rgba(201,138,44,0.18); color: #8a5a12; }

.app-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.app-item:last-child { border-bottom: none; }
.app-item h4 { font-size: 0.98rem; margin-bottom: 4px; }
.app-meta { color: var(--ink); opacity: 0.6; font-size: 0.82rem; }

.btn-icon { background: none; border: 1px solid transparent; border-radius: 6px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.btn-icon.approve { color: var(--teal); }
.btn-icon.approve:hover { background: rgba(30,124,116,0.12); }
.btn-icon.reject { color: var(--bad); }
.btn-icon.reject:hover { background: rgba(166,70,47,0.12); }

.queue-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.queue-item:last-child { border-bottom: none; }
.queue-main { display: flex; align-items: center; gap: 12px; }
.mini-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.queue-doc { color: var(--ink); opacity: 0.6; font-size: 0.82rem; }
.row-actions { display: flex; gap: 6px; }

.doc-list { padding: 0; }
.doc-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.doc-item:last-child { border-bottom: none; }
.doc-name { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.doc-name svg { width: 18px; height: 18px; color: var(--teal); }

.btn { background: var(--ink); color: var(--papyrus); border: none; border-radius: 50px; padding: 9px 20px; font-weight: 600; cursor: pointer; font-family: inherit; display: inline-block; text-align: center; }

/* Homepage directory & services cards */
.directory-grid, .services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 20px; }
.profile-card, .service-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.profile-card .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; }
.profile-card h4 { margin: 0 0 4px; }
.profile-card .profile-title { color: var(--teal); font-weight: 600; font-size: 0.85rem; margin-bottom: 8px; }
.profile-card p { color: var(--ink); opacity: 0.7; font-size: 0.85rem; margin: 0; }
.service-card h4 { margin-bottom: 8px; }
.service-card p { color: var(--ink); opacity: 0.7; font-size: 0.88rem; margin-bottom: 14px; }
.service-card .service-icon { font-size: 1.6rem; margin-bottom: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-head h2 { font-size: 1.5rem; }
.success-msg { background: rgba(30,124,116,0.12); color: var(--teal-deep); border: 1px solid rgba(30,124,116,0.3); padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-weight: 600; }
.error-msg { background: rgba(166,70,47,0.12); color: var(--bad); border: 1px solid rgba(166,70,47,0.3); padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-weight: 600; }
.job-link { color: var(--teal); font-weight: 600; }

/* ============================================================
   Public pages (jobs, job-details, directory, profile)
   ============================================================ */
.section { padding: 40px 0; }
.alt-bg { background: var(--papyrus-deep); }
.mono { font-family: 'IBM Plex Mono', monospace; }
.index-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; color: var(--teal); }

.job-list { display: flex; flex-direction: column; gap: 16px; }

/* ============================================================
   Apply Confirmation Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 23, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 1.15rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
.cv-option input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.job-ticket { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; }
.job-ticket h3 a { color: var(--ink); }
.job-ticket h3 a:hover { color: var(--teal); }
.job-meta { color: var(--ink); opacity: 0.65; font-size: 0.85rem; }
.star-btn { line-height: 1; }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.seal { display: inline-block; background: var(--teal); color: #fff; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; padding: 3px 10px; border-radius: 50px; margin-bottom: 12px; }
.profile-card .profile-role { color: var(--teal); font-weight: 600; font-size: 0.85rem; margin-bottom: 10px; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tag { display: inline-block; background: var(--papyrus-deep); border: 1px solid var(--line); color: var(--ink); font-size: 0.75rem; font-weight: 600; padding: 4px 12px; border-radius: 50px; }
.profile-card h3 a { color: var(--ink); }
.profile-card h3 a:hover { color: var(--teal); }

/* Pricing page */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: stretch; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 32px 28px; display: flex; flex-direction: column; position: relative; }
.price-card.featured { border: 2px solid var(--teal); box-shadow: 0 8px 30px rgba(30,124,116,0.12); }
.price-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--teal); color: #fff; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; padding: 5px 16px; border-radius: 50px; }
.price-head { text-align: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.price-head h3 { font-size: 1.3rem; margin-bottom: 12px; }
.price-amt { font-size: 2.8rem; font-weight: 700; font-family: 'Fraunces', serif; color: var(--ink); line-height: 1; }
.price-per { color: #5b564c; font-size: 0.85rem; margin-top: 6px; }
.price-features { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 13px; flex: 1; }
.price-features li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.92rem; color: #4a4640; }
.price-features li::before { content: "✓"; color: var(--teal); font-weight: 700; flex-shrink: 0; }

/* ============================================================
   Dashboard Forms (consolidated from inline <style> blocks)
   ============================================================ */
.upload-form { padding: 20px; background: var(--card); border: 1px dashed var(--teal); border-radius: 6px; margin-bottom: 24px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.admin-form-grid .form-group input,
.admin-form-grid .form-group select,
.admin-form-grid .form-group textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 4px; }
@media (max-width: 700px) { .admin-form-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Responsive / Mobile & Tablet Layout
   ============================================================ */

/* Nav hamburger (shown on small screens) */
.nav-toggle { display: none; background: none; border: 1.5px solid var(--ink); border-radius: 6px; width: 40px; height: 38px; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle svg { width: 20px; height: 20px; }

/* Shell (sidebar + main) */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .nav-row { gap: 10px; }
  .nav-right { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 200; transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .side-overlay { display: none; position: fixed; inset: 0; background: rgba(28,26,23,0.5); z-index: 150; }
  .side-overlay.open { display: block; }
  .main { padding: 24px 18px; }
  .sidebar-back { display: inline-block; margin-top: 10px; color: var(--ochre); font-size: 0.85rem; }
}

/* Header nav */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-row { flex-wrap: wrap; align-items: center; }
  .links { display: none; width: 100%; flex-direction: column; gap: 10px; padding: 10px 0; order: 5; }
  .links.open { display: flex; }
  .links a { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .nav-right { margin-left: auto; width: 100%; justify-content: flex-end; }
}

/* Tables — allow horizontal scroll on small screens */
@media (max-width: 700px) {
  table, .table-scroll { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  thead { display: none; }
  tbody { display: block; }
  tbody tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  tbody td { display: block; width: 100%; padding: 6px 12px; border: none; text-align: left; }
  tbody td::before { content: attr(data-label); display: block; font-weight: 700; font-size: 0.72rem; opacity: 0.6; margin-bottom: 2px; }
}

/* Job ticket */
@media (max-width: 640px) {
  .job-ticket { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* Hompeage grids already use auto-fill/minmax — fallback for very small screens */
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .hero-panel { padding: 22px; }
  .directory-grid, .services-grid, .profile-grid { grid-template-columns: 1fr; }
  .nav-right { flex-direction: column; align-items: stretch; }
  .cta-btn, .cta-outline { display: block; width: 100%; text-align: center; }
  .nav-right .cta-btn, .nav-right .cta-outline { width: 100%; }
  .page-card-head { flex-direction: column; align-items: flex-start; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .form-box { margin: 30px auto; padding: 22px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .modal-box { max-height: 92vh; }
  .app-item, .queue-item, .doc-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .row-actions { align-self: flex-end; }
}

/* Sidebar responsive helpers (only active below 900px) */
@media (min-width: 901px) {
  .sidebar-back { display: none; }
}
