/* ============================================================
   PARAKH CONSULTING LLP — REFERRAL PORTAL STYLESHEET
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Inter', sans-serif;
  background: #f4f6f8;
  color: #1a1d23;
  line-height: 1.6;
  min-height: 100vh;
}

h1,h2,h3,h4,h5 { font-family: 'Outfit', sans-serif; font-weight: 600; }

a { color: #00adf1; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout Wrapper ──────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR — ALWAYS OPAQUE, ALWAYS VISIBLE
   ══════════════════════════════════════════════════════════ */
.sidebar {
  width: 250px;
  min-width: 250px;
  background-color: #0a2540 !important;
  opacity: 1 !important;
  color: #ffffff !important;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,.18);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background-color: #0a2540 !important;
}

.logo-img {
  height: 36px;
  width: auto;
  border-radius: 4px;
}

.sidebar-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #00adf1 !important;
  line-height: 1.3;
}

/* ── Nav Links ───────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  background-color: #0a2540 !important;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #c8d6e5 !important;
  text-decoration: none !important;
  transition: background .18s, color .18s;
  border-radius: 0;
  cursor: pointer;
}

.nav-link:hover {
  background-color: rgba(255,255,255,.08) !important;
  color: #ffffff !important;
}

.nav-link.active {
  background-color: #00adf1 !important;
  color: #ffffff !important;
  font-weight: 600;
}

.nav-icon { font-size: 1rem; min-width: 20px; }

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: 10px 18px;
}

.nav-section-label {
  display: block;
  padding: 6px 18px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #a6a9ae !important;
}

/* ── Sidebar Footer ──────────────────────────────────────── */
.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,.1);
  background-color: #0a2540 !important;
}

