/* =====================================================================
   DHRL - Design system  (mobile-first, responsive, RTL-ready)
   Sections: 1 Tokens · 2 Base · 3 Utilities · 4 App shell · 5 Buttons
   6 Forms · 7 Cards & stats · 8 Tables · 9 Badges & alerts · 10 Nav parts
   11 Modal & dropdown · 12 Auth pages · 13 Landing · 14 Misc · 15 Responsive
   Uses CSS logical properties (margin-inline, inset-inline-start...) so an
   Arabic / RTL version only needs <html dir="rtl">.
   ===================================================================== */

/* 1. TOKENS ---------------------------------------------------------- */
:root {
  --primary: #168a2a;
  --primary-600: #0f6e20;
  --primary-50: #eaf5e8;
  --primary-100: #d3ebce;
  --accent: #8f1515;

  --success: #16a34a;  --success-bg: #dcfce7;
  --warning: #b45309;  --warning-bg: #fef3c7;
  --danger:  #dc2626;  --danger-bg:  #fee2e2;
  --info:    #0369a1;  --info-bg:    #e0f2fe;
  --neutral: #475569;  --neutral-bg: #edf3ec;

  --bg: #f3f8f1;
  --surface: #ffffff;
  --border: #dde8d9;
  --border-strong: #c3d4bd;
  --text: #10231a;
  --text-2: #2c4036;
  --muted: #5f7568;

  --sidebar-bg: #08402b;
  --sidebar-text: #a9cbb8;
  --sidebar-active: #ffffff;
  --sidebar-w: 268px;
  --topbar-h: 64px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, .16);
  --ring: 0 0 0 3px rgba(22, 138, 42, .22);

  --font: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Arial, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* 2. BASE ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
img, svg { max-width: 100%; vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::selection { background: var(--primary-100); }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 3. UTILITIES ------------------------------------------------------- */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
.flex { display: flex; } .inline-flex { display: inline-flex; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; } .justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1; } .flex-col { flex-direction: column; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 24px; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 24px; }
.text-muted { color: var(--muted); } .text-sm { font-size: .875rem; } .text-xs { font-size: .78rem; }
.text-center { text-align: center; } .text-end { text-align: end; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.w-100 { width: 100%; } .hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 4. APP SHELL (sidebar + topbar + content) -------------------------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w);
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; z-index: 60;
  transition: transform .25s var(--ease);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 22px; color: #fff; font-weight: 700; font-size: 1.05rem; }
