:root{
  --primary-700:#8B4513; /* Garissa earthy brown */
  --primary-600:#A0522D;
  --primary-500:#CD853F;
  --accent:#FFD700; /* gold */
  --accent-light:#FFE87C;
  --bg:#f6f7f9;
  --success:#28a745;
  --info:#17a2b8;
  --warning:#ffc107;
  --danger:#dc3545;
}
*{box-sizing:border-box}
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';}
.bg-app{background:linear-gradient(180deg,var(--bg),#ffffff);min-height:100vh}
.text-primary-700{color:var(--primary-700)!important}
.link-primary-700{color:var(--primary-700);text-decoration:none}
.link-primary-700:hover{color:var(--primary-600);text-decoration:underline}
.btn-primary-700{
  background-color:var(--primary-700);
  border-color:var(--primary-700);
  color:#fff;
}
.btn-primary-700:hover{
  background-color:var(--primary-600);
  border-color:var(--primary-600);
  color:#fff;
}
.btn-outline-primary-700{
  border-color:var(--primary-700);
  color:var(--primary-700);
}
.btn-outline-primary-700:hover{
  background-color:var(--primary-700);
  border-color:var(--primary-700);
  color:#fff;
}
.logo-circle{
  width:84px;height:84px;border-radius:50%;
  border:4px solid var(--accent); object-fit:cover;
  box-shadow:0 2px 8px rgba(0,0,0,0.1);
}
.login-note{
  border:1px dashed #d0d7de;
  border-radius:.75rem;
  padding:.75rem;
  background:#fff;
}
.card-dash{
  border:0;
  border-left:6px solid var(--accent);
  border-radius:.75rem;
  transition:all 0.3s ease;
}
.card-dash:hover{
  transform:translateY(-3px);
  box-shadow:0 4px 12px rgba(0,0,0,0.15);
}
.table thead th{white-space:nowrap;background:var(--bg)}
.badge-soft{
  background: #eef2ff;
  border:1px solid #c7d2fe;
  color:#3730a3;
}
.footer-muted{color:#6b7280}
.form-section{animation:fadeIn 0.3s ease}
@keyframes fadeIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.step-indicator{transition:all 0.2s}
.step-indicator:hover{opacity:0.8}
.alert-sm{padding:0.5rem 1rem;font-size:0.875rem}

/* Enhanced table scrolling */
.table-responsive {
  position: relative;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-responsive::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--primary-700);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--primary-600);
}

.table thead.sticky-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8f9fa !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0,0,0,0.02);
}

.table-hover tbody tr:hover {
  background-color: rgba(139, 69, 19, 0.05);
  transition: background-color 0.2s ease;
}

/* PDF Preview Modal */
#pdfPreviewModal .modal-body {
  padding: 0;
}

#pdfPreviewModal iframe {
  border: none;
  border-radius: 0.375rem;
}

/* Serial number styling */
.text-muted small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary-700) !important;
}

/* Download success message */
.alert-success.position-fixed {
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button responsiveness */
.btn {
  transition: all 0.2s ease;
  cursor: pointer;
  pointer-events: auto;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn:active {
  transform: translateY(0);
}

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

/* Sidebar navigation */
.nav-link {
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

/* Prevent page freezing */
* {
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow-x: hidden;
}

/* ============================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Mobile-first: Touch-friendly buttons */
@media (max-width: 768px) {
  /* Larger tap targets for mobile */
  .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    touch-action: manipulation;
  }
  
  .btn-sm {
    min-height: 38px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Mobile-friendly forms */
  .form-control, .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
    min-height: 44px;
  }
  
  /* Mobile-friendly cards */
  .card {
    margin-bottom: 1rem;
    border-radius: 0.75rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Mobile table - horizontal scroll */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    display: block;
    width: 100%;
  }
  
  .table {
    font-size: 0.875rem;
    min-width: 800px; /* Force horizontal scroll on small screens */
  }
  
  .table td, .table th {
    padding: 0.5rem;
    white-space: nowrap;
  }
  
  /* Stack table actions vertically on mobile */
  .table td:last-child {
    white-space: normal;
  }
  
  .table td:last-child .btn {
    display: block;
    width: 100%;
    margin-bottom: 0.25rem;
  }
  
  /* Mobile-friendly modals */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  .modal-content {
    border-radius: 0.75rem;
  }
  
  .modal-body {
    padding: 1rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Mobile sidebar - hide by default, show on toggle */
  aside {
    position: fixed;
    left: -260px;
    top: 0;
    z-index: 1050;
    transition: left 0.3s ease;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  aside.mobile-open {
    left: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
  }
  
  /* Mobile menu toggle button */
  .mobile-menu-toggle {
    display: block !important;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1060;
    background: var(--primary-700);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }
  
  .mobile-menu-toggle:active {
    opacity: 0.8;
    transform: scale(0.95);
  }
  
  /* Mobile overlay */
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
  }
  
  /* Main content adjustment for mobile */
  main {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 1rem !important;
  }
  
  /* Mobile-friendly dashboard cards */
  .card-dash {
    margin-bottom: 1rem;
  }
  
  .card-dash .d-flex {
    flex-direction: column;
    text-align: center;
  }
  
  .card-dash .fs-3 {
    font-size: 2rem !important;
  }
  
  /* Mobile-friendly progress bar */
  .progress {
    height: 10px;
  }
  
  /* Mobile-friendly step indicators */
  .step-indicator {
    font-size: 0.75rem;
    padding: 0.5rem;
  }
  
  /* Mobile-friendly alerts */
  .alert {
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
  }
  
  /* Mobile-friendly navigation */
  .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
  
  /* Mobile-friendly filters */
  .row.g-3 > [class*="col-"] {
    margin-bottom: 1rem;
  }
  
  /* Mobile-friendly buttons group */
  .btn-group {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group .btn {
    width: 100%;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem !important;
  }
  
  /* Mobile-friendly input groups */
  .input-group {
    flex-direction: column;
  }
  
  .input-group-text {
    border-radius: 0.5rem 0.5rem 0 0 !important;
    width: 100%;
  }
  
  .input-group .form-control {
    border-radius: 0 0 0.5rem 0.5rem !important;
  }
  
  /* Mobile-friendly footer */
  footer {
    padding: 1.5rem 1rem !important;
    font-size: 0.85rem;
  }
  
  /* Mobile-friendly logo */
  .logo-circle {
    width: 60px;
    height: 60px;
  }
  
  /* Mobile-friendly container */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Mobile-friendly spacing */
  .py-4, .py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  
  /* Mobile-friendly text */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1.1rem; }
  h5 { font-size: 1rem; }
  
  /* Mobile-friendly badges */
  .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
  }
  
  /* Mobile-friendly dropdowns */
  .dropdown-menu {
    max-width: calc(100vw - 2rem);
    left: 1rem !important;
    right: 1rem !important;
    transform: none !important;
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  aside {
    width: 220px;
  }
  
  main {
    margin-left: 220px;
  }
  
  .table {
    font-size: 0.9rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .btn {
    font-size: 0.9rem;
    padding: 0.65rem 1rem;
  }
  
  .card-body {
    padding: 0.75rem;
  }
  
  .modal-dialog {
    margin: 0.25rem;
    max-width: calc(100% - 0.5rem);
  }
  
  .table {
    font-size: 0.8rem;
    min-width: 700px;
  }
  
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.15rem; }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .modal-body {
    max-height: calc(100vh - 150px);
  }
  
  aside {
    width: 200px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn, .nav-link, .step-indicator {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .btn:hover {
    transform: none;
  }
  
  .card-dash:hover {
    transform: none;
  }
  
  /* Better tap feedback */
  .btn:active {
    opacity: 0.8;
    transform: scale(0.98);
  }
}

/* Enhanced Mobile Navigation */
@media (max-width: 768px) {
  /* Navbar mobile adjustments */
  .navbar {
    padding: 0.75rem 1rem;
  }
  
  .navbar-brand {
    font-size: 1rem;
  }
  
  .navbar .ms-auto {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }
  
  .navbar .btn-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  /* Mobile-friendly applicant dashboard cards */
  .row.g-4 > [class*="col-"] {
    margin-bottom: 1rem;
  }
  
  /* Mobile-friendly card body */
  .card-body {
    padding: 1rem 0.75rem;
  }
  
  /* Mobile-friendly buttons in cards */
  .card-body .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .card-body .btn:last-child {
    margin-bottom: 0;
  }
  
  /* Mobile-friendly text alignment */
  .text-center-mobile {
    text-align: center;
  }
  
  /* Mobile-friendly spacing */
  .mb-4-mobile {
    margin-bottom: 1.5rem;
  }
  
  /* Mobile-friendly icons */
  .fs-1 {
    font-size: 2.5rem !important;
  }
  
  /* Mobile-friendly status badges */
  .badge {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  /* Mobile-friendly filter section */
  .filter-section {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
  }
  
  /* Mobile-friendly chart containers */
  .chart-container {
    height: 250px !important;
    margin-bottom: 1rem;
  }
  
  /* Mobile-friendly table actions */
  .table .btn-group {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .table .btn-group .btn {
    width: 100%;
    margin: 0;
  }
  
  /* Mobile-friendly modals - full screen on small devices */
  @media (max-width: 480px) {
    .modal-dialog {
      margin: 0;
      max-width: 100%;
      height: 100%;
    }
    
    .modal-content {
      height: 100%;
      border-radius: 0;
    }
    
    .modal-header {
      border-radius: 0;
    }
    
    .modal-body {
      max-height: calc(100vh - 120px);
      overflow-y: auto;
    }
  }
  
  /* Mobile-friendly form inputs */
  .form-control:focus,
  .form-select:focus {
    border-color: var(--primary-700);
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
  }
  
  /* Mobile-friendly scrollbars */
  * {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Mobile-friendly loading states */
  .spinner-border-sm {
    width: 1rem;
    height: 1rem;
  }
  
  /* Mobile-friendly alerts */
  .alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Mobile-friendly progress indicators */
  .progress {
    height: 8px;
  }
  
  /* Mobile-friendly step indicators */
  .step-indicator {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
    margin: 0.25rem;
  }
  
  /* Mobile-friendly footer */
  footer {
    padding: 1.5rem 1rem !important;
    font-size: 0.8rem;
    text-align: center;
  }
  
  footer p {
    margin-bottom: 0.5rem;
  }
  
  /* Mobile-friendly registration form */
  .card.rounded-4 {
    border-radius: 1rem !important;
  }
  
  /* Mobile-friendly form sections */
  .form-section h5 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  /* Mobile-friendly input groups in forms */
  .row.g-3 > [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Mobile-friendly validation messages */
  .invalid-feedback,
  .valid-feedback {
    font-size: 0.8rem;
  }
  
  /* Mobile-friendly submit buttons */
  .btn-primary-700,
  .btn-success,
  .btn-primary {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
  }
  
  /* Mobile-friendly back buttons */
  .btn-outline-light,
  .btn-secondary {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  /* Mobile-friendly card headers */
  .card-header {
    padding: 1rem 0.75rem;
  }
  
  .card-header h4 {
    font-size: 1.1rem;
  }
  
  /* Mobile-friendly logo in headers */
  .card-header .logo-circle {
    width: 40px;
    height: 40px;
  }
  
  /* Mobile-friendly progress bar container */
  .progress.mt-3 {
    margin-top: 0.75rem !important;
  }
  
  /* Mobile-friendly step indicators container */
  .d-flex.justify-content-between.mt-2 {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  /* Mobile-friendly step indicator text */
  .step-indicator {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
  }
  
  /* Mobile-friendly autosave indicator */
  .autosave-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1050;
    max-width: calc(100vw - 20px);
  }
  
  .autosave-indicator .alert {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    margin-bottom: 0;
  }
  
  /* Mobile-friendly form navigation buttons */
  .d-flex.justify-content-between.mt-4 {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .d-flex.justify-content-between.mt-4 button {
    width: 100%;
    margin: 0;
  }
  
  /* Mobile-friendly ms-auto container */
  .ms-auto {
    width: 100%;
  }
  
  .ms-auto button {
    width: 100%;
  }
}

/* Enhanced Radio Button Group Styling */
.radio-group {
  display: flex;
  gap: 20px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 12px 20px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: #fff;
  flex: 1;
  min-width: 200px;
}

.radio-label:hover {
  border-color: var(--primary-700);
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #adb5bd;
  border-radius: 50%;
  margin-right: 10px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
  border-color: var(--primary-700);
  background-color: var(--primary-700);
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
  content: '';
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.radio-label input[type="radio"]:checked ~ strong {
  color: var(--primary-700);
  font-weight: bold;
}

.radio-label:has(input[type="radio"]:checked) {
  border-color: var(--primary-700);
  background-color: #fff8f0;
}

/* Enhanced Sign In Button */
.sign-in-btn {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 100%) !important;
  border: none !important;
  padding: 14px 24px !important;
  font-size: 18px !important;
  font-weight: bold !important;
  box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3) !important;
  transition: all 0.3s ease !important;
  color: white !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sign-in-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4) !important;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%) !important;
}

.sign-in-btn:active {
  transform: translateY(0) !important;
}

.sign-in-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.25) !important;
}

/* Mobile responsive for radio group */
@media (max-width: 768px) {
  .radio-group {
    flex-direction: column;
    gap: 10px;
  }
  
  .radio-label {
    min-width: 100%;
    padding: 10px 15px;
  }
}

/* =========================================
   COMPREHENSIVE FORM INPUT RESPONSIVENESS
   ========================================= */

/* Fluid Inputs - 100% width on all devices */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="tel"],
input[type="password"],
select,
textarea {
  width: 100% !important;
  min-height: 48px; /* Touch target size */
  padding: 0.75rem 1rem;
  font-size: 16px; /* Prevents iOS zoom on focus */
  border: 1px solid #ced4da;
  border-radius: 6px;
  background-color: #fff;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  box-sizing: border-box;
}

/* Focus State - Accessibility & UX */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-700);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.2);
}

/* Form Groups - Full width on mobile */
.form-group {
  margin-bottom: 1.5rem;
  width: 100%;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -10px;
  margin-left: -10px;
}

.form-col {
  flex: 0 0 100%;
  max-width: 100%;
  padding: 0 10px;
}

/* Tablet: 2 columns */
@media (min-width: 600px) {
  .form-col {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Desktop: 4 columns for filters */
@media (min-width: 1024px) {
  .filter-grid .form-col {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

/* =========================================
   ENHANCED BUTTON RESPONSIVENESS
   ========================================= */

/* Mobile-first: Buttons are 100% width and stacked */
@media (max-width: 599px) {
  .btn {
    width: 100% !important;
    margin-bottom: 0.75rem;
    display: block;
  }
  
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group .btn {
    width: 100%;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem !important;
  }
}

/* Tablet & Desktop: Buttons revert to natural width */
@media (min-width: 600px) {
  .btn {
    width: auto;
    margin-bottom: 0;
    margin-right: 0.5rem;
    display: inline-flex;
  }
  
  .btn-group {
    flex-direction: row;
  }
}

/* Print styles */
@media print {
  aside, .mobile-menu-toggle, .btn, footer {
    display: none !important;
  }
  
  main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