.user-info { margin-bottom: 10px; }
.user-name  { font-weight: 600; color: #fff !important; font-size: .875rem; }
.user-code  { font-size: .75rem; color: #a6a9ae !important; display: flex; align-items: center; gap: 6px; }

.role-badge {
  background: #00adf1;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 20px;
}

.logout-btn {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: rgba(255,255,255,.08);
  color: #c8d6e5 !important;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none !important;
  transition: background .18s;
}
.logout-btn:hover { background: rgba(255,255,255,.16) !important; color: #fff !important; }

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 28px 32px;
  overflow-x: auto;
  max-width: 100%;
}

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title    { font-size: 1.5rem; color: #0a2540; margin-bottom: 2px; }
.page-subtitle { color: #6c757d; font-size: .875rem; }

/* ── Flash Messages ──────────────────────────────────────── */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
  font-size: .875rem;
}
.flash-success { background: #e6f9ee; color: #1a6e35; border: 1px solid #b7e4c7; }
.flash-error   { background: #fdecea; color: #a71d2a; border: 1px solid #f5c6cb; }

/* ── Alert Boxes ─────────────────────────────────────────── */
.alert { padding: 14px 16px; border-radius: 8px; margin-bottom: 20px; font-size: .875rem; }
.alert-error   { background: #fdecea; color: #a71d2a; border: 1px solid #f5c6cb; }
.alert-success { background: #e6f9ee; color: #1a6e35; border: 1px solid #b7e4c7; }
.alert ul { padding-left: 18px; }
.alert li { margin: 4px 0; }

/* ── Metric Cards ────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.metric-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  transition: box-shadow .2s, transform .2s;
}
.metric-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.09); transform: translateY(-1px); }

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.metric-value { font-size: 1.7rem; font-weight: 700; color: #0a2540; font-family: 'Outfit',sans-serif; }
.metric-label { font-size: .78rem; color: #6c757d; font-weight: 500; }
.metric-sub   { font-size: .78rem; color: #00adf1; font-weight: 600; margin-top: 2px; }

/* ── Sections ────────────────────────────────────────────── */
.section { margin-bottom: 32px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 1.05rem; color: #0a2540; }
.section-link  { font-size: .825rem; font-weight: 600; color: #00adf1; }

/* ── Open Positions Grid ─────────────────────────────────── */
.positions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 16px;
}

.position-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.position-card:hover {
  border-color: #00adf1;
  box-shadow: 0 4px 16px rgba(0,173,241,.12);
  transform: translateY(-2px);
}
.position-title { font-family:'Outfit',sans-serif; font-weight: 700; font-size: 1rem; color: #0a2540; margin-bottom: 6px; }
.position-bonus { font-size: .83rem; color: #6c757d; margin-bottom: 14px; }
.position-bonus strong { color: #28a745; }
.position-apply-btn { width: 100%; text-align: center; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .845rem;
}
.data-table thead tr { background: #f8fafc; border-bottom: 2px solid #e2e8f0; }
.data-table th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafbfc; }
.row-inactive { opacity: .55; }
.empty-row { text-align: center; color: #6c757d; padding: 28px; }
.actions-cell { white-space: nowrap; }
.actions-cell > * { margin-right: 6px; }
.text-muted { color: #6c757d; }
code.code-tag {
  background: #f0f2f5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .8rem;
  font-family: monospace;
  color: #0a2540;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-warning  { background: #fff3cd; color: #856404; }
.badge-success  { background: #d4edda; color: #155724; }
.badge-danger   { background: #f8d7da; color: #721c24; }
.badge-grey     { background: #e9ecef; color: #495057; }
.badge-primary  { background: #cce9fa; color: #00618a; }
.badge-teal     { background: #d1f0ec; color: #0d6e5e; }
.badge-dark     { background: #343a40; color: #fff; }

/* Tooltip on hover (for Rejected/Ineligible reason) */
.has-tooltip { cursor: help; position: relative; }
.has-tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 400;
  white-space: nowrap;
  max-width: 280px;
  white-space: pre-wrap;
  z-index: 999;
  pointer-events: none;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.filter-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .845rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .12s;
  text-decoration: none !important;
  white-space: nowrap;
  font-family: inherit;
}
.btn:active { transform: scale(.97); }

.btn-primary  { background: #00adf1; color: #fff; border-color: #00adf1; }
.btn-primary:hover { background: #0097d6; border-color: #0097d6; box-shadow: 0 4px 12px rgba(0,173,241,.3); }

.btn-success  { background: #28a745; color: #fff; border-color: #28a745; }
.btn-success:hover { background: #218838; border-color: #218838; }

.btn-danger   { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-danger:hover { background: #c82333; border-color: #c82333; }

.btn-outline  { background: transparent; color: #495057; border-color: #ced4da; }
.btn-outline:hover { background: #f8f9fa; border-color: #adb5bd; }

.btn-sm { padding: 5px 12px; font-size: .78rem; border-radius: 6px; }
.btn-full { width: 100%; }

.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  max-width: 820px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: #344054;
  display: flex;
  align-items: center;
  gap: 6px;
}
.required { color: #dc3545; }
.form-hint { font-size: .73rem; color: #6c757d; font-weight: 400; }

.form-input, .form-select {
  padding: 9px 12px;
  border: 1.5px solid #d0d5dd;
  border-radius: 8px;
  font-size: .875rem;
  color: #1a1d23;
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
  font-family: inherit;
  width: 100%;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: #00adf1;
  box-shadow: 0 0 0 3px rgba(0,173,241,.15);
}
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.input-with-toggle { position: relative; display: flex; }
.input-with-toggle .form-input { padding-right: 42px; }
.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  color: #666;
}
.toggle-password:hover { color: #00adf1; }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
  margin-top: 4px;
}

/* ── File Upload ─────────────────────────────────────────── */
.file-input { display: none; }
.file-upload-wrapper { position: relative; }
.file-upload-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px dashed #ced4da;
  border-radius: 8px;
  cursor: pointer;
  font-size: .845rem;
  color: #495057;
  transition: border-color .18s, background .18s;
}
.file-upload-label:hover { border-color: #00adf1; background: #f0f9fe; }
.file-upload-icon { font-size: 1.2rem; }

/* ── Password Policy Box ─────────────────────────────────── */
.password-policy-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.policy-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.policy-list li { font-size: .83rem; color: #6c757d; padding-left: 20px; position: relative; }
.policy-list li::before { content: '○'; position: absolute; left: 0; color: #adb5bd; }

.policy-list-sm { margin-top: 6px; }
.policy-list-sm li { font-size: .75rem; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,37,64,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 680px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f2f5;
}
.modal-title  { font-size: 1.05rem; color: #0a2540; }
.modal-close  { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: #6c757d; padding: 4px; border-radius: 4px; }
.modal-close:hover { background: #f0f2f5; color: #0a2540; }

.modal > *:not(.modal-header):not(.modal-body-scroll) { padding: 0 24px; }
.modal > .form-group { padding: 0 24px; }
.modal > p.modal-body { padding: 16px 24px 0; color: #495057; font-size: .875rem; }
.modal > p.modal-note { padding: 6px 24px 0; color: #6c757d; font-size: .78rem; }

.modal-body-scroll { padding: 0 24px; }
.modal-section {
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}
.modal-section-title { font-size: .9rem; margin-bottom: 12px; color: #0a2540; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid #f0f2f5;
  margin-top: 8px;
}

.save-msg { font-size: .8rem; margin-left: 8px; vertical-align: middle; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  background: #fff;
  border-radius: 12px;
  padding: 52px 32px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.empty-icon { font-size: 2.8rem; margin-bottom: 12px; }
.empty-state p { color: #6c757d; font-size: .9rem; }

/* ── Admin Quick Links ───────────────────────────────────── */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 16px;
}
.quick-link-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  font-size: .875rem;
  font-weight: 600;
  color: #0a2540;
  text-decoration: none !important;
  line-height: 1.8;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.quick-link-card:hover {
  border-color: #00adf1;
  box-shadow: 0 4px 14px rgba(0,173,241,.14);
  transform: translateY(-2px);
  color: #00adf1;
}

/* ── Login Page ──────────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, #0a2540 0%, #0d3460 60%, #155fa0 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-wrapper { width: 100%; max-width: 440px; }

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 36px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}

.login-logo { text-align: center; margin-bottom: 28px; }
.login-title {
  font-size: 1.25rem;
  color: #0a2540;
  margin-bottom: 4px;
}
.login-subtitle { font-size: .83rem; color: #6c757d; }

.captcha-group .captcha-row { display: flex; align-items: center; gap: 12px; }
.captcha-question {
  background: #f0f9fe;
  border: 1.5px solid #cce9fa;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: .9rem;
  white-space: nowrap;
  color: #0a2540;
}
.captcha-input { max-width: 120px; }

.login-footer {
  text-align: center;
  color: rgba(255,255,255,.5);
  font-size: .75rem;
  margin-top: 16px;
}

/* ── Scrollbar Styles ────────────────────────────────────── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 200px; min-width: 200px; }
  .main-content { padding: 20px 16px; }
  .page-header { flex-direction: column; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .sidebar { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
}

/* ── Utility ─────────────────────────────────────────────── */
.admin-table { font-size: .8rem; }
.admin-quick-links { margin-top: 28px; }

/* ─── TOP BAR ─────────────────────────────────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 0 16px 0;
}
.top-bar-right { display: flex; align-items: center; gap: 12px; }

/* ─── NOTIFICATION BELL ───────────────────────────────────────────────────── */
.notif-wrapper { position: relative; }
.notif-btn {
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  width: 42px; height: 42px;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.notif-btn:hover { border-color: #00adf1; box-shadow: 0 0 0 3px rgba(0,173,241,0.1); }
.notif-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: #dc3545;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
}
.notif-dropdown {
  position: absolute;
  right: 0; top: 50px;
  width: 360px;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 1000;
  overflow: hidden;
}
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f4f8;
  font-weight: 600; font-size: 14px; color: #0a2540;
}
.notif-mark-read {
  background: none; border: none;
  color: #00adf1; font-size: 12px; cursor: pointer;
  padding: 0;
}
.notif-mark-read:hover { text-decoration: underline; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f7fafc;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: #f7fafc; }
.notif-unread { background: #f0f9ff; border-left: 3px solid #00adf1; }
.notif-msg { font-size: 13px; color: #334155; line-height: 1.5; }
.notif-time { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.notif-empty { padding: 24px; text-align: center; color: #94a3b8; font-size: 13px; }

/* ─── DETAIL MODAL ────────────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 20px 24px;
}
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #00adf1;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}
.detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}
.detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #94a3b8;
}
.detail-value {
  font-size: 14px;
  color: #0a2540;
  line-height: 1.5;
  word-break: break-word;
}

/* ─── FORM TEXTAREA ───────────────────────────────────────────────────────── */
.form-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}
.char-count {
  text-align: right;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}
