/* ================================
   RESET & BASE
   ================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: #f0f5f8; color: #1a1a2e; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: #0a4d68; text-decoration: none; transition: 0.2s; }
a:hover { text-decoration: underline; }

/* ================================
   HEADER
   ================================ */
.header { background: linear-gradient(135deg, #093a5b 0%, #0a4d68 100%); color: white; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 70px; box-shadow: 0 2px 10px rgba(0,0,0,0.15); position: sticky; top: 0; z-index: 100; }
.header-brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: white; }
.header-brand:hover { text-decoration: none; }
.header-logo { height: 42px; width: auto; }
.header-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.5px; }
.nav { display: flex; gap: 0.25rem; }
.nav-link { color: rgba(255,255,255,0.75); padding: 0.5rem 1rem; border-radius: 6px; font-weight: 500; font-size: 0.9rem; transition: all 0.2s; text-decoration: none; }
.nav-link:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }
.nav-link.active { color: white; background: rgba(255,255,255,0.2); text-decoration: none; }
.logout-link { color: rgba(255,255,255,0.75); font-weight: 500; font-size: 0.9rem; padding: 0.5rem 1rem; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3); transition: 0.2s; text-decoration: none; }
.logout-link:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }

/* ================================
   MAIN CONTENT & CONTAINER
   ================================ */
