/* ==========================================
   GLOBAL & RESET
   ========================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #f8f9fa;
  color: #111827;
  line-height: 1.5;
  /* Prevent horizontal scrolling on mobile */
  overflow-x: hidden; 
  width: 100%;
}

a { color: #6d28d9; text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

main { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 1.5rem 1rem; 
  width: 100%;
}

/* ==========================================
   HEADER / NAVBAR
   ========================================== */
.nav {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.nav .logo { font-weight: 800; font-size: 1.25rem; color: #111827; display: flex; align-items: center; gap: 8px;}
.nav .logo span { color: #6d28d9; }

.nav nav {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 1rem;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  background: linear-gradient(90deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff; border: 0; padding: 0.8rem 1.4rem;
  border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 1rem;
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn.block { width: 100%; display: flex; margin-top: 1.2rem; padding: 1rem; font-size: 1.05rem;}
.btn.small { padding: 0.5rem 1rem; font-size: 0.85rem; border-radius: 8px; }
.btn.danger { background: #ef4444; }
.btn.disabled { background: #9ca3af; cursor: not-allowed; }

/* ==========================================
   CARDS & GRIDS
   ========================================== */
.card {
  background: #fff; border-radius: 20px; padding: 1.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  margin-bottom: 1.5rem;
  width: 100%;
}
.card.narrow { max-width: 450px; margin: 3rem auto; }

/* Grid Fix for Mobile */
.grid-2 { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 1.5rem; 
  width: 100%;
}

/* ==========================================
   FORMS
   ========================================== */
label { display: block; margin: 1rem 0 0.4rem; font-weight: 600; font-size: 0.9rem; color: #374151;}
input, select, textarea {
  width: 100%; padding: 0.85rem 1rem; border: 1.5px solid #e5e7eb;
  border-radius: 12px; font-family: inherit; font-size: 1rem;
  background: #f9fafb; transition: border 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #7c3aed; background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.pw-wrap { position: relative; width: 100%; }
.pw-wrap .eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #6b7280;
}

/* ==========================================
   JOBS PAGE
   ========================================== */
.hero { text-align: center; padding: 2.5rem 1rem; }
.hero h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.hero h1 span { color: #6d28d9; }
.hero p { color: #6b7280; margin-top: 0.8rem; font-size: 1.1rem; }

.job-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
  gap: 1.5rem; 
  width: 100%;
}

.job-card {
  background: #fff; border-radius: 20px; overflow: hidden;
  border: 1px solid #e5e7eb; box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  display: flex; flex-direction: column;
}
.job-body { padding: 1.2rem; flex-grow: 1; display: flex; flex-direction: column; }
.job-body h3 { font-size: 1.1rem; margin-bottom: 0.3rem; font-weight: 700; word-break: break-word; }
.job-body p { font-size: 0.95rem; color: #4b5563; margin-bottom: 1rem; word-break: break-word;}

.badge {
  display: inline-block; padding: 0.3rem 0.7rem; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 0.5rem; width: fit-content;
}
.tier-1 { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.tier-2 { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
.tier-3 { background: #f3e8ff; color: #7e22ce; border: 1px solid #d8b4fe; }

/* ==========================================
   TIER CARDS (Equal Heights)
   ========================================== */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: stretch;
}

.tier-card {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  background: #fff;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  position: relative;
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tier-features {
  list-style: none;
  text-align: left;
  padding: 0;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.tier-features li {
  padding: 0.6rem 0;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
  font-size: 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.tier-btn-container {
  margin-top: auto;
  width: 100%;
}

/* ==========================================
   TABLES (Fixed Mobile Scrolling)
   ========================================== */
.card.table-wrapper {
  padding: 0;
  overflow-x: auto; /* Enables horizontal scrolling on mobile */
  -webkit-overflow-scrolling: touch;
}

.table { 
  width: 100%; 
  border-collapse: collapse; 
  min-width: 600px; /* Forces table to not squash on small screens */
}

.table th, .table td { 
  padding: 1rem; 
  text-align: left; 
  border-bottom: 1px solid #e5e7eb; 
  font-size: 0.9rem;
  white-space: nowrap;
}
.table th { background: #f9fafb; font-weight: 600; color: #374151; }
.table tr:last-child td { border-bottom: none; }

/* ==========================================
   UTILS & BADGES
   ========================================== */
.muted { color: #6b7280; }
.small { font-size: 0.85rem; }
.mono { font-family: monospace; font-size: 0.85rem; }
.status-success { color: #10b981; font-weight: 600; }
.status-pending { color: #f59e0b; font-weight: 600; }
.status-failed { color: #ef4444; font-weight: 600; }

/* ==========================================
   FLASH MESSAGES
   ========================================== */
.flash { padding: 1rem; text-align: center; font-weight: 600; font-size: 0.9rem; }
.flash.success { background: #ecfdf5; color: #065f46; border-bottom: 1px solid #a7f3d0; }
.flash.error { background: #fef2f2; color: #991b1b; border-bottom: 1px solid #fecaca; }

/* ==========================================
   PROFILE DROPDOWN (PAYSTACK STYLE)
   ========================================== */
.dropdown-container { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute !important;
  top: 120% !important;
  right: 0 !important;
  width: 220px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  z-index: 9999 !important;
  overflow: hidden;
  margin-top: 0.5rem;
}
.dropdown-header { padding: 1rem; border-bottom: 1px solid #f3f4f6; }
.dropdown-header p { margin: 0; }
.dropdown-header .label { font-size: 0.75rem; color: #6b7280; font-weight: 500; }
.dropdown-header .email { font-weight: 600; font-size: 0.85rem; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dropdown-link {
  display: flex; align-items: center; gap: 12px;
  padding: 0.7rem 1rem; color: #374151; font-size: 0.9rem;
  font-weight: 500; text-decoration: none; transition: background 0.15s;
}
.dropdown-link:hover { background: #f9fafb; color: #111827; text-decoration: none; }
.dropdown-icon { width: 18px; height: 18px; color: #6b7280; transition: color 0.15s; }
.dropdown-link:hover .dropdown-icon { color: #6d28d9; }
.dropdown-divider { height: 1px; background: #f3f4f6; margin: 0.5rem 0; }

/* ==========================================
   SPINNER & MODAL
   ========================================== */
.spinner { animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.modal { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.6); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem;}
.modal.hidden { display: none; }
.modal-box { background: #fff; padding: 2rem; border-radius: 20px; text-align: center; width: 100%; max-width: 400px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }

/* ==========================================
   📱 MOBILE RESPONSIVENESS (MAX-WIDTH: 768PX)
   ========================================== */
@media (max-width: 768px) {
  /* 1. Settings & Forms: Stack vertically */
  .grid-2 { grid-template-columns: 1fr; }
  
  /* 2. Jobs: 2 Jobs Per Row */
  .job-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 0.8rem; /* Smaller gap for mobile */
  }
  .job-body { padding: 0.8rem; }
  .job-body h3 { font-size: 0.95rem; }
  .job-body p { font-size: 0.8rem; }
  .btn.block { padding: 0.6rem; font-size: 0.85rem; }

  /* 3. Tiers: 3 Tiers on the SAME ROW */
  .tier-grid { 
    grid-template-columns: repeat(3, 1fr); 
    gap: 0.5rem; 
  }
  .tier-card { 
    padding: 1rem 0.5rem; /* Drastically reduced padding to fit 3 across */
  }
  .tier-card h2 { font-size: 0.4rem; }
  .tier-card .price { font-size: 0.8rem; margin-bottom: 1rem; }
  .tier-features li { 
    font-size: 0.7rem; 
    padding: 0.4rem 0;
  }
  .tier-btn-container .btn { 
    font-size: 0.7rem; 
    padding: 0.4rem; 
  }

  /* 4. Shrink general text */
  .hero h1 { font-size: 1.6rem; }
  main { padding: 1rem 0.5rem; }
  .nav { padding: 0.8rem; }
}