/* ─── Design tokens ─── */
:root {
  --tblr-primary: #0b1a3e;
  --tblr-primary-rgb: 11, 26, 62;
  --tblr-primary-darken: #071234;
  --turath-gold: #b8860b;
  --turath-red: #b91c1c;
  --turath-dark: #0b1a3e;
  --turath-deep: #05102a;
  --turath-navy: #1a3a8e;
  --turath-surface: #f8fafc;
  --turath-border: #e5e7eb;

  --tblr-font-sans-serif: "Inter", "Noto Kufi Arabic", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tblr-body-font-family: "Noto Kufi Arabic", "Inter", system-ui, sans-serif;
  --tblr-body-font-size: 0.9375rem;
  --tblr-body-color: #1a1a1a;
  --tblr-body-bg: #f6f8fb;
  --tblr-border-radius: 10px;
  --tblr-border-radius-lg: 14px;
  --tblr-border-radius-xl: 18px;
}

html[dir="rtl"] body {
  font-family: "Noto Kufi Arabic", "Inter", system-ui, sans-serif;
}
html[dir="ltr"] body {
  font-family: "Inter", "Noto Kufi Arabic", system-ui, sans-serif;
}

body {
  background: var(--tblr-body-bg);
  letter-spacing: -0.005em;
  text-align: start;
}

/* Default text alignment for content containers in RTL */
.card-body,
.card-header,
.list-group-item,
.form-label,
.alert {
  text-align: start;
}

/* RTL-aware input-group with leading icon */
html[dir="rtl"] .input-group > .form-control {
  text-align: start;
}

/* Table cells should respect text direction by default */
.table td, .table th {
  text-align: start;
}

/* ─── Brand primary override ─── */
.btn-primary {
  background: linear-gradient(135deg, var(--turath-dark), var(--turath-navy));
  border-color: var(--turath-dark);
  box-shadow: 0 2px 8px rgba(11,26,62,.15);
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, var(--turath-deep), var(--turath-dark));
  border-color: var(--turath-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(11,26,62,.25);
}

.btn-gold {
  background: linear-gradient(135deg, var(--turath-gold), #9a7209);
  border: 0;
  color: #fff;
}
.btn-gold:hover { color:#fff; opacity:.95; transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, var(--turath-red), #991b1b);
  border-color: var(--turath-red);
}

/* ─── Topbar / Navbar ─── */
.turath-navbar {
  background: linear-gradient(135deg, var(--turath-deep) 0%, var(--turath-dark) 70%, var(--turath-navy) 100%);
  box-shadow: 0 2px 20px rgba(5,16,42,.25);
}
.turath-navbar .navbar-brand {
  color: #fff; font-weight: 800; letter-spacing: -0.01em;
}
.turath-navbar .nav-link {
  color: rgba(255,255,255,.85);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all .2s;
}
.turath-navbar .nav-link:hover,
.turath-navbar .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.12);
}
.turath-navbar .nav-link i {
  margin-inline-end: 6px;
}

/* ─── Hero ─── */
.hero-turath {
  position: relative;
  background: linear-gradient(135deg, var(--turath-deep) 0%, var(--turath-dark) 60%, var(--turath-navy) 100%);
  color: #fff;
  padding: 5rem 0 7rem;
  overflow: hidden;
}
.hero-turath::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(184,134,11,.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(185,28,28,.10) 0%, transparent 40%);
  pointer-events: none;
}
.hero-turath::after {
  content:""; position:absolute; bottom:-1px;
  inset-inline: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--tblr-body-bg));
}
.hero-turath h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.hero-turath .lead {
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 720px;
}

/* ─── Cards ─── */
.card {
  border: 1px solid var(--turath-border);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .2s, transform .2s;
}
.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.card-hoverable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11,26,62,.12);
  border-color: rgba(11,26,62,.2);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--turath-border);
  padding: 1rem 1.25rem;
}
.card-title {
  color: var(--turath-dark);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ─── Job card (jobs.php) ─── */
.job-card {
  cursor: pointer;
  transition: all .2s ease;
}
.job-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(11,26,62,.15);
  border-color: var(--turath-gold);
}
.job-card .job-type-badge {
  background: linear-gradient(135deg, var(--turath-dark), var(--turath-navy));
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ─── Timeline (track.php) ─── */
.turath-timeline {
  position: relative;
  padding: 0;
  margin: 0;
  list-style: none;
}
.turath-timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--turath-gold), var(--turath-border));
}
.turath-timeline-item {
  position: relative;
  padding-inline-start: 52px;
  padding-block: 12px 20px;
}
.turath-timeline-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  top: 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--turath-dark);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--turath-border);
  z-index: 1;
}
.turath-timeline-item.is-active::before {
  background: var(--turath-gold);
  box-shadow: 0 0 0 4px rgba(184,134,11,.25), 0 0 0 2px var(--turath-gold);
  animation: pulse-gold 2s infinite;
}
.turath-timeline-item.is-success::before { background: #198754; }
.turath-timeline-item.is-danger::before { background: #dc3545; }
.turath-timeline-item.is-warning::before { background: #fd7e14; }
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 4px rgba(184,134,11,.25); }
  50% { box-shadow: 0 0 0 10px rgba(184,134,11,0); }
}
.turath-timeline-item .timeline-title {
  color: var(--turath-dark);
  font-weight: 700;
  margin-bottom: 4px;
}
.turath-timeline-item .timeline-time {
  color: #6c757d;
  font-size: 0.8rem;
}
.turath-timeline-item .timeline-detail {
  background: #f8f9fb;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 0.875rem;
  white-space: pre-wrap;
}

/* ─── Stats / KPI cards ─── */
.kpi-card {
  border: 0;
  border-radius: var(--tblr-border-radius-lg);
  color: #fff;
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  top: -30%;
  inset-inline-end: -20%;
  width: 140px; height: 140px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  pointer-events: none;
}
.kpi-card .kpi-label {
  opacity: 0.85;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: start;
  position: relative;
  z-index: 1;
}
.kpi-card .kpi-value {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 0.35rem;
  letter-spacing: -0.02em;
  text-align: start;
  position: relative;
  z-index: 1;
}
.kpi-card .kpi-icon {
  position: absolute;
  inset-inline-end: 1rem;
  bottom: 1rem;
  opacity: 0.3;
  font-size: 2.5rem;
  pointer-events: none;
}

.kpi-card.kpi-primary { background: linear-gradient(135deg, #0b1a3e, #1a3a8e); }
.kpi-card.kpi-success { background: linear-gradient(135deg, #0f5132, #198754); }
.kpi-card.kpi-danger  { background: linear-gradient(135deg, #7f1d1d, #b91c1c); }
.kpi-card.kpi-warning { background: linear-gradient(135deg, #b95a0a, #fd7e14); }
.kpi-card.kpi-info    { background: linear-gradient(135deg, #0889a3, #0dcaf0); }
.kpi-card.kpi-purple  { background: linear-gradient(135deg, #4a2a8a, #6f42c1); }
.kpi-card.kpi-gold    { background: linear-gradient(135deg, #8a6609, #b8860b); }

/* ─── Forms ─── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--turath-border);
  font-size: 0.9375rem;
  padding: 0.55rem 0.85rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--turath-navy);
  box-shadow: 0 0 0 3px rgba(26,58,142,.1);
}
.form-label {
  font-weight: 600;
  color: var(--turath-dark);
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
}

/* ─── Tables ─── */
.table > :not(caption) > * > * {
  padding: 0.85rem 1rem;
}
.table thead th {
  background: #fafbfc;
  color: var(--turath-dark);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--turath-border);
}
.table-hover tbody tr:hover {
  background: rgba(11,26,62,.03);
}

/* ─── Status badges ─── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-pill.status-submitted           { background: #e0e7ff; color: #3730a3; }
.status-pill.status-university_review   { background: #cffafe; color: #164e63; }
.status-pill.status-university_approved { background: #dbeafe; color: #1e40af; }
.status-pill.status-university_rejected { background: #fee2e2; color: #991b1b; }
.status-pill.status-board_review        { background: #ede9fe; color: #5b21b6; }
.status-pill.status-board_approved      { background: #d1fae5; color: #065f46; }
.status-pill.status-board_rejected      { background: #fee2e2; color: #991b1b; }
.status-pill.status-interview_ready     { background: #fed7aa; color: #9a3412; }
.status-pill.status-interview_scheduled { background: #fed7aa; color: #9a3412; }
.status-pill.status-hired               { background: #d1fae5; color: #065f46; font-weight: 700; }
.status-pill.status-not_hired           { background: #e5e7eb; color: #4b5563; }

/* ─── Buttons ─── */
.btn {
  font-weight: 600;
  border-radius: 8px;
  padding: 0.55rem 1.15rem;
  transition: all .15s ease;
}
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8125rem; }

/* ─── Empty state ─── */
.empty {
  padding: 3rem 1rem;
  text-align: center;
}
.empty-icon {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}
.empty-title { color: var(--turath-dark); font-weight: 700; }
.empty-subtitle { color: #6c757d; }

/* ─── Page header ─── */
.page-header-turath {
  background: #fff;
  border-bottom: 1px solid var(--turath-border);
  padding: 1.25rem 0;
  margin-bottom: 1.75rem;
  text-align: start;
}
.page-header-turath h1 {
  color: var(--turath-dark);
  font-weight: 800;
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-align: start;
}
.page-header-turath .page-subtitle {
  color: #6c757d;
  font-size: 0.9rem;
  text-align: start;
  display: block;
}

/* ─── Misc alignment cleanups ─── */
.card-title {
  text-align: start;
}
h1, h2, h3, h4, h5, h6 {
  text-align: start;
}
p, small, label, li, dt, dd {
  text-align: start;
}
/* Keep explicit text-center/text-end Bootstrap utilities working */
.text-center { text-align: center !important; }

/* Pagination direction */
.pagination {
  direction: ltr;
}

/* Dropdown / modal header should align to start */
.modal-title, .modal-body, .dropdown-menu {
  text-align: start;
}

/* Input icons don't flip */
.input-group .input-group-text i {
  direction: ltr;
}

/* ─── Sidebar (admin) ─── */
.sidebar-turath {
  position: sticky;
  top: 1rem;
  height: calc(100vh - 2rem);
  border-radius: var(--tblr-border-radius-lg);
  background: #fff;
  border: 1px solid var(--turath-border);
  padding: 1rem;
  overflow-y: auto;
}
.sidebar-turath .sidebar-brand {
  padding: 0.5rem 0.75rem 1.25rem;
  border-bottom: 1px solid var(--turath-border);
  margin-bottom: 0.75rem;
}
.sidebar-turath .nav-item {
  margin-bottom: 2px;
}
.sidebar-turath .nav-link {
  color: #374151;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sidebar-turath .nav-link i {
  font-size: 1.1rem;
  color: #6b7280;
}
.sidebar-turath .nav-link:hover {
  background: #f3f4f6;
  color: var(--turath-dark);
}
.sidebar-turath .nav-link:hover i { color: var(--turath-dark); }
.sidebar-turath .nav-link.active {
  background: linear-gradient(135deg, var(--turath-dark), var(--turath-navy));
  color: #fff;
}
.sidebar-turath .nav-link.active i { color: #fff; }
.sidebar-turath .nav-section {
  padding: 0.75rem 0.9rem 0.25rem;
  color: #9ca3af;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Auth page ─── */
.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--turath-deep) 0%, var(--turath-dark) 60%, var(--turath-navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}
.auth-bg::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(184,134,11,.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(26,58,142,.25) 0%, transparent 40%);
}
.auth-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: var(--tblr-border-radius-xl);
  padding: 2.5rem;
  box-shadow: 0 25px 50px rgba(0,0,0,.3);
  width: 100%;
  max-width: 440px;
}
.auth-card .logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--turath-dark), var(--turath-gold));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  color: #fff; font-size: 2rem;
  box-shadow: 0 8px 20px rgba(11,26,62,.3);
}

/* ─── Footer ─── */
.footer-turath {
  background: #fff;
  border-top: 1px solid var(--turath-border);
  padding: 1.5rem 0;
  margin-top: 3rem;
  color: #6b7280;
  font-size: 0.85rem;
  text-align: center;
}

/* ─── Utilities ─── */
.section-gap { padding: 2.5rem 0; }
.text-turath { color: var(--turath-dark) !important; }
.bg-turath { background: var(--turath-dark) !important; color: #fff; }
.border-turath { border-color: var(--turath-dark) !important; }
.shadow-turath { box-shadow: 0 10px 30px rgba(11,26,62,.1); }

/* smooth page transitions */
@media (prefers-reduced-motion: no-preference) {
  main, .page-wrapper { animation: fadeIn .3s ease; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* mobile tweaks */
@media (max-width: 767.98px) {
  .hero-turath { padding: 3rem 0 5rem; }
  .kpi-card .kpi-value { font-size: 1.75rem; }
  .sidebar-turath { position: static; height: auto; margin-bottom: 1rem; }
}