.sidebar-brand img { width: 34px; height: 34px; }
.sidebar-brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--sidebar-text); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 14px 20px; }
.nav-section { margin: 18px 10px 8px; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #64748b; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px;
  border-radius: 10px; color: var(--sidebar-text); font-weight: 500; font-size: .92rem;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.active { background: var(--primary); color: var(--sidebar-active); box-shadow: 0 6px 16px rgba(22, 138, 42, .35); }
.nav-link .count { margin-inline-start: auto; background: rgba(255, 255, 255, .14); color: #fff; font-size: .72rem; padding: 1px 8px; border-radius: 99px; }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 55; opacity: 0; visibility: hidden; transition: .25s; }

.main { margin-inline-start: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding-inline: 28px;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; margin-inline-start: -8px; color: var(--text); cursor: pointer; border-radius: 8px; }
.menu-toggle:hover { background: var(--neutral-bg); }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: none; border: 0; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--neutral-bg); }
.icon-btn .dot { position: absolute; top: 8px; inset-inline-end: 9px; min-width: 16px; height: 16px; padding-inline: 4px; background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700; border-radius: 99px; display: grid; place-items: center; border: 2px solid #fff; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 99px; cursor: pointer; border: 0; background: none; font: inherit; color: inherit; }
.user-chip:hover { background: var(--neutral-bg); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-100); color: var(--primary-600); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.user-meta { line-height: 1.2; text-align: start; }
.user-meta strong { display: block; font-size: .88rem; }
.user-meta span { font-size: .74rem; color: var(--muted); }

.content { padding: 28px; flex: 1; width: 100%; max-width: 1360px; margin-inline: auto; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.page-header h1 { margin: 0; }
.page-header p { margin: 4px 0 0; color: var(--muted); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); } .breadcrumb a:hover { color: var(--primary); }
.breadcrumb span::before { content: "/"; margin-inline-end: 6px; opacity: .5; }
.footer { padding: 18px 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; background: var(--surface); }

/* 5. BUTTONS --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; min-height: 42px; border-radius: 10px; border: 1px solid transparent;
  font: 600 .92rem/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(22, 138, 42, .3); }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--neutral-bg); color: var(--text); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-50); }
.btn-success { background: var(--success); color: #fff; } .btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; } .btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-outline-danger { background: #fff; color: var(--danger); border-color: #fca5a5; } .btn-outline-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: 14px 26px; min-height: 50px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn.loading { pointer-events: none; opacity: .8; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 6. FORMS ----------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .86rem; color: var(--text-2); }
.label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px; font: inherit; font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #94a3b8; }
.input:hover, .select:hover, .textarea:hover { border-color: #94a3b8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.select { appearance: none; padding-inline-end: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
[dir="rtl"] .select { background-position: left 12px center; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); }
.field-error { margin-top: 5px; font-size: .8rem; color: var(--danger); }
.help { margin-top: 5px; font-size: .8rem; color: var(--muted); }
.input-group { position: relative; }
.input-group .input { padding-inline-start: 42px; }
.input-group .icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.input-group .toggle-pass { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 8px; color: var(--muted); cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { inset-inline-start: 23px; }
.file-drop { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); background: #fafbff; cursor: pointer; transition: .15s; }
.file-drop:hover, .file-drop.dragover { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-bar .form-group { margin: 0; min-width: 160px; flex: 1; }

/* 7. CARDS & STATS --------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-header h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }
.card-hover { transition: transform .2s var(--ease), box-shadow .2s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat { display: flex; align-items: center; gap: 16px; padding: 20px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-50); color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.teal { background: #dcfce7; color: var(--primary); }
.stat-value { font-size: 1.65rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .84rem; margin-top: 2px; }
.progress { height: 8px; background: var(--neutral-bg); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), #4ade80); border-radius: 99px; transition: width .4s var(--ease); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .icon { width: 44px; height: 44px; color: #cbd5e1; margin-bottom: 10px; }
.empty h3 { color: var(--text-2); }
.tier-banner { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-radius: var(--radius); background: linear-gradient(120deg, var(--primary-50), #f0fdfa); border: 1px solid var(--primary-100); }
.locked { position: relative; filter: blur(5px); user-select: none; pointer-events: none; }
.candidate-card { padding: 20px; display: flex; gap: 16px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--neutral-bg); color: var(--text-2); font-size: .78rem; font-weight: 500; }
.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 18px 20px; padding-inline: 20px 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }

/* 8. TABLES ---------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; padding: 12px 18px; background: #f3f8f1; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: #f4faf3; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.page-link { min-width: 36px; height: 36px; display: inline-grid; place-items: center; padding-inline: 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: .85rem; font-weight: 600; }
.page-link:hover { background: var(--primary-50); color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .45; pointer-events: none; }

/* 9. BADGES & ALERTS ------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; border: 1px solid; margin-bottom: 16px; font-size: .92rem; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error, .alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.alert .close { margin-inline-start: auto; background: none; border: 0; font-size: 1.2rem; line-height: 1; color: inherit; cursor: pointer; opacity: .6; }
.toast-stack { position: fixed; top: 76px; inset-inline-end: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast-stack .alert { margin: 0; box-shadow: var(--shadow-lg); animation: slideIn .3s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* 10. TABS / MISC NAV ------------------------------------------------ */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab { padding: 10px 16px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-color: var(--primary); }

/* 11. MODAL & DROPDOWN ----------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, .55); }
.modal.open { display: flex; }
.modal-dialog { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: slideIn .25s var(--ease); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 70; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: .9rem; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: start; }
.dropdown-item:hover { background: var(--neutral-bg); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* 12. AUTH PAGES (login / register) ---------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-aside {
  position: relative; padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 500px at 0% 0%, rgba(74, 222, 128, .28), transparent 60%),
              linear-gradient(145deg, #052e1c 0%, #0b5a35 100%);
}
.auth-aside h2 { color: #fff; font-size: 2rem; line-height: 1.2; max-width: 440px; }
.auth-aside p { color: #cbd5e1; max-width: 440px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: #e2e8f0; }
.auth-points .icon { color: #86efac; margin-top: 2px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--surface); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 1.65rem; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: inherit; margin-bottom: 28px; }
.auth-logo img { width: 36px; height: 36px; }
.auth-switch { text-align: center; margin-top: 22px; color: var(--muted); font-size: .92rem; }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 24px; }
.role-tab { padding: 12px 8px; text-align: center; border: 1px solid var(--border-strong); border-radius: 10px; font-weight: 600; font-size: .85rem; color: var(--text-2); background: #fff; }
.role-tab:hover { border-color: var(--primary); color: var(--primary); }
.role-tab.active { background: var(--primary-50); border-color: var(--primary); color: var(--primary); }

/* 13. LANDING PAGE --------------------------------------------------- */
.nav-public { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-public .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a:not(.btn) { color: var(--text-2); font-weight: 500; font-size: .93rem; }
.nav-links a:not(.btn):hover { color: var(--primary); }
.hero { padding: 84px 0 72px; background: radial-gradient(900px 420px at 85% -10%, var(--primary-100), transparent 60%), radial-gradient(700px 380px at 0% 30%, #dcfce7, transparent 60%), var(--bg); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -.03em; line-height: 1.1; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lead { font-size: 1.15rem; color: var(--text-2); max-width: 560px; }
.eyebrow { display: inline-block; padding: 5px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--primary-100); color: var(--primary); font-weight: 700; font-size: .78rem; margin-bottom: 18px; }
.section { padding: 72px 0; }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-title p { color: var(--muted); font-size: 1.05rem; }
.feature { padding: 26px; }
.feature .stat-icon { margin-bottom: 16px; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: 14px; }
.cta-band { background: linear-gradient(135deg, #0b4d2e, var(--primary)); color: #fff; border-radius: var(--radius-lg); padding: 48px; text-align: center; }
.cta-band h2 { color: #fff; } .cta-band p { color: #dbeafe; }
.footer-public { background: #08402b; color: #a9cbb8; padding: 40px 0; font-size: .9rem; }

/* 14. MISC ----------------------------------------------------------- */
.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f8fafc 37%, #eef1f6 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; min-height: 16px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; margin: 20px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; }
.notif-item { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.notif-item.unread { background: var(--primary-50); }

/* 15. RESPONSIVE ----------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
  body.sidebar-open { overflow: hidden; }
  .main { margin-inline-start: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding-inline: 16px; }
  .content { padding: 20px 16px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .grid-2, .grid-3, .grid-4, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .user-meta { display: none; }
  .page-header { align-items: flex-start; }
  .page-header .btn { width: 100%; }
  .card-body { padding: 16px; } .card-header { padding: 14px 16px; }
  .hero { padding: 48px 0 40px; } .section { padding: 48px 0; }
  .cta-band { padding: 32px 20px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 10px; }
  .candidate-card { flex-direction: column; }
  .role-tabs { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .toast-stack { inset-inline: 12px; width: auto; }
  /* stacked mobile tables: add data-label="Column" to every <td> */
  .table-stack thead { display: none; }
  .table-stack tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table-stack td { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border: 0; text-align: end; }
  .table-stack td::before { content: attr(data-label); color: var(--muted); font-weight: 600; font-size: .78rem; text-align: start; }
  .table-stack .actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .sidebar, .topbar, .footer, .btn, .toast-stack { display: none !important; } .main { margin: 0; } body { background: #fff; } }
/* 16. AUTH POLISH (login / register on phones and tablets) ------------ */
.mobile-only { display: none; }
.auth-main { background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); }
.auth-card { padding-block: 8px; }
.auth-card .alert { margin-bottom: 18px; }
@media (max-width: 992px) {
  .mobile-only { display: flex; }
  .auth-main { align-items: flex-start; padding: 28px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .auth-card, .auth-card.wide { max-width: 560px; margin-inline: auto; }
}
@media (max-width: 640px) {
  .input, .select, .textarea { font-size: 16px; }   /* stops iOS zooming into fields */
  .auth-card h1 { font-size: 1.45rem; }
  .role-tab { padding: 10px 4px; font-size: .78rem; }
  .auth-main { padding-top: 20px; }
}

/* 17. SDF GREEN THEME (matches skilldevelopmentfoundation.com) -------- */
:root { --maroon: #8f1515; --maroon-600: #741010; --green-dark: #0b4d2e; }
body { font-weight: 400; }
h1, h2, h3, h4 { font-weight: 700; color: var(--green-dark); }
.btn { border-radius: 999px; }
.btn-primary { background: linear-gradient(135deg, #1a9a2f, var(--primary)); }
.btn-primary:hover { background: var(--primary-600); }
.btn-maroon { background: var(--maroon); color: #fff; } .btn-maroon:hover { background: var(--maroon-600); color: #fff; }
.card { border-radius: 16px; }
.hero h1 em, .auth-card h1 em { color: var(--primary); font-style: normal; }
.sidebar-brand span { color: #fff; }

/* 18. ACCOUNT TYPE CHOOSER (register) ---------------------------------- */
.choose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 26px 0 8px; }
.choose-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 30px 20px; background: var(--primary-50); border: 2px solid var(--primary); border-radius: 18px; color: var(--text); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.choose-card.alt { border-color: var(--maroon); background: #fbf1f1; }
.choose-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); }
.choose-card .choose-icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--primary); }
.choose-card.alt .choose-icon { color: var(--maroon); }
.choose-card .choose-icon .icon { width: 28px; height: 28px; }
.choose-card strong { font-size: 1.15rem; color: var(--green-dark); }
.choose-card span.d { font-size: .88rem; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; margin-bottom: 14px; }

/* 19. THANK-YOU + CREDENTIALS BOX ---------------------------------------- */
.thanks { text-align: center; padding: 8px 0; }
.thanks .thanks-icon { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.thanks .thanks-icon .icon { width: 38px; height: 38px; }
.cred-box { border: 2px dashed var(--primary); background: var(--primary-50); border-radius: 14px; padding: 18px 20px; }
.cred-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--primary-100); flex-wrap: wrap; }
.cred-row:last-child { border-bottom: 0; }
.cred-row span { color: var(--muted); font-size: .85rem; }
.cred-row code { font-size: .98rem; font-weight: 600; color: var(--green-dark); word-break: break-all; }
@media (max-width: 640px) { .choose-grid { grid-template-columns: 1fr; } .choose-card { padding: 22px 16px; } }

/* 20. CANDIDATE DASHBOARD  (student/dashboard.php, scoped with .cd-) ---- */
.cd [hidden] { display: none !important; }
.cd { max-width: 1180px; margin-inline: auto; display: flex; flex-direction: column; gap: 20px; }
.cd form { display: flex; flex-direction: column; gap: 20px; }
/* student dashboard now shows the same top bar (bell + profile photo) as every other panel */

.cd-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.cd-head h1 { margin: 0 0 4px; font-size: 1.75rem; }
.cd-head p { margin: 0; color: var(--muted); }
.cd-status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; font-size: .84rem; font-weight: 600; background: var(--neutral-bg); color: var(--neutral); border: 1px solid var(--border); }
.cd-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cd-status--submitted { background: var(--warning-bg); color: var(--warning); border-color: #fde68a; }
.cd-status--approved { background: var(--success-bg); color: #166534; border-color: #bbf7d0; }
.cd-status--rejected { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }

.cd-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 24px; scroll-margin-top: 84px; }
.cd-card h2 { margin: 0 0 2px; font-size: 1.1rem; }
.cd-sub { margin: 0 0 18px; color: var(--muted); font-size: .88rem; }
.cd-grid { display: grid; gap: 16px; }
.cd-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cd-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cd-gap-top { margin-top: 16px; }

/* progress */
.cd-progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cd-progress h2 { margin: 0; }
.cd-percent { font-size: 1.4rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }
.cd-bar { height: 10px; border-radius: 99px; background: #e6efe3; overflow: hidden; }
.cd-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary-600), #3fbf5a); transition: width .5s var(--ease); }
.cd-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cd-step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fbfdfb; min-width: 0; }
.cd-step-n { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: #eef3ec; color: var(--muted); }
.cd-step-t { display: flex; flex-direction: column; font-size: .84rem; font-weight: 600; color: var(--text-2); line-height: 1.25; min-width: 0; }
.cd-step-t b { font-size: .76rem; font-weight: 700; }
.cd-step--done { background: #f3fbf4; border-color: #cdebd2; }
.cd-step--done .cd-step-n { background: var(--primary); color: #fff; }
.cd-step--done b { color: var(--primary); }
.cd-step--incomplete .cd-step-n, .cd-step--missing .cd-step-n { background: var(--warning-bg); color: var(--warning); }
.cd-step--incomplete b, .cd-step--missing b { color: var(--warning); }

/* resume */
.file-drop.cd-drop { display: flex; align-items: center; gap: 16px; padding: 18px 20px; text-align: start; background: #f6fbf5; border: 1.5px dashed #86c98f; border-radius: 14px; color: var(--text); }
.file-drop.cd-drop:hover, .file-drop.cd-drop.dragover { background: var(--primary-50); border-color: var(--primary); color: var(--text); }
.file-drop.cd-drop:focus-within, .cd-upload:focus-within, .cd-file:focus-within { box-shadow: var(--ring); }
.cd-drop-ic { width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 1px solid var(--border); color: var(--primary); display: grid; place-items: center; flex: none; }
.cd-drop-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cd-drop-t small { color: var(--muted); font-size: .84rem; }
.file-drop.cd-drop.is-invalid, .cd-upload.is-invalid { border-color: var(--danger); }
.cd-note { margin: 12px 0 0; color: var(--muted); font-size: .86rem; }
.cd-picked { margin: 10px 0 0; color: var(--primary-600); font-size: .84rem; font-weight: 500; overflow-wrap: anywhere; }
.cd-file { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fbfdfb; }
.cd-file-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }
.cd-file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cd-file-meta span { color: var(--muted); font-size: .82rem; }
.cd-file-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* last course uploads */
.cd-upload { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border: 1.5px dashed var(--border-strong); border-radius: 14px; background: #fbfdfb; }
.cd-upload-t { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.cd-upload-t small { color: var(--muted); font-size: .82rem; }
.cd-upload-t .cd-picked { margin-top: 6px; }
.cd-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 8px; padding: 3px 6px 3px 10px; border-radius: 99px; background: var(--primary-50); color: var(--primary-600); font-size: .8rem; font-weight: 500; }
.cd-chip a { color: inherit; max-width: 200px; }
.cd-x { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.cd-x:hover { background: var(--primary-100); }
.cd-inst-other { margin-top: 10px; }

/* other trades multi-select */
.cd-multi { position: relative; }
.cd-multi summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.cd-multi summary::-webkit-details-marker { display: none; }
.cd-multi summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-multi[open] summary { border-color: var(--primary); box-shadow: var(--ring); }
.cd-multi-menu { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 20; max-height: 260px; overflow: auto; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.cd-multi-menu .check { align-items: center; padding: 9px 10px; border-radius: 8px; }
.cd-multi-menu .check:hover { background: var(--primary-50); }

/* privacy + actions */
.cd-check { align-items: center; padding: 8px 0; font-size: .92rem; }
.cd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-bottom: 8px; }
.cd-actions .btn { min-width: 180px; }
.cd-hint { margin: 0; flex: 1 1 240px; color: var(--muted); font-size: .86rem; }

@media (max-width: 1100px) {
  .cd-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cd-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  .cd-head h1 { font-size: 1.5rem; }
}
@media (max-width: 640px) {
  .cd { gap: 16px; } .cd form { gap: 16px; }
  .cd-card { padding: 18px 16px; border-radius: 14px; }
  .cd-grid-2, .cd-grid-4, .cd-steps { grid-template-columns: 1fr; }
  .cd-head h1 { font-size: 1.35rem; }
  .file-drop.cd-drop { flex-wrap: wrap; }
  .file-drop.cd-drop .btn { width: 100%; }
  .cd-file { flex-wrap: wrap; }
  .cd-file-actions { width: 100%; }
  .cd-file-actions .btn { flex: 1; }
  .cd-upload { flex-wrap: wrap; }
  .cd-upload > .btn { width: 100%; }
  .cd-actions { position: sticky; bottom: 0; z-index: 30; margin-inline: -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--border); box-shadow: 0 -6px 18px rgba(15, 23, 42, .06); }
  .cd-actions { gap: 8px 10px; }
  .cd-actions .btn { flex: 1 1 140px; min-width: 0; min-height: 46px; padding: 12px 14px; font-size: .9rem; }
  .cd-hint { order: 3; flex-basis: 100%; text-align: center; font-size: .74rem; line-height: 1.3; }
}

/* ===== Shared dashboard hero (command center) + student stats + avatar + live pop-up ===== */
/* Hero Banner - Dark -> Light -> Dark Shade */
    .dash-hero {
        background: linear-gradient(120deg, #062b17 0%, #0b4d2e 30%, #168a2a 50%, #0b4d2e 70%, #062b17 100%);
        background-size: 200% 200%;
        animation: heroShade 12s ease infinite;
        border-radius: 16px;
        padding: 32px;
        margin-bottom: 24px;
        color: white;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 10px 40px -10px rgba(7, 58, 29, 0.4);
        position: relative;
        overflow: hidden;
        flex-wrap: wrap;
        gap: 20px;
    }
    @keyframes heroShade {
        0% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }
    .dash-hero::before {
        content: '';
        position: absolute;
        top: -50%; right: -10%; width: 400px; height: 400px;
        background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
        border-radius: 50%;
    }
    .dash-hero-content { position: relative; z-index: 10; }
    .dash-hero-content h1 { font-size: 1.8rem; font-weight: 700; margin: 0 0 8px 0; color: #fff; display: flex; align-items: center; gap: 10px; }
    .dash-hero-content p { opacity: 0.85; margin: 0; font-size: 0.95rem; }
    
    .dash-hero-actions { display: flex; gap: 12px; z-index: 10; flex-wrap: wrap; }
    .dash-hero-actions .btn {
        background: rgba(255, 255, 255, 0.15) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
        backdrop-filter: blur(10px);
        border-radius: 8px;
        font-weight: 600;
        padding: 10px 20px;
        transition: all 0.2s;
    }
    .dash-hero-actions .btn:hover { background: rgba(255, 255, 255, 0.25) !important; transform: translateY(-2px); }
    .dash-hero-actions .btn-primary { background: #10b981 !important; border-color: #10b981 !important; }
    .dash-hero-actions .btn-primary:hover { background: #059669 !important; box-shadow: 0 4px 12px rgba(16,185,129,0.4); }
@media (max-width: 640px) {
  .dash-hero { padding: 22px; flex-direction: column; align-items: flex-start; }
  .dash-hero-content h1 { font-size: 1.4rem; }
  .dash-hero-actions { width: 100%; }
  .dash-hero-actions .btn { flex: 1 1 140px; justify-content: center; }
}
.cd-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
@media (max-width: 960px) { .cd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cd-stats { grid-template-columns: 1fr; } }
.cd-inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.avatar-lg img { border-radius: 50%; }
.toast-live { cursor: default; }
a.card.stat:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }