/* ═══════════════════════════════════════════════════════════════
   RECRUITFLOW PRO - COMPLETE UI REDESIGN
   Modern, clean, professional recruitment platform
═══════════════════════════════════════════════════════════════ */

/* Inter font is enqueued via wp_enqueue_style in RF_Public::enqueue_assets() */

/* ── CSS RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand — Greenhouse/Lever teal */
  --rf-primary: #0d9488;
  --rf-primary-dark: #0f766e;
  --rf-primary-light: #14b8a6;
  --rf-primary-faint: #f0fdfa;
  --rf-accent: #6366f1;
  --rf-accent-light: #818cf8;

  /* Sidebar */
  --rf-sidebar-bg: #1e293b;
  --rf-sidebar-width: 220px;

  /* Semantic */
  --rf-success: #16a34a;
  --rf-success-light: #22c55e;
  --rf-warning: #d97706;
  --rf-danger: #dc2626;
  --rf-info: #0284c7;

  /* Neutral — slate palette (blue-tinted grays, professional) */
  --rf-gray-50:  #f8fafc;
  --rf-gray-100: #f1f5f9;
  --rf-gray-200: #e2e8f0;
  --rf-gray-300: #cbd5e1;
  --rf-gray-400: #94a3b8;
  --rf-gray-500: #64748b;
  --rf-gray-600: #475569;
  --rf-gray-700: #334155;
  --rf-gray-800: #1e293b;
  --rf-gray-900: #0f172a;

  /* Typography */
  --rf-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --rf-space-1: 0.25rem;
  --rf-space-2: 0.5rem;
  --rf-space-3: 0.75rem;
  --rf-space-4: 1rem;
  --rf-space-5: 1.25rem;
  --rf-space-6: 1.5rem;
  --rf-space-8: 2rem;
  --rf-space-10: 2.5rem;
  --rf-space-12: 3rem;
  --rf-space-16: 4rem;

  /* Border radius — tighter, ATS-tool feel */
  --rf-radius-sm: 3px;
  --rf-radius:    5px;
  --rf-radius-md: 6px;
  --rf-radius-lg: 8px;
  --rf-radius-xl: 12px;
  --rf-radius-full: 9999px;

  /* Shadows — cleaner, lighter */
  --rf-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --rf-shadow:    0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.04);
  --rf-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --rf-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --rf-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);

  /* Transitions */
  --rf-transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --rf-transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: var(--rf-font);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--rf-gray-900);
  background-color: var(--rf-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── ANIMATIONS ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.rf-animate-in { animation: fadeIn 0.3s ease-out; }
.rf-animate-slide { animation: slideIn 0.3s ease-out; }
.rf-spin { animation: spin 1s linear infinite; }
.rf-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ═══════════════════════════════════════════════════════════════
   COMPONENT LIBRARY
═══════════════════════════════════════════════════════════════ */

/* ── BUTTONS ── */
.rf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rf-space-2);
  padding: var(--rf-space-3) var(--rf-space-4);
  font-family: var(--rf-font);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--rf-radius);
  cursor: pointer;
  text-decoration: none;
  transition: var(--rf-transition);
  white-space: nowrap;
  user-select: none;
}

.rf-btn:focus {
  outline: 2px solid var(--rf-primary);
  outline-offset: 2px;
}

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

/* Button Variants */
.rf-btn-primary {
  background-color: var(--rf-primary);
  color: white;
  box-shadow: var(--rf-shadow-sm);
}

.rf-btn-primary:hover:not(:disabled) {
  background-color: var(--rf-primary-dark);
  box-shadow: var(--rf-shadow);
}

.rf-btn-secondary {
  background-color: white;
  color: var(--rf-gray-700);
  border-color: var(--rf-gray-300);
  box-shadow: var(--rf-shadow-sm);
}

.rf-btn-secondary:hover:not(:disabled) {
  background-color: var(--rf-gray-50);
  border-color: var(--rf-gray-400);
}

.rf-btn-ghost {
  background-color: transparent;
  color: var(--rf-gray-600);
}

.rf-btn-ghost:hover:not(:disabled) {
  background-color: var(--rf-gray-100);
  color: var(--rf-gray-900);
}

.rf-btn-outline {
  background-color: transparent;
  color: var(--rf-primary);
  border-color: var(--rf-primary);
}

.rf-btn-outline:hover:not(:disabled) {
  background-color: rgb(13 148 136 / 0.07);
}

.rf-btn-success {
  background-color: var(--rf-success);
  color: white;
}

.rf-btn-success:hover:not(:disabled) {
  background-color: #059669;
}

.rf-btn-danger {
  background-color: var(--rf-danger);
  color: white;
}

.rf-btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
}

/* Button Sizes */
.rf-btn-sm {
  padding: var(--rf-space-2) var(--rf-space-3);
  font-size: 0.75rem;
}

.rf-btn-lg {
  padding: var(--rf-space-4) var(--rf-space-6);
  font-size: 1rem;
  font-weight: 600;
}

.rf-btn-full {
  width: 100%;
}

/* ── FORM ELEMENTS ── */
.rf-form-group {
  margin-bottom: var(--rf-space-5);
}

.rf-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rf-gray-700);
  margin-bottom: var(--rf-space-2);
}

.rf-input {
  display: block;
  width: 100%;
  padding: var(--rf-space-3) var(--rf-space-4);
  font-size: 0.875rem;
  color: var(--rf-gray-900);
  background-color: white;
  border: 1px solid var(--rf-gray-300);
  border-radius: var(--rf-radius);
  transition: var(--rf-transition);
}

.rf-input:focus {
  outline: none;
  border-color: var(--rf-primary);
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.1);
}

.rf-input::placeholder {
  color: var(--rf-gray-400);
}

.rf-input-error {
  border-color: var(--rf-danger);
}

.rf-input-error:focus {
  border-color: var(--rf-danger);
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
}

.rf-select {
  display: block;
  width: 100%;
  padding: var(--rf-space-3) var(--rf-space-4);
  font-size: 0.875rem;
  color: var(--rf-gray-900);
  background-color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  border: 1px solid var(--rf-gray-300);
  border-radius: var(--rf-radius);
  padding-right: 2.5rem;
  transition: var(--rf-transition);
  appearance: none;
}

.rf-select:focus {
  outline: none;
  border-color: var(--rf-primary);
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.1);
}

.rf-textarea {
  display: block;
  width: 100%;
  padding: var(--rf-space-3) var(--rf-space-4);
  font-size: 0.875rem;
  color: var(--rf-gray-900);
  background-color: white;
  border: 1px solid var(--rf-gray-300);
  border-radius: var(--rf-radius);
  transition: var(--rf-transition);
  resize: vertical;
  min-height: 80px;
}

.rf-textarea:focus {
  outline: none;
  border-color: var(--rf-primary);
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.1);
}

.rf-help-text {
  margin-top: var(--rf-space-1);
  font-size: 0.75rem;
  color: var(--rf-gray-500);
}

.rf-error-text {
  margin-top: var(--rf-space-1);
  font-size: 0.75rem;
  color: var(--rf-danger);
}

/* ── CARDS ── */
.rf-card {
  background: #fff;
  border: 1px solid var(--rf-gray-200);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.rf-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--rf-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.rf-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--rf-gray-900);
  margin: 0;
  letter-spacing: -.01em;
}

.rf-card-subtitle {
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--rf-gray-500);
}

.rf-card-body { padding: 24px; }

.rf-card-footer {
  padding: 16px 24px;
  background: var(--rf-gray-50);
  border-top: 1px solid var(--rf-gray-200);
}

/* ── BADGES ── */
.rf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: .02em;
  border-radius: var(--rf-radius-full);
}

.rf-badge-primary { background: rgb(13 148 136 / 0.1);  color: var(--rf-primary-dark); }
.rf-badge-success { background: rgb(22 163 74  / 0.1);  color: #14532d; }
.rf-badge-warning { background: rgb(217 119 6  / 0.1);  color: #78350f; }
.rf-badge-danger  { background: rgb(220 38  38 / 0.08); color: #7f1d1d; }
.rf-badge-info    { background: rgb(2   132 199/ 0.1);  color: #075985; }
.rf-badge-gray    { background: var(--rf-gray-100);     color: var(--rf-gray-600); }

/* ── ALERTS ── */
.rf-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--rf-radius-md);
  border: 1px solid transparent;
  border-left-width: 3px;
  margin-bottom: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
  flex-wrap: wrap;
}

.rf-alert strong { display: block; margin-bottom: 2px; font-weight: 600; }

.rf-alert-success {
  background: rgb(22 163 74 / 0.06);
  border-color: rgb(22 163 74 / 0.2);
  border-left-color: var(--rf-success);
  color: #14532d;
}
.rf-alert-error {
  background: rgb(220 38 38 / 0.05);
  border-color: rgb(220 38 38 / 0.15);
  border-left-color: var(--rf-danger);
  color: #7f1d1d;
}
.rf-alert-info {
  background: var(--rf-primary-faint);
  border-color: rgb(13 148 136 / 0.2);
  border-left-color: var(--rf-primary);
  color: var(--rf-primary-dark);
}
.rf-alert-warning {
  background: rgb(217 119 6 / 0.06);
  border-color: rgb(217 119 6 / 0.2);
  border-left-color: var(--rf-warning);
  color: #78350f;
}

/* ── LOADING STATES ── */
.rf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--rf-space-3);
  padding: var(--rf-space-8);
  color: var(--rf-gray-500);
}

.rf-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--rf-space-4);
  padding: var(--rf-space-12);
  text-align: center;
  color: var(--rf-gray-500);
}

.rf-empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--rf-gray-900);
  margin: 0;
}

.rf-empty-state p {
  font-size: 0.875rem;
  margin: 0;
  max-width: 320px;
}

/* ── TABLES ── */
.rf-table-container {
  overflow-x: auto;
  border: 1px solid var(--rf-gray-200);
  border-radius: var(--rf-radius-lg);
}

.rf-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
}

.rf-table th {
  padding: var(--rf-space-4);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rf-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--rf-gray-50);
  border-bottom: 1px solid var(--rf-gray-200);
}

.rf-table td {
  padding: var(--rf-space-4);
  font-size: 0.875rem;
  color: var(--rf-gray-900);
  border-bottom: 1px solid var(--rf-gray-200);
  vertical-align: middle;
}

.rf-table tbody tr:last-child td {
  border-bottom: none;
}

.rf-table tbody tr:hover {
  background-color: var(--rf-gray-50);
}

/* ── SIDEBAR NAVIGATION ── */

/* Fixed dark left sidebar */
.rf-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--rf-sidebar-width);
  height: 100vh;
  background: var(--rf-sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 9990;
  overflow-y: auto;
  overflow-x: hidden;
}

/* WP admin bar pushes sidebar down */
.admin-bar .rf-sidebar {
  top: 32px;
  height: calc(100vh - 32px);
}

/* Pages that include the sidebar get left padding so content doesn't hide under it */
body.rf-has-sidebar {
  padding-left: var(--rf-sidebar-width);
}

/* Brand strip at top */
.rf-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  text-decoration: none;
}

.rf-nav-logo {
  width: 30px; height: 30px;
  background: var(--rf-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  letter-spacing: .5px;
}

.rf-nav-brand > span {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* Vertical nav links */
.rf-nav-links {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rf-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 6px;
  transition: var(--rf-transition);
  position: relative;
  white-space: nowrap;
}

.rf-nav-link svg { flex-shrink: 0; opacity: .65; transition: opacity .15s; }

.rf-nav-link:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.rf-nav-link:hover svg { opacity: 1; }

.rf-nav-link.active {
  background: rgba(13,148,136,.16);
  color: #2dd4bf;
}
.rf-nav-link.active svg { opacity: 1; }
.rf-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px;
  background: var(--rf-primary);
  border-radius: 0 2px 2px 0;
}

.rf-nav-link-urgent { color: #fbbf24; }
.rf-nav-link-urgent:hover { background: rgba(251,191,36,.1); color: #fbbf24; }

/* Badge on nav items */
.rf-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--rf-danger);
  color: #fff;
  border-radius: var(--rf-radius-full);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  margin-left: auto;
}
.rf-nav-badge-danger { background: var(--rf-danger); }

/* User row at bottom of sidebar */
.rf-nav-user {
  padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rf-nav-username {
  font-size: 12.5px;
  font-weight: 500;
  color: #cbd5e1;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.rf-avatar {
  width: 28px; height: 28px;
  background: var(--rf-primary);
  border-radius: var(--rf-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 10px;
  flex-shrink: 0;
  letter-spacing: .3px;
}

/* Mobile top bar (only visible ≤768px) */
.rf-topbar-mobile {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--rf-sidebar-bg);
  z-index: 9991;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

/* Admin bar on mobile */
.admin-bar .rf-topbar-mobile {
  top: 46px;
}

.rf-nav-toggle {
  background: none; border: none;
  cursor: pointer; color: #94a3b8;
  padding: 6px; display: flex;
  border-radius: 4px;
  transition: var(--rf-transition);
}
.rf-nav-toggle:hover { color: #e2e8f0; background: rgba(255,255,255,.07); }
.rf-nav-toggle:focus-visible { outline: 2px solid var(--rf-primary); outline-offset: 2px; }

/* Dark overlay when sidebar open on mobile */
.rf-sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 38;
  cursor: pointer;
}

/* ── RESPONSIVE SIDEBAR ── */
@media (max-width: 768px) {
  :root { --rf-sidebar-width: 0px; }

  body.rf-has-sidebar {
    padding-left: 0;
    padding-top: 52px;
  }

  /* Admin bar on mobile (46px tall at ≤782px) */
  .admin-bar.rf-has-sidebar,
  .admin-bar body.rf-has-sidebar {
    padding-top: 98px; /* 52px topbar + 46px admin bar */
  }
  .admin-bar .rf-sidebar {
    top: 46px;
    height: calc(100vh - 46px);
  }

  .rf-sidebar {
    width: 220px;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
  }
  .rf-sidebar.rf-sidebar-open { transform: translateX(0); }

  .rf-topbar-mobile { display: flex; }

  .rf-sidebar-overlay.rf-sidebar-open { display: block; }
}

/* Admin bar desktop (32px) */
@media (min-width: 769px) {
  .admin-bar .rf-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
  }
}

/* ── LAYOUT CONTAINERS ── */
.rf-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--rf-space-6);
}

.rf-main {
  padding: var(--rf-space-8) 0;
}

.rf-section {
  margin-bottom: var(--rf-space-12);
}

.rf-grid {
  display: grid;
  gap: var(--rf-space-6);
}

.rf-grid-2 { grid-template-columns: repeat(2, 1fr); }
.rf-grid-3 { grid-template-columns: repeat(3, 1fr); }
.rf-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .rf-grid-2,
  .rf-grid-3,
  .rf-grid-4 {
    grid-template-columns: 1fr;
  }
  
  /* Sidebar nav links are shown inside the drawer — only hide stray .rf-nav-links outside it */
  .rf-container {
    padding: 0 var(--rf-space-4);
  }
}

/* ── RESPONSIVE UTILITIES ── */
.rf-hidden { display: none; }
.rf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .rf-hidden-mobile { display: none; }
}

@media (min-width: 641px) {
  .rf-hidden-desktop { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES — styles injected via RF_Auth::output_auth_styles()
   (body.rf-auth-login / body.rf-auth-register)
═══════════════════════════════════════════════════════════════ */

/* Auth Page Layout — legacy container classes kept for back-compat */
.rf-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

.rf-auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
}

.rf-auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 48px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.35s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Header */
.rf-auth-card-header {
    text-align: center;
    margin-bottom: 40px;
}

.rf-auth-card-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.rf-auth-card-header p {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* Form Styles */
.rf-auth-form {
    margin-bottom: 32px;
}

.rf-auth-form .rf-form-group {
    margin-bottom: 24px;
}

.rf-auth-form .rf-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    letter-spacing: 0.025em;
}

.rf-auth-form .rf-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    font-family: inherit;
}

.rf-auth-form .rf-input:focus {
    outline: none;
    border-color: #2563eb;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.rf-auth-form .rf-input::placeholder {
    color: #9ca3af;
}

/* Grid Layout */
.rf-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Gender Radio Group */
.rf-gender-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.rf-gender-option:hover {
    background: rgba(37, 99, 235, 0.05);
}

.rf-gender-option input[type="radio"] {
    margin: 0;
    accent-color: #2563eb;
    width: 18px;
    height: 18px;
}

/* Password Requirements */
.rf-pw-requirements {
    background: rgba(249, 250, 251, 0.8);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(5px);
}

.rf-pw-req-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    letter-spacing: 0.025em;
}

.rf-pw-req-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.rf-pw-req-list li {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.rf-rule-icon {
    color: #d1d5db;
    font-weight: bold;
}

/* Terms and Checkbox */
.rf-terms-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    padding: 8px 0;
}

.rf-terms-row input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #2563eb;
    width: 18px;
    height: 18px;
}

.rf-terms-row a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.rf-terms-row a:hover {
    text-decoration: underline;
}

/* Login Meta Row */
.rf-login-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.rf-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.rf-checkbox-row input[type="checkbox"] {
    margin: 0;
    accent-color: #2563eb;
    width: 16px;
    height: 16px;
}

.rf-login-meta-row a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.rf-login-meta-row a:hover {
    text-decoration: underline;
}

/* Buttons — auth-page scoped so they don't override the global .rf-btn-primary */
.rf-auth-page .rf-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    letter-spacing: 0.025em;
}

.rf-auth-page .rf-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.rf-auth-page .rf-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

/* Auth-page secondary button — scoped so it doesn't bleed into dashboard */
.rf-auth-page .rf-btn-secondary,
.auth-card .secondary-btn {
    width: 100%;
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.025em;
}

.rf-auth-page .rf-btn-secondary:hover,
.auth-card .secondary-btn:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

/* Separator */
.rf-auth-sep {
    text-align: center;
    margin: 24px 0;
    position: relative;
    font-size: 14px;
    color: #6b7280;
}

.rf-auth-sep::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.rf-auth-sep span {
    background: rgba(255, 255, 255, 0.98);
    padding: 0 16px;
    position: relative;
}

/* Card Footer */
.rf-auth-card-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(243, 244, 246, 0.8);
}

.rf-auth-card-footer p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.5;
}

.rf-auth-card-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.rf-auth-card-footer a:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Sub Panels */
.rf-auth-sub-panel {
    margin-top: 24px;
    padding: 20px;
    background: rgba(249, 250, 251, 0.8);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.rf-auth-sub-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.rf-auth-sub-text {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Register page wider card */
.rf-auth-register .rf-auth-container {
    max-width: 580px;
}

.rf-auth-register .rf-auth-card {
    padding: 48px 56px;
}

/* Responsive Design — only old .rf-auth-card / .rf-auth-form classes; new pages use inline styles */
@media (max-width: 768px) {
    /* .rf-auth-page padding intentionally omitted — new auth pages handle their own padding inline */
    
    .rf-auth-card {
        padding: 40px 32px;
        margin: 0;
        border-radius: 20px;
    }
    
    .rf-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .rf-pw-req-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .rf-login-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .rf-auth-card-header h1 {
        font-size: 28px;
    }
    
    .rf-auth-card-header p {
        font-size: 15px;
    }
    
    .rf-auth-register .rf-auth-card {
        padding: 40px 32px;
    }
}

@media (max-width: 480px) {
    .rf-auth-page {
        padding: 100px 12px 20px;
    }
    
    .rf-auth-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .rf-auth-card-header h1 {
        font-size: 24px;
    }
    
    .rf-auth-form .rf-input {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .rf-auth-register .rf-auth-card {
        padding: 32px 24px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
═══════════════════════════════════════════════════════════════ */

.rf-dashboard {
  min-height: 100vh;
  background: var(--rf-gray-100);
}

/* Sidebar replaces the old header — these are kept as no-ops for any legacy markup */
.rf-dashboard-header { display: contents; }
.rf-dashboard-nav    { display: contents; }

.rf-dashboard-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 40px;
}

@media (max-width: 1024px) {
  .rf-dashboard-main { padding: 28px 24px; }
}
@media (max-width: 480px) {
  .rf-dashboard-main { padding: 20px 16px; }
  .rf-dashboard-title { font-size: 1.25rem; }
}

.rf-dashboard-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--rf-gray-900);
  letter-spacing: -.02em;
  margin-bottom: 4px;
}

.rf-dashboard-subtitle {
  font-size: 0.875rem;
  color: var(--rf-gray-500);
  margin-bottom: 28px;
}

/* Stat grid */
.rf-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* Stat card — Greenhouse style: clean white, top accent strip, minimal shadow */
.rf-stat-card {
  background: #fff;
  border: 1px solid var(--rf-gray-200);
  border-radius: var(--rf-radius-lg);
  padding: 20px 22px 18px;
  position: relative;
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.rf-stat-card:hover {
  box-shadow: var(--rf-shadow-md);
  transform: translateY(-1px);
}
/* Coloured top strip per card — applied via nth-child so no HTML changes needed */
.rf-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.rf-dashboard-stats .rf-stat-card:nth-child(1)::before { background: var(--rf-primary); }
.rf-dashboard-stats .rf-stat-card:nth-child(2)::before { background: var(--rf-warning); }
.rf-dashboard-stats .rf-stat-card:nth-child(3)::before { background: var(--rf-success); }
.rf-dashboard-stats .rf-stat-card:nth-child(4)::before { background: var(--rf-accent); }

.rf-stat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rf-stat-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--rf-gray-500);
  margin: 0;
  line-height: 1.4;
}

.rf-stat-icon {
  width: 34px; height: 34px;
  border-radius: var(--rf-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rf-stat-icon-primary { background: var(--rf-primary-faint); color: var(--rf-primary); }
.rf-stat-icon-success { background: rgb(22 163 74 / 0.08);   color: var(--rf-success); }
.rf-stat-icon-warning { background: rgb(217 119 6  / 0.1);   color: var(--rf-warning); }
.rf-stat-icon-danger  { background: rgb(220 38  38 / 0.08);  color: var(--rf-danger);  }
.rf-stat-icon-accent  { background: rgb(99  102 241/ 0.1);   color: var(--rf-accent);  }

.rf-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--rf-gray-900);
  letter-spacing: -.03em;
  line-height: 1;
  margin: 0;
}

.rf-stat-change {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 6px;
}
.rf-stat-change-positive { color: var(--rf-success); }
.rf-stat-change-negative { color: var(--rf-danger); }

/* ═══════════════════════════════════════════════════════════════
   EXAM INTERFACE
═══════════════════════════════════════════════════════════════ */

.rf-exam-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--rf-space-6);
}

.rf-exam-header {
  text-align: center;
  margin-bottom: var(--rf-space-8);
  padding: var(--rf-space-8);
  background: linear-gradient(135deg, var(--rf-primary), var(--rf-accent));
  border-radius: var(--rf-radius-xl);
  color: white;
}

.rf-exam-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--rf-space-2);
}

.rf-exam-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--rf-space-6);
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Violation Info Styles */
.rf-violation-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  color: #92400e;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease-out;
}

.rf-violation-info svg {
  flex-shrink: 0;
}

#rf-violations-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.9);
  border-radius: 6px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  animation: pulse 2s infinite;
}

#rf-violations-display svg {
  flex-shrink: 0;
}

/* Rule Dot Styles */
.rf-rule-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
  flex-shrink: 0;
}

.rf-rule-dot-info {
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.rf-rule-dot-warn {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.rf-rule-dot-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.rf-exam-progress {
  background-color: white;
  border-radius: var(--rf-radius-lg);
  padding: var(--rf-space-6);
  margin-bottom: var(--rf-space-6);
  box-shadow: var(--rf-shadow-sm);
}

.rf-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--rf-space-4);
}

.rf-progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--rf-gray-200);
  border-radius: var(--rf-radius-full);
  overflow: hidden;
}

.rf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rf-primary), var(--rf-accent));
  border-radius: var(--rf-radius-full);
  transition: width 0.3s ease;
}

.rf-question-card {
  background-color: white;
  border-radius: var(--rf-radius-lg);
  padding: var(--rf-space-8);
  margin-bottom: var(--rf-space-6);
  box-shadow: var(--rf-shadow-sm);
  border: 1px solid var(--rf-gray-200);
}

.rf-question-header {
  margin-bottom: var(--rf-space-6);
}

.rf-question-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rf-primary);
  margin-bottom: var(--rf-space-2);
}

.rf-question-text {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--rf-gray-900);
  line-height: 1.6;
  margin: 0;
}

.rf-question-options {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rf-question-option {
  margin-bottom: var(--rf-space-3);
}

.rf-question-option label {
  display: flex;
  align-items: flex-start;
  gap: var(--rf-space-3);
  padding: var(--rf-space-4);
  border: 2px solid var(--rf-gray-200);
  border-radius: var(--rf-radius);
  cursor: pointer;
  transition: var(--rf-transition);
}

.rf-question-option label:hover {
  border-color: var(--rf-primary);
  background-color: rgb(13 148 136 / 0.03);
}

.rf-question-option input[type="radio"] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--rf-primary);
}

.rf-question-option input[type="radio"]:checked + span {
  color: var(--rf-primary);
  font-weight: 500;
}

.rf-question-option input[type="radio"]:checked {
  border-color: var(--rf-primary);
}

.rf-exam-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rf-space-4);
  margin-top: var(--rf-space-8);
}

.rf-exam-timer {
  position: fixed;
  top: var(--rf-space-6);
  right: var(--rf-space-6);
  background-color: white;
  border: 1px solid var(--rf-gray-200);
  border-radius: var(--rf-radius-lg);
  padding: var(--rf-space-4);
  box-shadow: var(--rf-shadow-lg);
  z-index: 50;
}

.rf-timer-display {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rf-gray-900);
  text-align: center;
}

.rf-timer-label {
  font-size: 0.75rem;
  color: var(--rf-gray-500);
  text-align: center;
  margin-top: var(--rf-space-1);
}

/* ── Timer urgent state (≤5 minutes remaining) ─────────────────────────── */
@keyframes timerUrgentPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
}

.rf-timer-box.rf-timer-urgent {
  background-color: #fef2f2;
  border-color: #fca5a5 !important;
  animation: timerUrgentPulse 1.5s ease-in-out infinite;
}

.rf-timer-box.rf-timer-urgent #rf-timer {
  color: #dc2626;
}

.rf-timer-box.rf-timer-urgent .rf-timer-label {
  color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS PAGE
═══════════════════════════════════════════════════════════════ */

.rf-results-container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--rf-space-6);
  text-align: center;
}

.rf-results-header {
  margin-bottom: var(--rf-space-8);
}

.rf-results-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--rf-space-6);
  border-radius: var(--rf-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.rf-results-icon-pass {
  background: linear-gradient(135deg, var(--rf-success), var(--rf-success-light));
  color: white;
}

.rf-results-icon-fail {
  background: linear-gradient(135deg, var(--rf-danger), #f87171);
  color: white;
}

.rf-results-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--rf-space-4);
}

.rf-results-title-pass { color: var(--rf-success); }
.rf-results-title-fail { color: var(--rf-danger); }

.rf-results-subtitle {
  font-size: 1.125rem;
  color: var(--rf-gray-600);
  margin-bottom: var(--rf-space-8);
}

.rf-results-score {
  background-color: white;
  border: 1px solid var(--rf-gray-200);
  border-radius: var(--rf-radius-xl);
  padding: var(--rf-space-8);
  margin-bottom: var(--rf-space-8);
  box-shadow: var(--rf-shadow-sm);
}

.rf-score-display {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: var(--rf-space-2);
}

.rf-score-display-pass { color: var(--rf-success); }
.rf-score-display-fail { color: var(--rf-danger); }

.rf-score-label {
  font-size: 1rem;
  color: var(--rf-gray-600);
}

.rf-results-details {
  background-color: white;
  border: 1px solid var(--rf-gray-200);
  border-radius: var(--rf-radius-lg);
  padding: var(--rf-space-6);
  margin-bottom: var(--rf-space-8);
  text-align: left;
}

.rf-results-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--rf-space-4);
}

.rf-breakdown-item {
  text-align: center;
  padding: var(--rf-space-4);
  border-radius: var(--rf-radius);
  background-color: var(--rf-gray-50);
}

.rf-breakdown-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rf-gray-900);
  margin-bottom: var(--rf-space-1);
}

.rf-breakdown-label {
  font-size: 0.875rem;
  color: var(--rf-gray-600);
}

/* ═══════════════════════════════════════════════════════════════
   JOB LISTINGS — REDESIGNED
═══════════════════════════════════════════════════════════════ */

/* ── Page wrapper ── */
.rf-jobs-page { background: var(--rf-gray-50); }

/* ── Guest top bar (shown when not logged in) ── */
.rf-jl-guest-header {
  background: #fff;
  border-bottom: 1px solid var(--rf-gray-200);
  position: sticky;
  top: 0;
  z-index: 30;
}
.rf-jl-guest-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 52px;
  gap: 12px;
}
.rf-jl-guest-nav .rf-nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--rf-gray-900);
}
.rf-jl-guest-nav .rf-nav-logo {
  width: 30px; height: 30px;
  background: var(--rf-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.rf-jl-guest-actions { display: flex; align-items: center; gap: 8px; }

@media (max-width: 480px) {
  .rf-jl-guest-nav { padding: 0 12px; }
  .rf-jl-guest-nav .rf-nav-brand span { display: none; }
  .rf-jl-guest-actions .rf-btn-sm { padding: 5px 10px; font-size: 0.75rem; }
}

.rf-jl-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── Hero ── */
.rf-jl-hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  background: linear-gradient(160deg, #f0f5ff 0%, #fafafa 100%);
  border-bottom: 1px solid var(--rf-gray-200);
  margin-bottom: 2rem;
}

.rf-jl-hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--rf-gray-900);
  letter-spacing: -0.75px;
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.rf-jl-hero-sub {
  font-size: 1.0625rem;
  color: var(--rf-gray-500);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Filter bar ── */
.rf-jl-filters {
  background: white;
  border: 1px solid var(--rf-gray-200);
  border-radius: var(--rf-radius-lg);
  overflow: hidden;
  margin-bottom: 1.75rem;
  box-shadow: var(--rf-shadow-sm);
  display: flex;
  flex-direction: column;
}

/* Top row: search */
.rf-jl-search-row {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rf-gray-100);
}

.rf-jl-search-wrap {
  position: relative;
}

.rf-jl-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rf-gray-400);
  pointer-events: none;
}

.rf-jl-search-input {
  padding-left: 2.5rem !important;
  background: var(--rf-gray-50) !important;
  border-color: transparent !important;
  transition: border-color 0.15s, background 0.15s;
}

.rf-jl-search-input:focus {
  background: white !important;
  border-color: var(--rf-primary) !important;
}

/* Bottom row: selects + meta */
.rf-jl-filter-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1.25rem;
  flex-wrap: wrap;
}

.rf-jl-filter-select {
  width: auto !important;
  height: 2.125rem;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0.875rem !important;
  border-radius: var(--rf-radius-full) !important;
  background-color: var(--rf-gray-50) !important;
  border-color: var(--rf-gray-200) !important;
  cursor: pointer;
}

.rf-jl-filter-select:hover {
  background-color: white !important;
  border-color: var(--rf-gray-300) !important;
}

.rf-jl-filter-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--rf-gray-400);
  white-space: nowrap;
}

.rf-jl-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgb(13 148 136 / 0.08);
  color: var(--rf-primary);
  border-radius: var(--rf-radius-full);
  padding: 0.2rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ── Private exam code bar ── */
.rf-private-code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--rf-gray-200);
  border-left: 4px solid var(--rf-primary);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}
.rf-private-code-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.rf-private-code-bar--guest {
  border-left-color: var(--rf-gray-300);
  color: var(--rf-gray-500);
  font-size: .875rem;
}
.rf-private-code-label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--rf-gray-700);
  white-space: nowrap;
}
.rf-private-code-input {
  flex: 1;
  min-width: 180px;
  max-width: 260px;
  font-family: monospace;
  letter-spacing: .05em;
  text-transform: uppercase;
}
@media (max-width: 600px) {
  .rf-private-code-input { max-width: 100%; width: 100%; }
  .rf-private-code-bar { flex-direction: column; align-items: stretch; }
}

/* ── Card grid ── */
.rf-jobs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* ── Job card ── */
.rf-jl-card {
  background: white;
  border: 1px solid var(--rf-gray-200);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--rf-shadow-sm);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.rf-jl-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.09);
  border-color: var(--rf-primary);
}

.rf-jl-card-inner {
  padding: 1.375rem 1.375rem 1rem;
  flex: 1;
}

.rf-jl-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Company initial icon */
.rf-jl-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rf-primary), var(--rf-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(37,99,235,0.3);
}

/* Job type badge */
.rf-jl-type {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: var(--rf-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.rf-jl-type-full  { background: rgb(13 148 136 / 0.1);  color: #1d4ed8; }
.rf-jl-type-part  { background: rgb(124 58 237 / 0.1); color: #6d28d9; }
.rf-jl-type-contract { background: rgb(245 158 11 / 0.12); color: #92400e; }
.rf-jl-type-intern   { background: rgb(16 185 129 / 0.1); color: #065f46; }
.rf-jl-type-other    { background: var(--rf-gray-100); color: var(--rf-gray-600); }

.rf-jl-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--rf-gray-900);
  margin: 0 0 0.3rem;
  line-height: 1.3;
}

.rf-jl-card-company {
  font-size: 0.875rem;
  color: var(--rf-gray-500);
  margin: 0 0 0.875rem;
}

.rf-jl-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

.rf-jl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.625rem;
  background: var(--rf-gray-50);
  border: 1px solid var(--rf-gray-200);
  border-radius: var(--rf-radius-full);
  font-size: 0.75rem;
  color: var(--rf-gray-600);
  white-space: nowrap;
}

.rf-jl-card-excerpt {
  font-size: 0.875rem;
  color: var(--rf-gray-600);
  line-height: 1.55;
  margin: 0 0 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rf-jl-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.rf-jl-tag {
  padding: 0.2rem 0.625rem;
  background: rgb(13 148 136 / 0.07);
  color: var(--rf-primary-dark);
  border-radius: var(--rf-radius-full);
  font-size: 0.6875rem;
  font-weight: 500;
}

.rf-jl-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 1.375rem;
  border-top: 1px solid var(--rf-gray-100);
  background: var(--rf-gray-50);
}

.rf-jl-card-footer .rf-btn {
  flex-shrink: 0;
}

.rf-jl-card-footer .rf-btn-primary {
  flex: 1;
  justify-content: center;
}

/* Deadline warning chip */
.rf-jl-chip-warn {
  background: rgb(245 158 11 / 0.1);
  border-color: rgb(245 158 11 / 0.25);
  color: #92400e;
}

/* Salary chip */
.rf-jl-chip-salary {
  background: rgb(16 185 129 / 0.08);
  border-color: rgb(16 185 129 / 0.25);
  color: #065f46;
  font-weight: 600;
}

/* ── Modal overlay ── */
.rf-jl-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.rf-jl-overlay.rf-jl-open {
  opacity: 1;
  pointer-events: auto;
}

.rf-jl-modal {
  background: white;
  border-radius: 1.25rem;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), opacity 0.2s ease;
  opacity: 0;
  position: relative;
}

.rf-jl-overlay.rf-jl-open .rf-jl-modal {
  transform: none;
  opacity: 1;
}

/* Close button */
.rf-jl-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rf-gray-100);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rf-gray-600);
  transition: background 0.15s, color 0.15s;
  z-index: 2;
}
.rf-jl-modal-close:hover { background: var(--rf-gray-200); color: var(--rf-gray-900); }

/* Modal header */
.rf-jl-modal-hdr {
  padding: 1.75rem 1.75rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 1px solid var(--rf-gray-100);
  padding-right: 3.5rem; /* room for close btn */
}

.rf-jl-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--rf-primary), var(--rf-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}

.rf-jl-modal-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--rf-gray-900);
  margin: 0 0 0.25rem;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.rf-jl-modal-co {
  font-size: 0.9375rem;
  color: var(--rf-gray-500);
  margin: 0 0 0.625rem;
}

.rf-jl-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* Stats row */
.rf-jl-modal-stats {
  display: flex;
  gap: 1px;
  background: var(--rf-gray-100);
  border-bottom: 1px solid var(--rf-gray-100);
}

.rf-jl-stat {
  flex: 1;
  background: white;
  padding: 1rem;
  text-align: center;
}

.rf-jl-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rf-primary);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.rf-jl-stat-value.rf-stat-warn { color: var(--rf-warning); }

.rf-jl-stat-unit {
  font-size: 0.875rem;
  font-weight: 500;
  margin-left: 2px;
}

.rf-jl-stat-label {
  font-size: 0.75rem;
  color: var(--rf-gray-500);
  display: block;
}

/* Scrollable body */
.rf-jl-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.75rem;
  -webkit-overflow-scrolling: touch;
}

.rf-jl-modal-section { margin-bottom: 1.75rem; }
.rf-jl-modal-section:last-child { margin-bottom: 0; }

.rf-jl-modal-sec-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--rf-gray-800);
  margin: 0 0 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rf-jl-modal-sec-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rf-gray-100);
}

.rf-jl-modal-text {
  font-size: 0.9375rem;
  color: var(--rf-gray-700);
  line-height: 1.65;
}

.rf-jl-modal-reqs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}

.rf-jl-req-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--rf-gray-700);
  line-height: 1.5;
}

.rf-jl-req-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgb(16 185 129 / 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--rf-success);
}

.rf-jl-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rf-jl-modal-tag {
  padding: 0.3rem 0.875rem;
  background: rgb(13 148 136 / 0.07);
  color: var(--rf-primary-dark);
  border-radius: var(--rf-radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Modal footer */
.rf-jl-modal-ftr {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--rf-gray-100);
  background: var(--rf-gray-50);
  border-radius: 0 0 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.rf-jl-modal-ftr-note {
  font-size: 0.875rem;
  color: var(--rf-gray-500);
  flex: 1;
  min-width: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .rf-jl-hero-title { font-size: 1.875rem; }
  .rf-jobs-grid { grid-template-columns: 1fr; }
  .rf-jl-filter-row { flex-wrap: wrap; }
  .rf-jl-filter-select { flex: 1; min-width: 120px; }
  .rf-jl-filter-meta { width: 100%; margin-left: 0; justify-content: space-between; }

  .rf-jl-modal-hdr { flex-direction: column; padding-right: 1.75rem; }
  .rf-jl-modal-ftr { flex-direction: column; align-items: stretch; }
  .rf-jl-modal-ftr-note { text-align: center; }
  .rf-jl-stat-value { font-size: 1.25rem; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .rf-dashboard-nav {
    padding: 0 var(--rf-space-4);
  }
  
  .rf-dashboard-main {
    padding: var(--rf-space-6) var(--rf-space-4);
  }
  
  .rf-dashboard-title {
    font-size: 1.5rem;
  }
  
  .rf-exam-container {
    padding: var(--rf-space-4);
  }
  
  .rf-exam-header {
    padding: var(--rf-space-6);
  }
  
  .rf-exam-title {
    font-size: 1.5rem;
  }
  
  .rf-exam-meta {
    flex-direction: column;
    gap: var(--rf-space-2);
  }
  
  .rf-exam-timer {
    position: static;
    margin-bottom: var(--rf-space-4);
  }
  
  .rf-results-container {
    padding: var(--rf-space-4);
  }
  
  .rf-results-title {
    font-size: 2rem;
  }
  
  .rf-score-display {
    font-size: 3rem;
  }
  
  .rf-jobs-container {
    padding: var(--rf-space-4);
  }
  
  .rf-jobs-title {
    font-size: 2rem;
  }
  
  .rf-job-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .rf-job-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--rf-space-2);
  }
  
  .rf-job-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--rf-space-3);
  }
}
/* ═══════════════════════════════════════════════════════════════
   ENHANCED STATUS INDICATORS & ANIMATIONS
═══════════════════════════════════════════════════════════════ */

/* Pulsing animation for urgent actions */
@keyframes urgentPulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  50% { 
    transform: scale(1.02); 
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
  }
}

.rf-urgent-action {
  animation: urgentPulse 2s infinite;
}

/* Enhanced badge styles for better status visibility */
.rf-badge-info {
  background: rgb(6 182 212 / 0.1);
  color: #0e7490;
  font-weight: 500;
}

.rf-badge-warning {
  background: rgb(245 158 11 / 0.12);
  color: #92400e;
  font-weight: 500;
}

/* Status-specific enhancements */
.rf-status-pending-exam {
  position: relative;
  overflow: hidden;
}

.rf-status-pending-exam::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Enhanced alert styles */
.rf-alert-warning {
  border-left: 4px solid var(--rf-warning);
}

.rf-alert-warning .rf-alert-icon {
  font-size: 1.25rem;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
  60% { transform: translateY(-3px); }
}

/* Success state animations */
.rf-success-animation {
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Loading state for buttons */
.rf-btn-loading {
  position: relative;
  color: transparent !important;
}

.rf-btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Enhanced table row highlighting for pending exams */
.rf-table tbody tr[data-status="pending_exam"] {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-left: 4px solid var(--rf-warning);
}

.rf-table tbody tr[data-status="pending_exam"]:hover {
  background: linear-gradient(135deg, #fde68a, #fcd34d);
}

/* Status indicator dots */
.rf-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.rf-status-dot-pending { background-color: var(--rf-warning); animation: pulse 2s infinite; }
.rf-status-dot-success { background-color: var(--rf-success); }
.rf-status-dot-danger { background-color: var(--rf-danger); }
.rf-status-dot-info { background-color: var(--rf-info); }

/* Mobile-specific enhancements */
@media (max-width: 768px) {
  .rf-urgent-action {
    animation: none; /* Reduce animations on mobile for better performance */
  }
  
  .rf-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   FORM MESSAGES (used by public.js / dashboard.js)
═══════════════════════════════════════════════════════════════ */

.rf-form-msg,
.rf-form-message {
  margin-top: var(--rf-space-3);
  padding: var(--rf-space-3) var(--rf-space-4);
  border-radius: var(--rf-radius);
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 1.25rem;
}

.rf-msg-success,
.rf-form-msg.rf-msg-success,
.rf-form-message.rf-msg-success {
  background: rgb(16 185 129 / 0.1);
  color: #065f46;
  border: 1px solid rgb(16 185 129 / 0.25);
}

.rf-msg-error,
.rf-form-msg.rf-msg-error,
.rf-form-message.rf-msg-error {
  background: rgb(239 68 68 / 0.08);
  color: #991b1b;
  border: 1px solid rgb(239 68 68 / 0.2);
}

.rf-msg-loading,
.rf-form-msg.rf-msg-loading,
.rf-form-message.rf-msg-loading {
  background: rgb(13 148 136 / 0.07);
  color: var(--rf-primary-dark);
  border: 1px solid rgb(37 99 235 / 0.15);
}

/* ═══════════════════════════════════════════════════════════════
   PASSWORD STRENGTH METER
═══════════════════════════════════════════════════════════════ */

#rf-pw-strength-fill[data-strength="0"] { width: 0%;   background: transparent; }
#rf-pw-strength-fill[data-strength="1"] { width: 20%;  background: #ef4444; }
#rf-pw-strength-fill[data-strength="2"] { width: 40%;  background: #f97316; }
#rf-pw-strength-fill[data-strength="3"] { width: 60%;  background: #eab308; }
#rf-pw-strength-fill[data-strength="4"] { width: 80%;  background: #84cc16; }
#rf-pw-strength-fill[data-strength="5"] { width: 100%; background: #10b981; }

#rf-password-rules li { transition: color 0.2s; }
#rf-password-rules li .rf-rule-icon { transition: all 0.2s; }

.rf-rule-pass { color: var(--rf-success) !important; }
.rf-rule-pass .rf-rule-icon::before { content: '✓'; }

/* ═══════════════════════════════════════════════════════════════
/* ── MOBILE NAVIGATION — hamburger menu ── */

/* rf-nav-toggle is only used inside .rf-topbar-mobile (sidebar pages).
   It is shown/hidden via the .rf-topbar-mobile media query below. */

@media (max-width: 768px) {
  /* Sidebar .rf-nav-links must always flex — override is handled below */

  /* Legacy horizontal-nav open/close (not used by sidebar) */
  .rf-nav-links.rf-nav-open { display: flex; }

  .rf-nav-link {
    padding: var(--rf-space-3) var(--rf-space-4);
    border-radius: var(--rf-radius);
    width: 100%;
  }

  /* Sidebar nav links: always visible inside the sidebar drawer */
  .rf-sidebar .rf-nav-links {
    display: flex;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: var(--rf-space-2) var(--rf-space-2);
    flex-direction: column;
    gap: 2px;
    z-index: auto;
  }

  /* Sidebar user row: keep all text visible inside the drawer */
  .rf-sidebar .rf-nav-user span { display: block; }
  .rf-sidebar .rf-nav-username   { display: block; }
}

/* ═══════════════════════════════════════════════════════════════
   URGENT NAV LINK (pending exams badge)
═══════════════════════════════════════════════════════════════ */

.rf-nav-link-urgent {
  color: #92400e !important;
  background: rgb(245 158 11 / 0.1) !important;
}
.rf-nav-link-urgent:hover {
  background: rgb(245 158 11 / 0.2) !important;
}

/* ═══════════════════════════════════════════════════════════════
   JOB LISTING — responsive fixes
═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .rf-jobs-title { font-size: 1.75rem; }
  .rf-jobs-subtitle { font-size: 1rem; }

  .rf-job-meta {
    flex-wrap: wrap;
    gap: var(--rf-space-2);
  }

  .rf-job-footer {
    flex-direction: column;
    gap: var(--rf-space-2);
  }

  .rf-job-footer .rf-btn {
    width: 100%;
    justify-content: center;
  }

  /* Modal full-screen on mobile */
  #job-modal > div {
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — responsive table
═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .rf-dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--rf-space-3);
  }

  .rf-stat-value { font-size: 1.5rem; }

  /* Scrollable table on mobile */
  .rf-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .rf-table th,
  .rf-table td {
    white-space: nowrap;
    padding: var(--rf-space-3);
    font-size: 0.8125rem;
  }

  .rf-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--rf-space-3);
  }

  .rf-card-header > div {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .rf-dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }

  .rf-dashboard-title { font-size: 1.25rem; }
  .rf-dashboard-subtitle { font-size: 0.875rem; margin-bottom: var(--rf-space-5); }
}

/* ═══════════════════════════════════════════════════════════════
   EXAM PAGE — responsive fixes
═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  #rf-pre-flight { padding: 0.75rem; margin: 0.75rem auto; }
  .rf-preflight-hero { padding: 1.5rem 1rem; }
  .rf-preflight-hero h1 { font-size: 1.25rem; }
  .rf-preflight-meta { gap: 0.5rem; }
  .rf-preflight-meta span { font-size: 0.75rem; padding: 0.25rem 0.625rem; }
  .rf-preflight-body { padding: 1.25rem; }
  .rf-preflight-footer { flex-direction: column; align-items: stretch; }
  .rf-preflight-footer a { text-align: center; }
  #rf-start-exam-btn { width: 100%; justify-content: center; }

  #rf-question-container { padding: 0.75rem; }
  .rf-q-card { padding: 1.25rem; }
  .rf-q-text { font-size: 1rem; }
  .rf-option-label { padding: 0.75rem; font-size: 0.875rem; }

  .rf-nav-row { flex-wrap: wrap; gap: 0.5rem; }
  #rf-prev-btn, #rf-next-btn, #rf-submit-btn {
    flex: 1;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  /* Timer stays visible but smaller */
  .rf-timer-box { min-width: 64px; padding: 0.375rem 0.75rem; }
  #rf-timer { font-size: 1.125rem; }

  #rf-exam-header { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  #rf-exam-header .rf-exam-header-left span { max-width: 140px; font-size: 0.8rem; }
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES — responsive
═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .rf-auth-card { padding: 1.75rem 1.25rem; }
  .rf-auth-card-hd h1, .rf-auth-card-hd h2 { font-size: 1.4rem; }
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS PAGE — responsive
═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .rf-dashboard-main { padding: var(--rf-space-4) var(--rf-space-3); }

  .rf-card-body { padding: var(--rf-space-4); }
  .rf-card-header { padding: var(--rf-space-4); }
}

/* ═══════════════════════════════════════════════════════════════
   BADGE — missing variants
═══════════════════════════════════════════════════════════════ */

.rf-badge-applied       { background: rgb(13 148 136 / 0.1);  color: #1e40af; }
.rf-badge-exam_started  { background: rgb(245 158 11 / 0.12); color: #92400e; }
.rf-badge-submitted     { background: rgb(124 58 237 / 0.1);  color: #5b21b6; }
.rf-badge-passed        { background: rgb(16 185 129 / 0.1);  color: #065f46; }
.rf-badge-failed        { background: rgb(239 68 68 / 0.1);   color: #991b1b; }
.rf-badge-shortlisted   { background: rgb(16 185 129 / 0.15); color: #065f46; font-weight: 700; }
.rf-badge-withdrawn     { background: var(--rf-gray-100);     color: var(--rf-gray-600); }
.rf-badge-active        { background: rgb(16 185 129 / 0.1);  color: #065f46; }

/* ═══════════════════════════════════════════════════════════════
   RESULT OUTCOME (dashboard results list)
═══════════════════════════════════════════════════════════════ */

.rf-result-outcome {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* ═══════════════════════════════════════════════════════════════
   TABLE WRAP (dashboard.js renders this)
═══════════════════════════════════════════════════════════════ */

.rf-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--rf-radius-lg);
  border: 1px solid var(--rf-gray-200);
}

.rf-td-actions {
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   CARD HEADER flex layout fix
═══════════════════════════════════════════════════════════════ */

.rf-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--rf-space-3);
}

/* ═══════════════════════════════════════════════════════════════
   UI POLISH — Additional Component Styles
═══════════════════════════════════════════════════════════════ */

/* Fix: alert-success was near-invisible (rf-gray-50 background) */
.rf-alert-success {
  background-color: rgb(16 185 129 / 0.08);
  border: 1px solid rgb(16 185 129 / 0.25);
  color: #065f46;
}

/* Warning button variant (used for Resume Exam action) */
.rf-btn-warning {
  background-color: var(--rf-warning);
  color: white;
  box-shadow: var(--rf-shadow-sm);
}
.rf-btn-warning:hover:not(:disabled) {
  background-color: #d97706;
  box-shadow: var(--rf-shadow);
}

/* Password input wrapper — replaces inline position:relative */
.rf-input-pw-wrap {
  position: relative;
}

/* Password visibility toggle button */
.rf-pw-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--rf-gray-400);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.15s;
}
.rf-pw-toggle:hover {
  color: var(--rf-gray-600);
}
.rf-pw-toggle:focus {
  outline: 2px solid var(--rf-primary);
  outline-offset: 2px;
  border-radius: var(--rf-radius-sm);
}

/* Gender / radio pill option cards */
.rf-gender-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--rf-space-3);
  border: 1.5px solid var(--rf-gray-300);
  border-radius: var(--rf-radius);
  cursor: pointer;
  transition: var(--rf-transition);
  font-size: 0.875rem;
  color: var(--rf-gray-700);
}
.rf-gender-option:hover {
  border-color: var(--rf-primary);
  background-color: rgb(37 99 235 / 0.04);
}
.rf-gender-option:has(input:checked) {
  border-color: var(--rf-primary);
  background-color: rgb(13 148 136 / 0.08);
  color: var(--rf-primary-dark);
  font-weight: 500;
}

/* Checkbox form row — replaces inline flex styles */
.rf-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--rf-gray-600);
  cursor: pointer;
  user-select: none;
}
.rf-checkbox-row input[type="checkbox"] {
  accent-color: var(--rf-primary);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* Forgot password inline panel */
.rf-forgot-panel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rf-gray-200);
}
.rf-forgot-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--rf-gray-900);
  margin-bottom: 0.5rem;
}
.rf-forgot-text {
  font-size: 0.875rem;
  color: var(--rf-gray-600);
  margin-bottom: 1rem;
}

/* Register page — wider card for 2-column grids */
.rf-auth-register .rf-auth-card {
  max-width: 560px;
  overflow-y: auto;
}

/* Job listing — nav bar row */
.rf-jobs-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--rf-space-8);
  flex-wrap: wrap;
  gap: var(--rf-space-3);
}
.rf-jobs-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--rf-space-3);
  flex-wrap: wrap;
}

/* Stat card — hover lift effect */
.rf-stat-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.rf-stat-card:hover {
  box-shadow: var(--rf-shadow-md);
  transform: translateY(-2px);
}

/* Accent stat icon (purple) — for Best Score */
.rf-stat-icon-accent {
  background-color: rgb(124 58 237 / 0.1);
  color: var(--rf-accent);
}

/* Job cards — subtle lift on hover */
.rf-job-card {
  transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.15s ease;
}
.rf-job-card:hover {
  transform: translateY(-2px);
}

/* Job meta — icon + text inline alignment */
.rf-job-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* Profile field label */
.rf-field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rf-gray-500);
  margin-bottom: var(--rf-space-1);
}

/* Table rows with urgent actions get a subtle warm tint */
.rf-table tbody tr:has(.rf-urgent-action) {
  background-color: rgb(245 158 11 / 0.03);
}

/* Results filter buttons: active state via class */
.rf-filter-btn-active {
  background-color: var(--rf-primary) !important;
  color: white !important;
  border-color: var(--rf-primary) !important;
}

/* Improve Terms/Privacy checkbox row in register */
.rf-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--rf-gray-600);
  cursor: pointer;
}
.rf-terms-row input[type="checkbox"] {
  accent-color: var(--rf-primary);
  margin-top: 0.125rem;
  flex-shrink: 0;
  cursor: pointer;
}
.rf-terms-row a {
  color: var(--rf-primary);
  text-decoration: none;
}
.rf-terms-row a:hover {
  text-decoration: underline;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .rf-jobs-nav-bar {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: var(--rf-space-5);
  }
  .rf-jobs-nav-actions {
    width: 100%;
  }
  .rf-jobs-nav-actions .rf-btn {
    flex: 1;
    justify-content: center;
  }
  .rf-auth-register .rf-auth-card {
    max-width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════
   CANDIDATE MESSAGING
═══════════════════════════════════════════════════════════════ */

/* Nav badge */
.rf-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--rf-danger);
    color: #fff;
    border-radius: var(--rf-radius-full);
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
}

/* Two-column layout */
.rf-messages-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    min-height: 460px;
    overflow: hidden;
    border-radius: 0 0 var(--rf-radius-lg) var(--rf-radius-lg);
}

/* Thread list */
.rf-msg-threads {
    border-right: 1px solid var(--rf-gray-200);
    overflow-y: auto;
    max-height: 520px;
    background: var(--rf-gray-50);
}

.rf-msg-thread-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 13px 16px;
    border: none;
    border-bottom: 1px solid var(--rf-gray-100);
    background: transparent;
    cursor: pointer;
    transition: var(--rf-transition);
    font-family: var(--rf-font);
    position: relative;
}
.rf-msg-thread-item:hover { background: #f0f4ff; }
.rf-msg-thread-item.rf-msg-thread-active {
    background: #eff6ff;
    border-left: 3px solid var(--rf-primary);
    padding-left: 13px;
}
.rf-msg-thread-item.rf-msg-thread-unread .rf-msg-thread-job { font-weight: 700; color: var(--rf-gray-900); }
.rf-msg-thread-item.rf-msg-thread-unread::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--rf-primary);
    border-radius: 50%;
}
.rf-msg-thread-item.rf-msg-thread-active::before { display: none; }

.rf-msg-thread-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 3px;
}
.rf-msg-thread-job {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rf-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rf-msg-thread-preview {
    font-size: 0.75rem;
    color: var(--rf-gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.rf-msg-thread-time { font-size: 0.7rem; color: var(--rf-gray-500); }

.rf-msg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 20px;
    color: var(--rf-gray-400);
    text-align: center;
    font-size: 0.8125rem;
}
.rf-msg-empty svg { opacity: 0.35; }

/* Thread view */
.rf-msg-view {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.rf-msg-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex: 1;
    min-height: 320px;
    color: var(--rf-gray-400);
    font-size: 0.875rem;
    text-align: center;
    padding: 48px;
}
.rf-msg-placeholder svg { opacity: 0.3; }

#rf-msg-thread-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Bubbles */
.rf-msg-messages {
    flex: 1;
    overflow-y: auto;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 360px;
    min-height: 200px;
}

.rf-msg-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 72%;
}
.rf-msg-mine   { align-self: flex-end;   align-items: flex-end; }
.rf-msg-theirs { align-self: flex-start; align-items: flex-start; }

.rf-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.65;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.rf-msg-mine .rf-msg-bubble {
    background: var(--rf-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.rf-msg-theirs .rf-msg-bubble {
    background: var(--rf-gray-100);
    color: var(--rf-gray-900);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--rf-gray-200);
}

.rf-msg-meta {
    font-size: 0.7rem;
    color: var(--rf-gray-400);
    margin-top: 4px;
    padding: 0 4px;
}

.rf-msg-no-msgs {
    text-align: center;
    color: var(--rf-gray-400);
    font-size: 0.875rem;
    padding: 48px 0;
}

/* Compose */
.rf-msg-compose {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 14px 16px;
    border-top: 1px solid var(--rf-gray-200);
    background: var(--rf-gray-50);
    flex-shrink: 0;
}
.rf-msg-input {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: var(--rf-radius) !important;
    border: 1.5px solid var(--rf-gray-200) !important;
    padding: 10px 13px !important;
    background: #fff !important;
    transition: border-color .15s, box-shadow .15s !important;
}
.rf-msg-input:focus {
    border-color: var(--rf-primary) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
    outline: none !important;
}
.rf-msg-compose .rf-btn {
    flex-shrink: 0;
    align-self: flex-end;
    gap: 6px;
    padding: 10px 16px;
}

/* Responsive */
@media (max-width: 640px) {
    .rf-messages-layout { grid-template-columns: 1fr; }
    .rf-msg-threads {
        border-right: none;
        border-bottom: 1px solid var(--rf-gray-200);
        max-height: 180px;
    }
}

/* ── Messages dedicated page ── */
.rf-messages-page-card {
    padding: 0 !important;
    overflow: hidden;
}
.rf-messages-page-layout {
    min-height: 560px;
    border-radius: var(--rf-radius-lg);
}
.rf-msg-thread-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--rf-gray-200);
    background: var(--rf-gray-50);
    flex-shrink: 0;
}
.rf-msg-thread-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rf-primary), var(--rf-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.rf-msg-thread-header-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--rf-gray-900);
}
.rf-msg-thread-header-sub {
    font-size: 0.75rem;
    color: var(--rf-gray-500);
    margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════════
   MESSAGES PAGE — Polished Chat UI
═══════════════════════════════════════════════════════════════ */

.rf-messages-page .rf-dashboard-main { padding-bottom: 0; }

/* Page header row */
.rf-messages-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: var(--rf-space-6);
    flex-wrap: wrap;
}
.rf-messages-unread-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: var(--rf-radius-full);
    font-size: 0.8125rem;
    font-weight: 700;
}

/* Empty state card */
.rf-messages-empty-card { padding: 0 !important; }
.rf-messages-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 40px;
    text-align: center;
}
.rf-messages-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--rf-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rf-gray-400);
}
.rf-messages-empty-state h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--rf-gray-800);
    margin: 0;
}
.rf-messages-empty-state p {
    color: var(--rf-gray-500);
    font-size: 0.9375rem;
    margin: 0;
    max-width: 340px;
}

/* ── Chat shell ── */
.rf-chat-shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    background: #fff;
    border: 1px solid var(--rf-gray-200);
    border-radius: var(--rf-radius-xl);
    overflow: hidden;
    box-shadow: var(--rf-shadow-lg);
    height: calc(100vh - 220px);
    min-height: 500px;
    max-height: 780px;
}

/* ── Sidebar ── */
.rf-chat-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--rf-gray-200);
    background: var(--rf-gray-50);
    overflow: hidden;
}
.rf-chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--rf-gray-200);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rf-gray-500);
    text-transform: uppercase;
    letter-spacing: .07em;
    flex-shrink: 0;
}
.rf-chat-count {
    background: var(--rf-gray-200);
    color: var(--rf-gray-600);
    border-radius: var(--rf-radius-full);
    padding: 1px 8px;
    font-size: 0.7rem;
    font-weight: 700;
}
.rf-chat-threads {
    overflow-y: auto;
    flex: 1;
}

/* Thread item */
.rf-chat-thread {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--rf-gray-100);
    text-decoration: none !important;
    transition: background .12s;
    position: relative;
    cursor: pointer;
}
.rf-chat-thread:hover { background: #f0f4ff; }
.rf-chat-thread--active {
    background: #eff6ff !important;
    border-left: 3px solid var(--rf-primary);
    padding-left: 13px;
}
.rf-chat-thread-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rf-primary), var(--rf-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.rf-chat-thread--active .rf-chat-thread-avatar {
    box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}
.rf-chat-thread-body { flex: 1; min-width: 0; }
.rf-chat-thread-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 3px;
}
.rf-chat-thread-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rf-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rf-chat-thread--unread .rf-chat-thread-name { color: var(--rf-gray-900); font-weight: 700; }
.rf-chat-thread-time { font-size: 0.7rem; color: var(--rf-gray-400); flex-shrink: 0; }
.rf-chat-thread-preview {
    font-size: 0.8125rem;
    color: var(--rf-gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rf-chat-thread--unread .rf-chat-thread-preview { color: var(--rf-gray-600); }
.rf-chat-unread-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--rf-primary);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px #fff;
}

/* ── Main conversation area ── */
.rf-chat-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

/* Conversation header */
.rf-chat-conv-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--rf-gray-100);
    background: #fff;
    flex-shrink: 0;
    box-shadow: 0 1px 0 var(--rf-gray-100);
}
.rf-chat-conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rf-primary), var(--rf-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.rf-chat-conv-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--rf-gray-900);
}
.rf-chat-conv-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--rf-gray-500);
    margin-top: 1px;
}
.rf-chat-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rf-success);
    flex-shrink: 0;
}

/* Messages scroll area */
.rf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f9fafb;
    scroll-behavior: smooth;
}

/* Date divider */
.rf-chat-date-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 8px;
    color: var(--rf-gray-400);
    font-size: 0.75rem;
    font-weight: 600;
}
.rf-chat-date-divider::before,
.rf-chat-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--rf-gray-200);
}

/* Message row */
.rf-chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}
.rf-chat-msg--mine  { flex-direction: row-reverse; }
.rf-chat-msg--theirs { flex-direction: row; }

.rf-chat-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64748b, #475569);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-bottom: 18px;
}

.rf-chat-msg-content {
    display: flex;
    flex-direction: column;
    max-width: 68%;
}
.rf-chat-msg--mine .rf-chat-msg-content  { align-items: flex-end; }
.rf-chat-msg--theirs .rf-chat-msg-content { align-items: flex-start; }

.rf-chat-bubble {
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 0.9375rem;
    line-height: 1.6;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.rf-chat-msg--mine .rf-chat-bubble {
    background: linear-gradient(135deg, var(--rf-primary), var(--rf-accent-light));
    color: #fff;
    border-bottom-right-radius: 4px;
}
.rf-chat-msg--theirs .rf-chat-bubble {
    background: #fff;
    color: var(--rf-gray-900);
    border: 1px solid var(--rf-gray-200);
    border-bottom-left-radius: 4px;
}

.rf-chat-msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--rf-gray-400);
    margin-top: 4px;
    padding: 0 4px;
}
.rf-chat-read-tick { color: var(--rf-primary); font-size: 0.75rem; }

.rf-chat-no-msgs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
    min-height: 200px;
    color: var(--rf-gray-400);
    font-size: 0.9375rem;
    text-align: center;
    padding: 40px;
}
.rf-chat-no-msgs svg { opacity: .3; }

/* Select prompt */
.rf-chat-select-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex: 1;
    color: var(--rf-gray-400);
    font-size: 0.9375rem;
    text-align: center;
    padding: 60px;
}
.rf-chat-select-prompt svg { opacity: .2; }

/* Compose */
.rf-chat-compose {
    padding: 14px 18px 10px;
    border-top: 1px solid var(--rf-gray-200);
    background: #fff;
    flex-shrink: 0;
}
.rf-chat-compose-inner {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--rf-gray-50);
    border: 1.5px solid var(--rf-gray-200);
    border-radius: 14px;
    padding: 10px 10px 10px 16px;
    transition: border-color .15s, box-shadow .15s;
}
.rf-chat-compose-inner:focus-within {
    border-color: var(--rf-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    background: #fff;
}
.rf-chat-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    resize: none;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--rf-gray-900);
    font-family: var(--rf-font);
    min-height: 24px;
    max-height: 120px;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}
.rf-chat-input::placeholder { color: var(--rf-gray-400); }
.rf-chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--rf-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s, transform .15s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.rf-chat-send-btn:hover { background: var(--rf-primary-dark); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(37,99,235,.4); }
.rf-chat-send-btn:active { transform: scale(.95); }
.rf-chat-send-btn--loading { opacity: .6; cursor: not-allowed; }
.rf-chat-compose-hint {
    font-size: 0.7rem;
    color: var(--rf-gray-400);
    margin: 6px 0 0 4px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .rf-chat-shell {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }
    .rf-chat-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--rf-gray-200);
        max-height: 220px;
    }
    .rf-chat-messages { max-height: 360px; }
    .rf-messages-main-area { padding-bottom: var(--rf-space-6); }
}

/* ═══════════════════════════════════════════════════════════════
   iOS / IPHONE FIXES
   ─ Prevent automatic zoom when an input is focused (iOS Safari
     zooms in whenever a focused field has font-size < 16px).
   ─ Fix date inputs overflowing / stretching their container.
═══════════════════════════════════════════════════════════════ */

/*
 * @supports (-webkit-touch-callout: none) matches iOS Safari only.
 * We raise font-size to exactly 16px — the threshold below which
 * iOS auto-zooms — while keeping all other styles intact.
 */
@supports (-webkit-touch-callout: none) {

  /* Prevent zoom on focus */
  .rf-input,
  .rf-select,
  .rf-textarea,
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Date inputs: iOS renders type="date" as a native spinner that
     can overflow its parent. Reset appearance and constrain width. */
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    /* Prevent the native iOS date button from adding extra right padding
       and breaking the layout */
    background-clip: padding-box;
  }

  /* Ensure grid cells containing date inputs don't blow out */
  .rf-grid > .rf-form-group,
  .rf-grid-2 > .rf-form-group {
    min-width: 0;
    overflow: hidden;
  }

  /* Auth card on iPhone: let it sit flush to the viewport edges */
  .rf-auth-card {
    border-radius: 1rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   SMOOTH SCROLLING
═══════════════════════════════════════════════════════════════ */

html {
  scroll-behavior: smooth;
}

/* ═══════════════════════════════════════════════════════════════
   ALERT ICON — SVG sizing & per-variant color
═══════════════════════════════════════════════════════════════ */

.rf-alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  font-size: inherit; /* reset the 1.25rem rule set for emoji */
}

.rf-alert-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rf-alert-info    .rf-alert-icon { color: #1e40af; }
.rf-alert-warning .rf-alert-icon { color: #92400e; }
.rf-alert-error   .rf-alert-icon { color: #991b1b; }
.rf-alert-success .rf-alert-icon { color: #065f46; }

/* ═══════════════════════════════════════════════════════════════
   ALERT — consistent left-border accent across all variants
═══════════════════════════════════════════════════════════════ */

.rf-alert-info    { border-left: 4px solid var(--rf-primary); }
.rf-alert-success { border-left: 4px solid var(--rf-success); }
.rf-alert-error   { border-left: 4px solid var(--rf-danger); }
/* warning already has border-left from its earlier rule */

/* ═══════════════════════════════════════════════════════════════
   FOCUS-VISIBLE — consistent keyboard focus ring
═══════════════════════════════════════════════════════════════ */

.rf-nav-toggle:focus-visible {
  outline: 2px solid var(--rf-primary);
  outline-offset: 2px;
  border-radius: var(--rf-radius);
}

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION — respect user's OS preference
   Disables / shortens decorative animations without affecting
   opacity transitions needed for visibility changes.
═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Keep the card visible (no slide-in) */
  .rf-auth-card { animation: none; opacity: 1; transform: none; }

  /* Keep animated elements static */
  .rf-animate-in,
  .rf-animate-slide,
  .rf-urgent-action,
  .rf-status-dot-pending,
  .rf-rule-dot-danger,
  #rf-violations-display { animation: none; }
}