.main-content { flex: 1; padding: 2rem 0; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* ================================
   FOOTER
   ================================ */
.footer { background: #093a5b; color: rgba(255,255,255,0.7); text-align: center; padding: 1.25rem; font-size: 0.85rem; margin-top: auto; }

/* ================================
   PAGE HEADER
   ================================ */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-header h2 { font-size: 1.6rem; font-weight: 700; color: #093a5b; }

/* ================================
   BUTTONS
   ================================ */
.btn { display: inline-flex; align-items: center; padding: 0.6rem 1.25rem; border-radius: 8px; font-weight: 600; font-size: 0.875rem; border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; gap: 0.4rem; }
.btn:hover { text-decoration: none; }
.btn-primary { background: #0a4d68; color: white; }
.btn-primary:hover { background: #093a5b; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(10,77,104,0.3); }
.btn-secondary { background: #e2e8f0; color: #1a1a2e; }
.btn-secondary:hover { background: #d1d9e2; }
.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; padding: 0.75rem; }

/* ================================
   DATA TABLES
   ================================ */
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.data-table thead { background: linear-gradient(135deg, #0a4d68, #0d5f7f); color: white; }
.data-table th { padding: 0.85rem 1rem; text-align: left; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table td { padding: 0.8rem 1rem; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: #f0f8ff; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ================================
   DETAIL CARDS
   ================================ */
.detail-card { background: white; border-radius: 12px; padding: 1.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 1.5rem; }
.detail-row { display: flex; padding: 0.75rem 0; border-bottom: 1px solid #f0f0f0; }
.detail-row:last-child { border-bottom: none; }
.detail-label { font-weight: 600; color: #4a5568; width: 180px; flex-shrink: 0; font-size: 0.9rem; }
.detail-value { color: #1a1a2e; flex: 1; font-size: 0.9rem; }
.detail-value a { color: #0a4d68; font-weight: 500; }
.detail-value a:hover { text-decoration: underline; }

/* ================================
   FORMS
   ================================ */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; color: #1a1a2e; font-size: 0.9rem; }
.required { color: #dc3545; }
.form-input { width: 100%; padding: 0.65rem 0.85rem; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 0.9rem; font-family: inherit; transition: border-color 0.2s; outline: none; background: #fafbfc; }
.form-input:focus { border-color: #2ec4b6; box-shadow: 0 0 0 3px rgba(46,196,182,0.15); background: white; }
.form-textarea { resize: vertical; min-height: 100px; }
.form-errors { color: #dc3545; font-size: 0.8rem; margin-top: 0.3rem; }
.form-help { color: #6b7280; font-size: 0.8rem; margin-top: 0.25rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #f0f0f0; }
select.form-input { appearance: auto; background-image: none; }

/* ================================
   ALERTS & MESSAGES
   ================================ */
.alert { padding: 0.85rem 1.15rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: 0.9rem; font-weight: 500; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error, .alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ================================
   HERO SECTION (Home page)
   ================================ */
.hero-section { background: white; border-radius: 12px; padding: 2.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 2rem; display: flex; align-items: center; gap: 2.5rem; }
.hero-content { flex: 1; }
.hero-content h2 { font-size: 1.75rem; font-weight: 700; color: #093a5b; margin-bottom: 0.75rem; }
.hero-content p { color: #4a5568; line-height: 1.7; font-size: 1rem; }
.hero-image { width: 320px; height: 220px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }

/* ================================
   STATS GRID
   ================================ */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.stat-card { background: white; border-radius: 12px; padding: 1.75rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); transition: transform 0.2s, box-shadow 0.2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.stat-number { font-size: 2.5rem; font-weight: 700; color: #0a4d68; margin-bottom: 0.25rem; }
.stat-label { font-size: 0.9rem; color: #4a5568; font-weight: 500; margin-bottom: 0.75rem; }
.stat-link { font-size: 0.85rem; color: #2ec4b6; font-weight: 600; text-decoration: none; }
.stat-link:hover { text-decoration: underline; }

/* ================================
   ACTIONS BAR
   ================================ */
.actions-bar { display: flex; gap: 0.5rem; }

/* ================================
   EMPTY STATE
   ================================ */
.empty-state { text-align: center; padding: 3rem; color: #6b7280; }
.empty-state p { margin-bottom: 1rem; font-size: 1rem; }

/* ================================
   DELETE CONFIRM
   ================================ */
.delete-confirm { background: white; border-radius: 12px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); max-width: 500px; margin: 0 auto; }
.delete-confirm p { margin-bottom: 1rem; font-size: 0.95rem; }
.delete-warning { color: #dc3545; font-style: italic; font-size: 0.85rem !important; }

/* ================================
   REFERRAL LIST SECTION
   ================================ */
.referral-list-section { margin-top: 2rem; }
.referral-list-section h3 { font-size: 1.2rem; font-weight: 600; color: #093a5b; margin-bottom: 1rem; }

/* ================================
   DOCUMENT LINK
   ================================ */
.document-link { display: inline-flex; align-items: center; gap: 0.5rem; color: #0a4d68; font-weight: 500; padding: 0.4rem 0.8rem; background: #f0f8ff; border-radius: 6px; transition: all 0.2s; text-decoration: none; }
.document-link:hover { background: #e0f0ff; text-decoration: none; }
.document-link svg { flex-shrink: 0; }

/* ================================
   LOGIN PAGE
   ================================ */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #093a5b 0%, #0a4d68 50%, #0d6e8a 100%); font-family: 'Inter', sans-serif; }
.login-container { width: 100%; max-width: 420px; padding: 1rem; }
.login-card { background: white; border-radius: 16px; padding: 2.5rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header img { height: 64px; margin-bottom: 1rem; }
.login-header h1 { font-size: 1.5rem; font-weight: 700; color: #093a5b; margin-bottom: 0.25rem; }
.login-header h2 { font-size: 0.9rem; font-weight: 400; color: #6b7280; }

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
  .header { flex-wrap: wrap; height: auto; padding: 1rem; }
  .nav { order: 3; width: 100%; justify-content: center; margin-top: 0.5rem; }
  .hero-section { flex-direction: column; }
  .hero-image { width: 100%; height: 200px; }
  .stats-grid { grid-template-columns: 1fr; }
  .detail-row { flex-direction: column; }
  .detail-label { width: auto; margin-bottom: 0.25rem; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 0.6rem; }
}
